#mod_development
1 messages Β· Page 304 of 1
Maybe running faster with sneakers works. I won't check, so you can keep the placebo effect going π
it doesn't
You're saying spending $500 on a pair of Nike Placebos was a ripoff?
no
that's kinda stupid ngl
I don't regret adding discomfort value to boots
They are for me, I made a mod that makes footwear take durability and I plan to add in negative effects to prolonged dirty/wet socks/shoes
I wonder if you could have leather boots break-in over time and reduce discomfort.
feels like a lot of hassle, but on the other hand it would give you a personal pair of boots you care about and would repair when they break instead of just swapping them.
*the upsides aren't that major unless you specifically mod in major upsides
Make it so underpants get dirty too, and add discomfort for that.
Add a "durability" to the boots, have it tick every 10 minutes or hour they're equipped, once they pass the threshold have them remove the discomfort modifier
Or a Moddata value
well I mean I did put durability in quotes, it's just whatever value you wanna track
I think discomfort is one of the values that gets reset on every game load from the values in the script files, so you'd ave to restore that on game load too.
or just replace the boots with an identical version that doesn't have that value, and stops trying to track the mod data
Bad news: items just return discomfort from the script values, they don't have a local value at all.
the idea if you can store/retrieve any lua values you want (i.e.: a table) to an object or player.
it's just a table attached to the object
as an example, how would I add a tracker to an item?
local mdata = item:getModData()
mdata.SomeVariableToStore = 123
It's probably a good idea to add a creator prefix to whatever you add to moddata to avoid conflict with other mods.
yeah I do this too, it was just a short example
local mdata = item:getModData()
mdata.SaltyOreosStored = 123
I use a sub-table like
local mdata = item:getModData()[mod_constants.MOD_ID]
mdata.Thing = 123
then you dont have to prefix everything
local mdata item:getModData()
local Oreos = mdata.SaltyOreosStored
Function Start
local Oreos = Oreos + 1
Function End```
?
that only edits the Oreos variable, not the mod data

as long as you have an index operation in the statement it will let you add to the mod data like
item:getModData().SomeThing = 123 -- updates correctly
mdata.SomeThing = 123 -- updates correctly
local thing = mdata.SomeThing
thing = 123 -- incorrect
print(thing) -- prints "123"
print(mdata.SomeThing or "nil") -- prints "nil"
That's a cool solution
ya, its great not having to worry about name conflicts
local mdata item:getModData()
local Oreos = mdata.SaltyOreosStored
Function Start
local Oreos = Oreos + 1
Function End
local mdata.SaltyOreosStored = Oreos
?
I'm not understanding π
you really should try to understand lua better no offense
in the example "function", you are using local to specify a new variable, so instead of updating the prevous Oreos variable it will just create a new one
make sure you initialise the subtable though otherwise its nil
:(
so remove the local in the function and it'll work at intended or?
it's okay. it was same for me too. it was just like a crazy until I understood
it makes much more sense to just do mdata.SaltyOreosStores = mdata.SaltyOreosStores + 1 than repeatedly moving it into and out of a local variable
btw item isnt a global, it was placeholder for whereever your item is
yeah I know
you'd also most likely need to retrieve the mod data inside the function, and probably lazy init the value too
was supposed to be stored not stores π΅βπ«
does mod data need to be global or local, I'm confused
here's an example of how i would use mod data```lua
---@param item InventoryItem
local function updateModData(item)
--get the item's mod data table
local moddata = item:getModData()
--check if our key already exists
if not moddata.SaltyOreosStores then
--if it doesn't, set it to a default value
moddata.SaltyOreosStores = 0
end
--increment the counter in the mod data
moddata.SaltyOreosStores = moddata.SaltyOreosStores + 1
end
that's not how object mod data works
its only for global mod data
object mod data is literally just a table
I thought they used the same object, if it's just a table named modData then ignore all that.
<confusing messages removed>
I hope my cows breed soon otherwise I'm going to have to write an artificial insemination mod and that means researching things like "how many calories in bull semen" so I can get the fluid stats correct.
nono, global mod data is a global table that can be accessed anywhere and think of it like a mod data table for the world/save
object mod data is an object-specific mod data table that can be accessed via thing:getModData() and is usually an item or vehicle.
Well if youβre gonna do that then you have to also make an energy drink mod that uses bull semen

is it normal for blood to not show up on the hood of the car im working on?
i did texture it and all that. and painted the blood onto it
but when i activate the blood functions ingame and set them all to 100% it never gets bloody
i'm guessing if its all divided in the first place i'm supposed to reassign it somewhere, but i don't know where to do that
taurine is used in energy drinks, and is very commonly found in bull semen. I don't think it's used as much anymore, but I do remember that it was a big source at a point in time
Is it possible to inject Tags into items?
yeah put a txt file in scripts, you can name it whatever you want.
format it like this
module Base
{
item ItemName
{
Tags: TagName;OtherTagName,
}
}```
This one I have adds the FitsKeyRing tag to various items
module Base
{
item MagnesiumFirestarter
{
Tags = FitsKeyRing,
}
item Locket
{
Tags = FitsKeyRing,
}
item PenLight
{
Tags = FitsKeyRing,
}
item Glasses_Cosmetic_MonocleLeft
{
Tags = FitsKeyRing,
}
item Glasses_Cosmetic_MonocleRight
{
Tags = FitsKeyRing,
}
item MilitaryMedal
{
Tags = FitsKeyRing,
}
item Glasses_MonocleLeft
{
Tags = FitsKeyRing,
}
item Paperclip
{
Tags = FitsKeyRing,
}
item JigLure
{
Tags = FitsKeyRing,
}
item MinnowLure
{
Tags = FitsKeyRing,
}
item Bobber
{
Tags = FitsKeyRing,
}
}```
just be sure to have the txt file named something unique to prevent file overwrites
Ah nice, and that doesn't overwrite items so it's save game compatible ya?
Most params done this way will replace the param, but tags are unique and instead adds to them
yeah it just edits existing params/adds new params
don't need the entire item, just the params you wanna change
meaning you don't need to include every tag already on the item
but tags are unique and instead adds to them
wait really?
yeah tags specifically act differently, no idea why
makes it really easy to work on my keyring/wallet mod tho lol, so i'm not gonna question it too much
/* Vanilla Script */
item Lemon
{
DisplayName = Lemon,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = Lemon,
FoodType = Citrus,
Spice = true,
DaysFresh = 7,
DaysTotallyRotten = 9,
HungerChange = -10,
ThirstChange = -5,
Calories = 17,
Carbohydrates = 5.41,
Lipids = 0.17,
Proteins = 0.64,
CustomEatSound = EatingFruit,
StaticModel = Lemon_Ground,
WorldStaticModel = Lemon_Ground,
Tags = HerbalTea,
}
myHelloWorldScript.txt
item Lemon
{
Tags = someTags,
}
then Lemon has Tags = HerbalTea;someTags, ??
Same here, I was trying to use the CanEat tag to figure out what headgear was blocking for eating/smoking but its only on a few masks I realized π©
Just going to throw a custom tag to form a blocklist
as far as I know, the only way to overwrite items is to copy the directory path and file name to overwrite the entire file

yeah it will keep the existing tags and add on the ones specified in the new file
thank you for let me know. that's a huge advantage.
Yeah, idk if it's entirely intentional or not though.
So there may be a future update that breaks mods doing it this way.
That goes for any mod tho, so I wouldn't worry too much about it
wouldn't be modding an unstable version if you were scared of updates breaking mods
I had another question related.
Do you know what will be happened, will this be also working if I just want to simply overwriting Weight, or should I redefine all params?
myHelloWorldScript.txt
item Lemon
{
Weight = 99,
}
Wesch taught me this a couple days ago.
Well they specifically taught me that you can edit params with script and not specify the rest of the params. I learned the tags thing later.
yeah that would work fine.
Make sure it's inside of
module Base {}
like normal item scripts
changing the module means it will create a new item instead of editing the existing vanilla item
{
item PotForged
{
FillFromDispenserSound = GetWaterFromDispenserMetalMedium,
FillFromLakeSound = GetWaterFromLakeSmall,
FillFromTapSound = GetWaterFromTapMetalMedium,
FillFromToiletSound = GetWaterFromToilet,
Tags = Cookable;HasMetal,
component FluidContainer
{
ContainerName = Pot,
RainFactor = 0.8,
capacity = 1.5,
CustomDrinkSound = DrinkingFromMug,
}
}
}```
https://steamcommunity.com/sharedfiles/filedetails/?id=3428502992
yep π
I'm just confused because that kind of way didn't work for me in B41 if I remember correctly. so long time ago, when I started modding in PZ
the entire mod is that text file
If I'm not messing with tags and I'm editing a lot of items at once tho, I like to use lua instead
as tags are mainly important for recipes
local UncomfortableFootWear = { -- List of shoes/boot to add discomfort to
"Base.Shoes_BlackBoots",
"Base.Shoes_RidingBoots",
"Base.Shoes_Wellies",
"Base.Shoes_HikingBoots",
"Base.Shoes_ArmyBoots",
"Base.Shoes_ArmyBootsDesert",
"Base.Shoes_CowboyBoots_Brown",
"Base.Shoes_CowboyBoots",
"Base.Shoes_CowboyBoots_Black",
"Base.Shoes_CowboyBoots_Fancy",
"Base.Shoes_CowboyBoots_SnakeSkin",
"Base.Shoes_WorkBoots"
}
for i=1, #UncomfortableFootWear do -- this gets the amount of items in UncomfortableFootWear, and then does the code below that amount of times
local ItemName = UncomfortableFootWear[i] -- this would be getting each item from the list one at a time
local item = ScriptManager.instance:getItem(ItemName) -- Item name references the UncomfortableFootWear[i] which is the individual item in the list
if item then
item:Load(item:getName(),
[[{
DiscomfortModifier = 0.1,
}]])
end
end
https://steamcommunity.com/sharedfiles/filedetails/?id=3419268636
The script I use in trench foot to add 0.1 discomfort to all the vanilla boots
editing params this way also makes it so they don't get smudged with the "overridden by mod" text
But like I said, this method doesn't work for adding tags for recipes due to lua being loaded too late for recipes.
Ahh this works so well TY again @vast pier 
glad to hear
I just realized my first message here was me asking a question about something for a mod I was working on before joining the discord.
Was I just reverse engineering the game or something? I didn't look up any guides or talk to any modders and yet my first question is about a partially implemented mod feature I made??
I remember now, I literally joined the discord server because I didn't know how the translation stuff worked. My first mod "Semi Realistic Fluid Containers" was being developed by literally just reverse engineering game files and a mod I had downloaded before losing internet
My unlisted test mod upload time vs my first ever message in this server
Hi mates
Is there any way to add rotten fruits to craft?
Trying it by Base.GrapesRotten
And game just crushes on loading save : /
you can also do
local function updateItem()
local item = ScriptManager.instance:getItem("Base.ItemName")
if item then
item:DoParam("Tags = WhateverTag")
end
end
Events.OnGameBoot.Add(updateItem)
doesn't work for recipes tho due to load order
that's why I said the script method
instead of lua
its for item def yea
If you add tags to items via lua then those tags won't be picked up by recipes that use that tag
maybe theres a way to prioritize it hmmm
I don't think GrapesRotten exists, I'm pretty sure rotten food uses a modifier or something, it's still usually the original item
just with special data
some items transform into new items when they rot, but most don't
yeah it's a boolean value
idk how you would check for rotten food in recipes
Meh
Thx for info
What are you wanting to use rotten grapes for?
For wine
you could maybe do a workaround by creating a new rotten grape and call it Fermented Grapes or something, and have the original grapes transform into that item when they rot
{
DisplayName = Rice,
DisplayCategory = Food,
Type = Food,
Weight = 3,
Icon = PotFull,
BadInMicrowave = true,
CookingSound = BoilingFood,
EatType = Pot,
PourType = Pot,
ReplaceOnUse = Pot,
DaysFresh = 1,
DaysTotallyRotten = 1,
UnhappyChange = 30,
Calories = 387,
Carbohydrates = 100,
Lipids = 0,
Proteins = 0,
StaticModel = CookingPotGround_Fluid,
WorldStaticModel = CookingPotGround_Fluid,
Tags = HasMetal,
HungerChange = -30,
SoundMap = DumpContents EmptyPot,
ReplaceOnRotten = SugarBeetSugarPot,
}```
flags[AllowRottenItem] after input item
unless you want to allow only rotten food (Not stale or fresh one)
If you want the wine to ferment then use
ReplaceOnRotten = SugarBeetSugarPot,```
to transform it into a new item when it rots
Thx!!!
I was thinking about using this to make a sourdough starter mod
DaysFresh = 1,
DaysTotallyRotten = 1,```
I think this means it rots into SugarBeetSugarPot in 2 days
not entirely sure
yeah
What do I need to call to perform the ClothingItemExtraOption on items that have them?
ISInventoryPaneContextMenu.onClothingItemExtra()??
When looking at the decompiled java or the zomboid modding docs website, how can I tell if a particular java class / field is exposed to the lua?
ISTimedActionQueue.add(ISClothingExtraAction:new(player, item, <fullType of item 2>)) 
i think only methods are exposed and not any fields
Is it possible to fix the font size in UI?
I want to prevent the font size from changing depending on the option.
The java doc should show mostly exposed stuff
Depending on what option ?
I want to ignore the font size setting option.
That's a thing ? I mean, I don't think you should ignore it tbf or that going to make your UI look pretty weird, tho I personally didn't even knew that was a thing
I suggest you check the vanilla code for a bunch of UI, ik I've seen it already, but I don't remember exactly how
I want to prevent the text in the UI I'm writing from leaving the desired location.
It involves the Font java object, that I know of
The best thing would be to adapt your UI size
There are too many UIs to create UI by font size. lol
If I can't find a way, I'm going to make it work only for a specific font size.
When looking at an object in the debugger, is there a way to sort, filter, or dump the columns?
nope!
I'm wondering if it would be possible to have a mod that keeps the street lights on even after the power cutoff. I really like the ambiance it creates at night and it's a shame I can't experience it as much as I would want to. But I also like the added intensity of looting a pitch black building, so having electricity always on is not an option really.
Since I've never done any mod, I'm wondering if this could potentially be doable with the modding API? I have a background in software engineering so technically it should be ok. I just want to know if it's worth investing time in this as maybe it's not technically possible with the current API.
Do you guys have any idea maybe?
just quick inspiration, there's a bug where refrigerator makes light even global power has been off in current version.
Maybe you can use this bug idk how tho
Tho that's what the base game does I believe π
so me and some friends are making a simple mod , where when near a tent the character wetness should stop accumulating from the rain, but we don't know how to do that LOL* (since we are just a bunch of idiots trying to coding, TOGETHER WE ARE APES!!! lol)* we are kind of stuck and don't know what to do, we manage to make it work but it only resets wetness = 0, but what it should do is stop the wetness accumulation under/near the tent so we can wring it out. can someone check the code?
You'll have to intercept the wetness variation, which I don't think can be done too easily
You'll have to store the last wetness value and calculate the delta
Hey guys
I have limited knowledge about the new fluid system and recipes
for example, how I can replicate the effect of opening any can or bottle with custom items, so for mods
So, like, I know the basic scripting of creating models or items, but I don't know how I can create a proper custom recipe (so it also appears in the context menu) that can convert a "sealed can" already with fluid in it, to a "opened can", where the player then drinks out of it.
Since b42, food and drinks are more separated, now with the fluid and stuff
Have a look at the vanilla item scripts.
item BeerCan
{
DisplayName = Beer Can,
DisplayCategory = Food,
Type = Normal,
Weight = 0.3,
Icon = BeerCan,
EatType = popcan,
Packaged = TRUE,
StaticModel = BeerCan,
WorldStaticModel = BeerCan_Ground,
FillFromDispenserSound = GetWaterFromDispenserMetalMedium,
FillFromLakeSound = GetWaterFromLakeSmall,
FillFromTapSound = GetWaterFromTapMetalMedium,
FillFromToiletSound = GetWaterFromToilet,
Tags = LowAlcohol;HasMetal;EmptyCan;SealedBeverageCan,
EatTime = 160,
component FluidContainer
{
ContainerName = CanBeer,
Opened = false,
capacity = 0.3,
CustomDrinkSound = DrinkingFromCan,
Fluids
{
fluid = Beer:1.0,
}
}
}
This is where we actually get to see the benefit of the new tags/recipe/fluid system instead of suffering because of it - if you make an item with the same tags/properties then it will get picked up by the "open sealed can" recipe.
when opened by the recipe the item's fluidcontainer will be updated, and the displayed name will go from sealed -> open and you can drink from it.
No need to make separate items for sealed can, open can and empty can with a decicated recipe for each type of can like you would need to do in B41 (which is why in B41 there was no "open can" step)
I think we got it, with enough wild , AI and comparing notes we kinda managed to do it lool but not perfect but its there π
https://steamcommunity.com/sharedfiles/filedetails/?id=3429176285
behold the abomination π hope nothing conflicts looooooool we never tested it for anything besides vanilla b42 tents
One suggestion: if you attach your code to OnPlayerMove OnPlayerUpdate it will be running constantl checking the surrnding tiles for tents and making API calls to get the wetbness of player and all their clothes.
unfortunately, thats gonna be beyond our collective tiny brains..
You don't need to handle this every frame' wetness isn;t that quick. Either use an event like function like EveryOneMinute or EverTenMinutes
or add a very simple tick counter so your code only runs every X ticks
local ticksPassed = 0
local runEveryX = 500
local function StopRainAndClothesExposure()
if ticksPassed < runEveryX then
ticksPassed = ticksPassed +1
return
end
ticksPassed = 0
<expensive code here>
end
that looks cool, we'll add it to our notes. thank you π
you can also add a player parameter to StopRainAndClothesExposure() instead of using getPlayer(), since OnPlayerUpdate passes the player object of the player being updated. (you already do this for CheckTentState)
That way you don't need to worry about what getPlayer() will return when multiplayer is added
we'll check all of these later.. :3 thank you. still learning how to do these stuff.
It looks really good for a first mod.
we just hope it doesnt break saves because jesus christ our lord we dont want that ;_;
I don't see any risk of that - you're not changing anything that will get saved.
Wdym? Do I already specify in the recipes that I want the parameter (in items) "Opened" to be "True" when the recipe "Open Sealed Can" gets triggered?
I mean if you just copy the item script for the vanilla item and change the name/fluid inside/etc it should just work.
No need to mess around with recipies or lua functions.
Nah, I mean I've looked up the vanilla recipe for beercan and beverage yesterday
I've somehow read "Beer" for all three
I'm not sure, not on my PC rn
Here's a quick test; obviously changing the model to use a different texture would make more sense.
module Base
{
item NepFunCan
{
DisplayName = Can of Fun,
DisplayCategory = Food,
Type = Normal,
Weight = 0.3,
Icon = BeerCan,
EatType = popcan,
Packaged = TRUE,
StaticModel = BeerCan,
WorldStaticModel = BeerCan_Ground,
FillFromDispenserSound = GetWaterFromDispenserMetalMedium,
FillFromLakeSound = GetWaterFromLakeSmall,
FillFromTapSound = GetWaterFromTapMetalMedium,
FillFromToiletSound = GetWaterFromToilet,
Tags = LowAlcohol;HasMetal;EmptyCan;SealedBeverageCan,
EatTime = 160,
component FluidContainer
{
ContainerName = CanBeer,
Opened = false,
capacity = 0.3,
CustomDrinkSound = DrinkingFromCan,
Fluids
{
fluid = Tequila:1.0,
}
}
}
}
So I should change the ContainerName as well, and add translationd strings
But that's the functionality working without any work beyound adding the one item definition
ah, I get it now, it was propably because the function name of opening cans is "OpenBeer"
and I first thought it was kinda wrong or i missed soemthing looking around
There is a lot of stuff like that, where the generic name is the name of the first version that was coded.
yeah
but
would changing its name in the vanilla files break the game?
or is it pretty easy to do it?
so maybe there will be a patch in the next updates
You don;t change any vanilla files, you add a new item
Recipes have already been broken twice since B42 came out.
ok
Don't stress about that, just update when needed.
And container name? Is it important to change the name or can I leave it as "CanBeer"?
or "CanPop"?
ok
That works
The Tequila works too. π
It's not doing the partly-squished-can model when empty, so I assume that is something to do with having a model with special name for when empty.
Hey peeps, for items that have multple sprites/textures to choose from, whereabouts would i find the code that does the selecting?
eg below
{
DisplayName = Electric Guitar,
WeaponSpritesByIndex = Guitar_ElectricBlack;Guitar_ElectricBlue;Guitar_ElectricRed,
IconsForTexture = GuitarElectricBlack;GuitarElectricBlue;GuitarElectricRed,
DisplayCategory = InstrumentWeapon,```
i've tried re-making the item to only have 1 weapoon sprite and icon, but it's still changing between black, red and blue
There is probably an associated .xml
I know that's how clothing works.
I seem to be wrong on that, or at least it's not handled the same way.
anyone knows how to fix it i don't know what it means
LOG : Mod f:0, t:1739801201851> mod "\VoiceKrysitanChang" overrides media/voicestyles/voicestyles.xml
That means your file has the same name as a file in vanilla/another mod.
normally you want to avoid that BUT sometimes it is the correct way to make things work, like with translation files
Or rubbish like this: mod "\82porsche911" overrides icon.png .
No idea if that is an issue with voicestyles.xml, but if all the vanilla voice styles vanish after enabling your mod the first thing to do is rename that file.
yea im trying to override that item with a modified script item within a base module.
Im using my own models and textures in the folder, which are being used correctly.
I've made my own items for the red and blue variants for both electric and bass guitars. but when i grab a black one, it will often change to a red/blue one.
i love you
Hey, with everything now applied for my mod, I can't start my game, because it crashes ;/
ERROR: General f:0, t:1739805254164> FluidDefinitionScript.Load > Unknown block 'fluid' val(JuneBerryFluid) in fluid definition: goenergy.JuneBerryFluid
LOG : General f:0, t:1739805254166> [fluid] removing script due to load error = JuneBerryFluid
ERROR: General f:0, t:1739805254167> ExceptionLogger.logException> Exception thrown```
My Code :```module goenergy {
imports {
Base
}
item JuneBerry
{
DisplayName = Goenergy JuneBerry Can,
DisplayCategory = Food,
Type = Normal,
Weight = 0.5,
Icon = JuneBerry,
EatType = popcan,
Packaged = TRUE,
StaticModel = JuneBerry,
WorldStaticModel = BeerCan_Ground,
FillFromDispenserSound = GetWaterFromDispenserMetalMedium,
FillFromLakeSound = GetWaterFromLakeSmall,
FillFromTapSound = GetWaterFromTapMetalMedium,
FillFromToiletSound = GetWaterFromToilet,
Tags = HasMetal;EmptyCan;SealedBeverageCan,
EatTime = 160,
component FluidContainer
{
ContainerName = CanGoenergy,
Opened = false,
capacity = 0.5,
CustomDrinkSound = DrinkingFromCan,
Fluids
{
fluid = JuneBerryFluid:1.0,
}
}
}
model JuneBerry
{
mesh = JuneBerry,
scale = 0.005,
static = true,
texture = JuneBerryTex,
}
fluid JuneBerryFluid
{
Color = 0.522 : 0.047 : 0.365,
DisplayName = JuneBerry
Categories
{
Beverage,
}
Properties
{
fatigueChange = -20,
hungerChange = -10,
stressChange = 0,
thirstChange = -20,
unhappyChange = -10,
calories = 10,
carbohydrates = 0.5,
lipids = 0,
proteins = 0.5,
alcohol = 0,
fluReduction = 0,
painReduction = 0,
enduranceChange = 0,
foodSicknessReduction = 0,
}
}
}```
DisplayName = JuneBerry``` should there be a comma after the JuneBerry?
yea
now it works
but I was kinda confused because the debugging said that only the script loading failed
and that the entire block was unknown
noice!
yea the logs can be a little confusing.
always good to keep an eye out for syntax when shit goes wrong, is the cause 90% of the time
anyone know how to use the isDrawDirty()
when the items add or remove frome the itemcontainer , the isDrawDirty() didn't change
another question:
If I drink my container until it's empty, how can I then make it turn into the item, that was designed as a placeholder for the original Item, if it gets emptied ("Empty XYZ Can")?
I have both items in my script rn but I'm just stuck at making the one turn into another when I empty it
Congrats !
Anyone have best practices for multiplayer synchronization? I have a custom timed action that plays an animation, plays sound, and a muzzle flash. This is all client side. I want to ensure all players see these effects though. I can't tell if I should run sendClientCommand() to handle the effects or if I am good the way it is now? I'm also curious about "best practices" here.
?
@frank jetty @mortal escarp Sorry, can't help, I don't know anything about either... π
B42 ?
If you use timed actions, these should be correct
If it's build 42, you don't need a full and empty item
You only need a single item
Overall it depends what your code does
Looks like since I'm using timed actions, like 90% of it is already synced. I do need to figure something out with the muzzle flash though, looks like it's only appearing client side.
But yeah timed actions should be synced
I just figured out the "-nosteam" argument when launching the game, so that is super helpful for testing
whats that do
Allows having two instances of the game open and play in host
neat
hey guys
quick question
when working with a vehicle mod do i have to restart the game every time i make a change?
or can i just go reload lua via mods tab and open it again
ive lost a lot of time to restarting constantly
lua files can be reloaded ingame with the f11 tab if you're in debug mode. .txt files need a restart of the session, not the entire game, just quit and restart instead of "return to desktop"
oh, thanks
this should make the tuning process easier
if only the loadtimes were faster haha
wait actually
Anyone know if this is implemented? Doesn't seem to work properly for me and searching in lua folder it is only referenced in the foraging script.
for txt in 42 you need to also click "reload lua", and sometimes it's not working good and a restart is better
noted
btw
is there a way to open up some debug map that's just flat with nothing on it
so i dont haveto load the whole world
ik you could do this in stalker and that was very convenient, would be nice if there was something like this here
no clue on that sorry
what the hell man
horrific
how are the TIS devs dealing with the loadtimes every time when trying to debug stuff LOL
I'm basically trying to figure out how to disable spawning for certain items from any source. Without having to manually edit every distribution or something ideally.
ItemName_EN = {
ItemName_CreditCard_Player = "Personal Credit Card",
}
getText("ItemName_CreditCard_Player")
Someone have a clue why the get text doesn`t return the readable text instead of variable name?
i've also tried getText("CreditCard_Player") with no luck
wdym
Anyone know how to get "getPlayer():startMuzzleFlash()" working on multiple clients at once? This code is simplified but the final piece I'm dealing with is a player obj and it is calling that exact function. This happens from within a time action. For the user that starts the timed action, they see a muzzle flash. For other clients connected to the game, there is no muzzle flash.
I know this is a client/server type of issue but I am really struggling to solve it.
@bright fog It sounded like you had some multiplayer experience from my question earlier? You have any ideas on how to approach a fix to this?
@gleaming wedge I had a very similar issue but it was with Sandbox_EN.txt. I was missing a final trailing comma (","). Looks like you have that though. This is tricky to debug without knowing more. I guess I'd double-check your file structure? I doubt that is the issue if you have even one other translation working though
I have no idea sry
yeah i have translation working fine, i just can't find a way to add a brand new variable
@gleaming wedge This may seem silly but try removing the trailing comma? I don't know man, this looks correct from the outside. Dealing with translation problems is annoying af
@gleaming wedge I haven't dealt with this particular translation file but when I compare what you posted to the source translation files in B41, it is a little different. They are using "." character in there instead of "_" characters. I don't know how that would realistically affect anything though.
Can you append Tags with this method?
good point, gonna try putting it in UI instead
WORKED, genius π
Yes, but tags added this way WON'T work for recipes
Roger, will that syntax append or overwrite? I've seen people do getTags():add() but that wasn't working when I tried last, maybe just an error on my end
For build 42 it should append? not entirely sure for doing it via lua tho
Are we still limited to full overwrites or lua for recipes?
Do you mean to edit recipes themselves or add tags to items for recipes?
Cuz if you just wanna add tags to items for recipe purposes, you can use item scripts instead of lua
#mod_development message
Still limited then, yeah
yes, heres an example on how i do it:
local function appendSample()
if not ScriptManager.instance then return end -- Ensure ScriptManager exists
local item = ScriptManager.instance:getItem("Base.Item")
if not item then return end
local currentTags = item:getTags()
local newTagsList = {"Tag1", "Tag2"}
local tagsSet = {} -- use set to avoid dup tags
-- here we add existing tags to the set
if currentTags and not currentTags:isEmpty() then
for i = 0, currentTags:size() - 1 do
tagsSet[currentTags:get(i)] = true
end
end
-- add new tags
for _, tag in ipairs(newTagsList) do
tagsSet[tag] = true
end
-- convert the set back to a list and update it
local mergedTags = {}
for tag in pairs(tagsSet) do
table.insert(mergedTags, tag)
end
item:DoParam("Tags = " .. table.concat(mergedTags, ";"))
end
Events.OnGameBoot.Add(appendSample)
How do I refer to every Base.Hat_* etc. item like the world item removal sandbox option seems to do? Got a custom item removal lua working but I'd rather not have to make an entry for every subitem like that.
nvm looks like lua has wildcards, testing
If you're iterating through all items you can check for name:find("Hat_") to see if the string name contains "Hat_"
Or a dozen other ways to do the same thing.
for _, item in ipairs(items) do
RemoveItemFromDistribution(Distributions[1], item, nil, true)
RemoveItemFromDistribution(ProceduralDistributions.list, item, nil, true)
RemoveItemFromDistribution(SuburbsDistributions, item, nil, true)
end
end
removeItemsFromDistributions(itemsToRemove)```
with itemsToRemove being array of strings
is RemoveItemFromDistribution a vanilla function?
I've never had cause to remove items from distribution.
try to fetch the other player by using getPlayerFromId or something like that
or from.the square
and put the muzzle on that playerobject
see if it works
i mean if you see that the player shows the muzzle flash
tho on their perspective they wont be able to see it
once you acomplish this then just send a command to server and server to client then everyone on the server recives the command that triggers the muzzle flash from a specific player object
What math is used to determine maintenance xp gain?
@prisma imp For converting to a wildcards, do you need it to be done at runtime or would it be enough to get a list of all Hat_ items in vanilla and add that manually to the itemsToRemove list?
why do your nipples seem so much more noticable than with my version of the mod? 
The spongie skin/character customizer has no nipples, so I made my own.
I'll post it to workshop shortly, probably called "Adult bits of spongie's customiser" or some such.
It's been delayed while I spend time trying to add genetalia - a very simple "it's a bit like a vagina" wasn't hard but I have decided that getting a penis that doesn't look like a weird tumor is impossible with the resolution and UV distortion in that area.
The way it works now is by simply removing matching item names from distribution lists (only done once at launch).
idk if ra is still active but you could look at theirs
B42 has new option to do that in sandbox settings but it doesn't work reliably and I wanted to implement my own method mostly to have more customization and ease of use. And to learn Zomboid modding / Lua.
I'll see how they did it, but I don't want to just copy someone else's penis.
(sentences I never expected to say)
lmao
I think it would be much easier to do an erect penis rising up, but I'm not trying to add sexytime bits here... it just threw off immersion whenever I was swapping outfits/wringing out wet clothes and I saw my character with a flat barbie-doll like chest.
tbh I just find it weird since I use the piercing mod
Ra actually adds a 3d penis model
PenisTurnAround.fbx

oh the chat is talking about naked mods
that makes slightly more sense
Mod Manager: Standalone: v1.0.8 https://steamcommunity.com/sharedfiles/filedetails/?id=3422448677
Pretty excited to get this working for my mod manager so I thought to share π
-
Automatic Mod Scanning:
The tool automatically scans your workshop (or mod) folder to check each mod for required files like mod.info and modinfo.json. It looks for error logs, missing files, and even custom error notes that you might add. -
Error Reporting & Suggestions:
If any mod has issuesβlike missing files or non-empty error logsβthe tool displays detailed error reports. It even provides fix suggestions to help you resolve common problems. -
Tag Management:
Each mod can be tagged with statuses such as in progress, bugged, broken, or fixed. You can update these tags through a simple GUI. This helps you keep track of which mods are working properly and which ones need attention. -
Custom Error Notes:
You can add or edit custom error notes for each mod. This is useful if you need to record additional information or troubleshooting steps that arenβt automatically detected.
-
Discord Webhook Notifications:
One of the coolest features is the integration with Discord. When you update a modβs tag to one of the monitored statuses (in progress, bugged, broken, or fixed), the tool sends an embedded message to your designated Discord channel. This means you and your team get real-time notifications about mod issues or fixes! -
Report Exporting:
Need a record of whatβs happening? You can export detailed error reports to a text file for further review or record-keeping. -
User-Friendly Interface:
The entire tool is built with a clean, intuitive GUI so that even if you're not a tech expert, you can easily manage and monitor your mods.
hello, where can I find resources about wringing clothes for b42?
lua\client\ISUI\ISInventoryPaneContextMenu.lua (Line #2357)
ISInventoryPaneContextMenu.onWringClothing = function(items, player)
local playerObj = getSpecificPlayer(player)
items = ISInventoryPane.getActualItems(items)
for _, item in ipairs(items) do repeat
if not instanceof(item, "Clothing") then break end
ISInventoryPaneContextMenu.transferIfNeeded(playerObj, item)
if playerObj:isEquipped(item) then
ISTimedActionQueue.add(ISUnequipAction:new(playerObj, item, 50))
end
ISTimedActionQueue.add(ISWringClothing:new(playerObj, item))
until true end
end
and
lua\shared\TimedActions\ISWringClothing.lua (Whole codes)
Especially this one
function ISWringClothing:complete()
if instanceof(self.item, "Clothing") then
if self.item:getBodyLocation() == "Shoes" then
self.item:setWetness(math.min(self.item:getWetness(), 60))
else
self.item:setWetness(math.min(self.item:getWetness(), 10))
end
end
syncItemFields(self.character, self.item)
return true
end
omg thank you π
is that what you asked? tbh i was confused π
this might be helpful, we are doing the camp in the rain mod, right now we managed to stay dry and decrease the wetness while near the tent, we forgot about wringing clothes lol, we really don't know where to start from , us poking around for now :D.
common sense mod needs to add the ability for bolt cutters to cut locks off doors (aka just unlocking the doors)
only certain doors this would work on mainly the armory doors and stuff that use actual locks
How to make a sound replacer? I know I can replace the bank file. Just wondering if there is a easier way.
This timedactions is killing us lol.. our tiny brain....it hurts...
I've played around with TimedActions a bit, if you want to check out some references to making custom ones or modifying vanilla ones feel free to check out my mod code
@plush wraith will definitely check it out.. thank you.. β€οΈ
Np feel free to ask questions if you have em
Adding reference to BoobTube (ID for Bandeau) made the AI extension stop working. Thanks "Responsible AI service" D:
are custom perks still added viva the perks.txt in the media folder?
yeah
anyone happen to know where blood sprays and splatters are controlled? im looking into making blood splatters travel less distance when a zombie is killed
You could make a mod to do that.
CombatManager.java:
if (!handWeapon.hasTag("NoMaintenanceXp") && !isoGameCharacter.isShoving() && !isoGameCharacter.isStomping()) {
float _float = 2.0F;
if (handWeapon.getConditionLowerChance() > 10) {
_float = _float * 10.0F / (float)handWeapon.getConditionLowerChance();
}
if (GameServer.bServer) {
GameServer.addXp((IsoPlayer)isoGameCharacter, PerkFactory.Perks.Maintenance, (float)((int)_float));
} else {
isoGameCharacter.getXp().AddXP(PerkFactory.Perks.Maintenance, _float);
}
}
that's from processMaintanenceCheck, that gets called from attackCollisionCheck which is a huge function so I'm not going to try tracing out the logic there.
dang, if you set a custom skill as passive = true, it still doesn't auto set it to level 5 when you generate a new character in B42
Uh, if I want to remove jewelry from zombies then I'd have to edit every zombie outfit and look for each GUID?
guids are only used for textures/models
They're the big string of hexidecimal that looks like 4aea6778-deef-488d-b47c-2576f499aabf
Do zombie outfites use those, or do they use lists of items? I assumed they woudl use itemnames
nope, they use the guids
pain
You can make a script which does it tbf
Tho the least intrusive way would be to intercept the zombie visuals
Can someone create a mod where HP doesnβt drop to zero but the character can still take injuries, etc.? Without making NPCs in SuperbSurvivor immortal as well. or exist such a mod already? Thanks for any answers
shit im crazy
Just disable the other features, and enjoy immortality when you end up swarmed by zombies unable to move while they eat you forever.
that's cool
It perfect for when you want a casual game, no stress about dying. Plus being cursed with immortality in a world devoid of other living humans seems very appropriate.
Hi does anyone know why that script doesn't work? I'm not really familiar with lua language but I don't see any mistakes in code nor I don't get any errors in game. I wanted to play a sound when reaching a specific level of skill but LevelPerk event doesn't seem to work...
Thank you very much, I try it out
change the funcetion definition to local function LevelPerk(character, perk, level, increased)
Even though you called it "level" the first parameter is the player object, which is never going to be == 1
You can also replace getPlayer() with character; no need to make anAPI call to get that info when you're being handed the player object.
are there certain gun mods that have infinite ammo? I mean like, the m4 rifle mod with infinite ammo, but other rifles still have finite ammo
None that I know of, but you could make one if you wanted.
You can probably attach code to OnWeaponSwing which I think triggers for firearms too, and then "if Item in primary hand is an M4 fill it full of bullets"
I made this mod, and if you look at the code you'll see all the function related to reloading I had to change to get my goal of endless ammo but still needing to reload when the gun is empty: https://steamcommunity.com/sharedfiles/filedetails/?id=3408420806
So that was the problem. I fixed it and now it works! Many thanks for help! 
Glad it was an easy fix!
Mark of Cain mod is great, thats what I looked for, but one more question I hope de Npcβs from the Superbsurvivor mod wont get that perk too?
Try it and see.
They probably won't get the benefit, because I expect that mod works by doing stuff to the player while survivors are just zombies in disguise.
Looking for this, i need mod that can make guns have infinite ammo but still needing to reload, but also i need this similar mod for specific gun only
Do you know how to make a specific gun that have infinite ammo but the rest of the other guns still have limited ammo?
With reloading? Take my mod (I give you permission to use the code) and you'll have to re-combine it with the vanilla code, selecting which bits to run based on the gun being held. Or re-do my changes to vanilla with conditionals. Not trivial, but not too hard if you know some lua and are willing to work through it steadily.
Without reloading? Like I said, try a function on the OnWeaponSwing event that refills bullets if the player is holding a gun of the correct type.
Ah thanks alright I'll get the mod first
No promises that I did things the best way (I definitely did not!) but you'll at least be able to see all the functions that control the process of getting more bullets into a gun instead of needing to track everything down.
https://steamcommunity.com/sharedfiles/filedetails/?id=2972388637
Honestly i want to use this gun mods and combine it with your mods, like i think it's cool that i have a futuristic-looking gun with an infinite ammo (it's still using 9mm in-game) but i have no idea for doing this cz i still have to learn more about modding
I'm going to ignore Britas/Gunslinger because they do a lot of crazy stuff to firearms, but in vanilla code there is an assumption that every gun has a number of bullets in it that decreases by one when fired. What you could do is mash some code in so the pistol uses a virtual item (i.e.: one that never gets used outside the pistol) as ammo, and when you hit reload you do something that fills that back up. Maybe you put a battery in and the bullet count gets set to some value based on battery charge. Maybe you can only charge it by hooking it up to a car battery charger for a few hours.
And when you remove it, you get a battery with charge based on the remaining bulletcount.
I don't think there is any way to change the look of the projectiles though, that's all hardcoded in the java stuff.
(I have no idea what Tracer's gun looks like in overwatch, all I know is there was a period of time a few years ago when Tracer cosplay was really popular.)
So i can use battery instead of bullets?
Unless you want one battery = one bullet you'd need to so some lua changes to make it work.
I wish there was a way to remove tags from items for recipe purposes that didn't involve overwriting the item file
cuz wdym a wrench is SmeltableIronSmall but a kitchen knife blade and fillet knife are double the amount of metal with SmeltableIronMedium ?
And why is a kettle SmeltableIronSmall ?
You really tryna tell me a kettle has the same amount of metal as a can opener?
I can see a simple sheet-metal kettle being small, they weigh less than a wrench
nah nvm, even more absurd. Kettle is equal to a spoon
but more than a can openers, unless it's a castiron can opener
Remember the game is set in an alternate history where zombies are real and chickens weigh three times as much as deer.
Encumbrance is more of a measurement on how hard something would be to carry, not inherently its weight (I think). But yeah deer should def still be more
What if the energy from a battery was converted into ammunition? is that possible? I mean, because the battery is "degradable"
Make a magazine recipe with an oncreate lua that reads how much charge the battery has and fills the magazine up with that many bullets
Absolutely possible.
And override "remove bullets from magazine" or it will be weird.
Thanks in advance, but i have to learn to make the lua script for that
I reallyΒ² have no idea for modding like this cz never down into modding
Everything I know about lua, I learned from modding this game
You'll pick it up quickly if you ask the right questions and talk to the right people
I wouldn't consider myself great with lua, but that's what the questions are for :P
For this, there are so many ways you could do it that have different approaches.
Alright mind you help me to make it?
So decide how you want it to work, start making that happen, and if you realize it would be a lot easier to do it a diferent way instead you can just do that... big advantage of making a mod vs. working professionaly is you're not obligated to stick to the original design.
We have been helping. π
A lot of the time the best help is someone giving you pointers for how/where to get started.
So the first thing should i make the specific magazine for the specific gun?
If it was me, I'd start by first making the gun work using some generic existing ammo
Like vanilla ammo?
That doesn't need any lua, just script files/models/textures
Yeah, make it use an M9 pistol magazine or somesuch to start with just to get framework down before changing stuff.
either make a unique model, or find a vanilla model you feel fits the look you want
This is an actual thing btw, those are considered the same amount of metal by the current crafting system
I figured that was the joke from context amd from swearing at the system when trying to work out what to level smithing with that used the least metal when melted down and reused.
Should it start with vanilla gun or with a mod gun for the start?
I'd start with the absolute minimum viable gun mod and make a new gun that is just a copy of an existing one. Then you work in several directions: replacing the model, changeing sound effects, changing gun stats, making new ammo, making the ammo work in a nonstandard way.
Probably more stuff I'm forgetting you will see as you go.
It gets worse
Alr I'll get start
Putting a sawblade on the bat shrinks it to SmeltableIronSmall
Don't look at weight/calorie changes when cooking.
Just... don't. That way lies madness.
The problem isn't the bolts, it's that you adsed nuts and bolts.
And the smelter is allergic to nuts.
Maybe use encumberance as a way to get the amount of metal produced? Will still be janky, but less janky.
I think a system like this needs a careful item by item setup
The generic small/medium/large setup is why I'm considering this in the first place, cuz it doesn't work
What if the smelter had an inventory you put items in, then clicked a button (like "start washing machine" or "turn on stove" in the UI) and it replaced the contents with metal chunks?
No more trying to find four matching small items or whatever
I mean the system Iβm proposing wouldnβt need multiple matching items anymore either
As the recipe would only check for a single item with the tag, and the outputs would be handled by the lua
Like, identically to how dismantling electronics is handled
The outputs are still affected by the type of item and the skills of the player, but itβs handled by lua
And that would be interesting, but idk how to make tiles or ui like that
what does OnTest do
what code can get the icon name
laying out some ground work for the idea, may go a different route than lua. Unsure currently
anyone knows if spawning items onto containers can be done via server? or just from client?
It tests conditions for recipes I think
VGC uses it for example to make sure that your house has a TV and electricity to allow u to play the consoles
getTexture()
can be done via server using onfillcontainer event
or if you know which container it is and that the square is active
ok thnx
im not really sure what event to use yet, basically i want containers to force spawn items based on schedule
doing server side lua does limit my ability to debug but the code would be shorter since i dont need to send result to all clients iguess
do you happen to know if i use setExplored and im near the container will it auto revert since the player is there? or?
(if setExplored is even responsible for making the contgainers not spaw items)
it will just go back to false
or true
(whatever the boolean is when someone is in there)
if you can figure out a way to set the boolean without someone being inside the bldg you're probably ok
items spawn as soon as the container loads
onfillcontainer is on the loot respawn timer, but as albion points out it only fires when the square is loaded
and only if loot respawns in that container too
on the server you can also add items to containers at any time and call sendItemsInContainer(object, container)
it doesn't work for corpses though
i plan to create an event that reads if a player just exits a building
hmm...
and irc moddata is synced when its saved to containers/tile objects right
you need to transmit the item
ok
yeah.. hmm.. ill try to set room def explored to false see if that will re trigger item spawn
Commands.object.clearContainerExplore = function(player, args)
local sq = getCell():getGridSquare(args.x, args.y, args.z)
if not sq then
return
end
if sq and args.index >= 0 and args.index < sq:getObjects():size() then
local o = sq:getObjects():get(args.index)
if o ~= nil then
if args.containerIndex == -1 then
local container = o:getContainer()
container:setExplored(false)
container:getSourceGrid():getRoom():getRoomDef():getProceduralSpawnedContainer():clear()
else
local container = o:getContainerByIndex(args.containerIndex)
container:setExplored(false)
container:getSourceGrid():getRoom():getRoomDef():getProceduralSpawnedContainer():clear()
end
end
end
end
found this
what does clear() do in this instance?
it clears the hashmap of the container from what I can see. I learn something new everyday
does the hashmap regenerate then once the room is explored?
here's a cool mod idea, mineble boulders
idk this is from vanilla
ClientCommands.lua
this is what im trying to figure out exactly , if i can just manipulate the explored properties will it be enough to make the containers spawn stuff? cuz ive been testing
but nope its not working.. there might be something else tied to the spawn or the explore is used for something else entirely
that idk, the java code is making my eyes cross
@fleet bridge check it out
LuaEventManager.AddEvent("OnExitRoom")
ForceSpawner = ForceSpawner or {}
function ForceSpawner.OnExitRoomTrigger()
local pl = getPlayer()
local csq = pl:getCurrentSquare()
if not csq then return end
local currentRoom = csq:getRoom()
local lastRoom = ForceSpawner.lastRoom
if lastRoom and lastRoom ~= currentRoom then
triggerEvent("OnExitRoom", pl, math.floor(csq:getX()), math.floor(csq:getY()), csq:getZ())
end
ForceSpawner.lastRoom = currentRoom
end
Events.OnPlayerMove.Add(ForceSpawner.OnExitRoomTrigger)
Events.OnExitRoom.Add(function(pl, x, y, z)
local sq = getCell():getOrCreateGridSquare(x, y, z);
if sq then
local flr = sq:getFloor()
if flr then
flr:setHighlightColor(1, 0, 0,1)
flr:setHighlighted(true, true)
print("OnExitRoom: ")
pl:addLineChatElement("OnExitRoom: ")
end
local room = sq:getRoom()
if room then
local def = room:getRoomDef()
if def then
def:setExplored(false)
local msg = "isExplored: ".. tostring(def:isExplored())
print(msg)
pl:addLineChatElement(msg)
end
end
end
end)
neat
i use OnFillContainer to spawn items and respawn zombies inside of rooms
im not quite sure how, but this might be interesting
i want to use lootzed version of spawning items
tho theres a sync problem with that
the spawn happens locally or remotely if the player is nearby and also got that container loaded
if they are offline or far they wont know that the container spawned lootzed item,, so my idea is to use lootzed only to be able to capture the items that are being spawned, despawn them again then spawn it again
weird right ?
but what the heck...
Trying to make it so almost everything is handled by tags I'm setting up myself. Very tedious, but will be far more tuned than the current smelting system. And will instantaneously become obsolete once vanilla smithing is expanded on.
Though the way it seems to be going, I'll probably still make an overhaul anyway as I don't see myself enjoying vanilla smithing once it's complete
nah this is good either way
support for smelting down jewelry would be neat. zombies as a metal source 
Oh it's gonna be more than just jewelry, it's gonna be smelting in general
That's just the oncreate for silver, currently doing iron
which is probably the largest category
for obvious reasons
The current idea for smithing is
Extract Metal - Smelt down Metal into workable material - Work the metal - Profit?
I'm just hoping it gets done before there's a smithing overhaul lol
at least then I have a baseline I can work off of when I want to overhaul whatever forging system they put in place. Mostly cuz I'm ready to be disappointed by it.
yeah that's the thing. I have a ton of ideas for 42 after putting some time into it, but a lot of it feels like stuff that will probably be hit by TIS in the short term
It's also just fun to do π€·ββοΈ
For reference, I'm probably gonna have fragments be a 2:1 ratio for metal chunks
possibly even more tbh, as with that value then you could theoretically make an iron mask out of 2 forks
but I think that issue stems from how cheap some of the forging recipes are
It's funny because 2 forks would actually be more expensive than current vanilla, which is equal to 1 fork
1 fork = 1 iron chunk = 1 small steel sheet = 1 metal mask
It's kinda silly
1 fork = 1 steel sheet is wild
But I think that issue stems from the mask using a small sheet instead of large sheet
but yeah 1 IRON chunk turning into 1 small STEEL plate is strange
even then, a fork is not going to get you that much metal.
feels like something that would benefit from smaller units overall
I'm thinking fragments either be 3:1 or 4:1
even extreme enough, maybe even 6:1
4 forks for a chunk of iron sounds more reasonable
I'm honestly a fan of higher numbers for the granularity, but it means you have to balance pretty precisely all the way down
1 chunk = 1 small sheet doesn't make sense still
I feel like at minimum you should have to treat the iron to make it steel first
yeah but the fork should start out as steel if that's the case
idk if I've ever seen a pure iron fork
Does smelting down steel degrade it and reduce the alloy? Making it more into iron each time? idk
The game's implementation of iron vs steel sucks really bad and is hard to work around for stuff like this
apparently you can burn the carbon off of steel
but that might be industrial complex-level stuff
I mean a lot of games do play pretty loosely with iron vs steel
yeah but this game plays it really really loosly despite having both, it hurts my brain sometimes
There are iron bars, and iron rods.
Then there are steel bars, and steel rods.
They act identically, other than maybe using them directly as melee weapons
crafting wise, they are treated identically
the low level wood carving has a handful of cases like that too
I'm just gonna treat everything that doesn't explicitly state that it's steel, as iron
just for my own sake
that also will give more emphasis on processing iron into steel for better material crafting
so it works gameplay wise π
speaking of smelting
don't even mention the fact that I plan on adding in bronze fragments and try to determine what items use bronze that don't explicitly state it
im adding a mini-furnace to my mod
oh?
yeah, replaces the forge
any particular reason?
also now that I'm thinking about it, I feel like I should add the option to use cooler burning materials like wood for low heat metals like tin
I'm gonna be adding alloying to a degree for steel, brass, and bronze
imagine making steel from your backyard like a chinese peasent in 1960
fr? thats awesome
if u wanna collab im up for it
i can help u
looks kinda weird but wont look ig haha
its AI generated, pretty awesome
it was more HD
but i decimated the shit out of it to make it work for PZ's low poly count
heres an HD model
pretty useful for modding
will actually help u alot unlike GPT and other LLMs lol
Which AI are you using to generate models?
its pretty rad
it understands the image most of the time
and generates an HD model
sometimes the angle is awkward so it generates pretty shitty stuff
but you'll need to do some afterwork in blender
mostly decimation and UV mapping
you can texture it too on that website
but the texture will feel like the model had a small seizure
One day IO'll get around to learning how to texture in blender - becasue all my experince if with models for 3D printing I've skipped over texturing.
But gotten good at making things actual 3D solid items, given how many broken models I've fixed.
I mean, vikings made crude steel on accident so it's not actually that difficult
I meant steel
I typed iron
they crushed chicken bones into their metal, the carbon from the bones made rudimentery steel. They thought it was chicken spirits
thats interesting
but to be fair, thats the difference between the common man making metal and between a veteran blacksmith.
alloying is gonna be magazine/level locked
chinese peasents picked shitty low-quality iron and made types of steel that couldn't be used in heavy industries, so china ended up with a huge amount of useless low-quality steel
plus backyard smelting def will have more defects than factory produced
in a factory you could essentially make a roll of steel or steel bars, while in a zomboid smithery you'd be lucky to make a high-quality steel plate (as an average guy)
would be cool to have a research system
where you collect various books related to alloying to combine them and make a "Steel-making process" set
that the player can then read
could be 2-3 books per alloy.
can be easily done through recipes
finally a use for all the animal bones I have because it's so much quicker to turn a skeleton into bones instead of picking it up and moving it somewhere to rot
Well unless i wanna add condition to alloys and make it apply the condition to crafted items, thatβs not gonna happen
This is already a tedious mod concept lol
yeah im not asking u to do that haha
I'm really hoping they add some sort of low quality input -> low quality output modifiers in crafting
Idk if i wanna add bone smelting lol
Maybe tho
They kinda do already, handles and heads for assembly recipes
Using two rocks to bang metal into shape shouldn't be as good as an anvil and collection of smithing hammers
I want an official version so I don't have to update a fiddly mod every time they adjust something while working on crafting
Yeah, tryna get as much of this mod made as i can before the next patch lmao
Having everything work and then adjusting to changes as theyβre made would be ideal compared to shifting gears in the middle of work
They also need to rethink the skill levels needed... they are based on how useful things are in-game, but a sledgehammer isn't exactly a piece of precision crafting.
How does the reverse engineer recipe work anyway? Do you have to add it or is it automatic?
Making a machete from a metal plate is as easy as "cut out machete shape, sharpen edge, wrap something around the handle end.
Looks like a property on items.
I mean sure, but i think we take for granted just how much better our skills are purely because we have the internet
eg: gasmask has ResearchableRecipes = MakeCraftedGasMaskFilter;RechargeFilters;MakeImprovisedGasMask,
I'm rather confident that machete's pre-date the internet. π
Obviously, but the ability to know how to do things is what i mean
Such a significantly higher amount of information access
For forging a long swrod where getting the metal composition/crystal structure/etc is important to have something that doesn't break, sure... but if you can make a small knife you can scale that up to a large knife by doing the exact same thing.
And you also have to consider the process, how do you get from the point of cold metal bar to sharp blade? What tools are needed? How hot does it need to get? How often should you be working the metal before heating it again?
You could make it the shape of a machete and sharpen it, doesnβt mean itβs gonna make a good machete
Realistically you're never going to run out of industrial crafted metal pieces to use for raw material, so instead of needing to know raw iron -> blade you are reshaping existing steel
Just like hobby blacksmiths love railroad spikes.
Also how do you sharpen things? What is the motion? At what point should you stop sharpening it to prevent breakage? How thin can the metal stay sharp while hitting things and become blunt instead of cracking or chipping?
These are all things we can easily look up, or may just already know due to day to day experience on the internet
I was thinking the same thing. there's a portion of the population that wouldn't even know what to sharpen a machete with, and then another portion that has no idea how to use something like a whetstone even if they know what it is
Your character can take any edged weapon to maximum sharpness after 30 seconds with a whetstone made from two rocks.
there's a ton of minor steps involved in these things that are effortless to know right now, and impossible to know in an apocalypse
The modern internet is genuinely such a large information source that itβs difficult to comprehend just how much of a difference it makes
Sure, but zomboid has no concept of "if I know this thing I should be able to also make this very similar thing"
Like sure somebody taught you that thing, but where did they learn it? Was it another person? Was it a book? How did they meet that person? How did they get that book?
You can't even try using duct tape to attach magazines to your arms without a recipe or finding some existing magazine armor.
Wasnβt that changed to be a level requirement?
I hope so.
And I hope it's a very low level.
(what skill do you even use for "apply duct tape" recipes?)
Things like that should just be inherently know
Probably tailoring
For armour at least
You would be surprised how much people dont think about paper as a durable and semi flexible material when packed together because individual papers are so weak
time to make the phone book a blunt weapon
And to be fair to the source material, ideas like "lets wear sports gear for protection" are only allowed to be used once per TV series and then never spoken of again.
the walking dead let them use it for at least like 3
also boats and islands are not allowed
I just imagine that most survivors are using boats/armor/disguising themselves with blood/etc and having a much easier time of it elsewhere, but the TV series follows the interesting people who refuse to do that.
twd is just a show about the idiots lol
Reality TV the other survivors watch and laugh at
y'all know of anything that uses this mod? it's got like 200k subs so there has to be something
found my old highway signs mod and now I'm tempted to pick it back up, but it's pretty reliant on LoadGridsquare
Isnt that literally the whisperers on the walking dead
No idea who they are
they wore taxidermy zombie masks and blended in. it was iffy imo
I stopped watching when it became "lets sit in our prison base being stupid"
The walking dead spoilers:
||They disguise themselves as zombies and whisper to the zombies to influence their horde behavior||
I used it for the mining nodes mod I made
"this better work" who makes that sort of comment on a mod?
I'm gonna comment that on every single mod you've made
There is a nice easy to use "delete comment" button that I have never used before, but today I can confirm it works.
@thick hound This may interest you re: guns with nonstandard ammo: https://steamcommunity.com/sharedfiles/filedetails/?id=3429953336&searchtext=

thinking about making a playlist mod soon for truemusic. anybody with relevant experience have advice
it was negan that ruined it for me tbh
i hated his fucking ass and just stopped watching the show when he did what he did
He was the guy just randomly torturing/maiming/killing characters?
you know if you watched
yep, the one with the baseball bat with barbed wire on it
and leather jacket
i think bob kirkman just kinda sucks 
That;s teh extent of my Negan knowldge... pretty sure I would have also quit at that point if I'd kept watching too.
he killed some great characters man
If you're going to give all the characters plot armor don't randomly take it away for needless shock value
I think part of why you hate negan is because he lost some of his comic characterization as well
its like the creators said "what should we do to make this season eventful? the fans have been saying the show is getting boring", "let's fucking kill 1/6 or smthin of our current characters!"
"fuck yeah"
the only kirkman property i care about at this point is rick grimes 2000
let's just see how dumb it can get
||They made Zombie Jesus and then killed him?||
In a complete anarchy anyone can call themselves "king"
Then I can call myself Emperor. shrugs
i call dibs on project zomboid
I assume whoever this was actually had a power base to back up being a "king"
I shall be known as King John Zomboid, First of His Name,
Master of Mauldraugh, Ruler of Rosewood, Emperor of Ekron, Prince of Pony Roam'O

I wish I had been wrong
wait omfg I'm so fucking stupid holy shit
wait no I didn't do it like that because of steel items, nvm
I assume you're classifying steel as iron for purposes of smelting?
Or are you keeping them seperate?
Items that have steel in the name are separate
everything else is assumed iron fragments
If I was including steel, I wouldn't need 134 entries like this
Not the other way? I'd assume most metal things in teh game are steel, not iron.
Balancing purposes mostly
Other than cast iron cookwear, where do you even get get iron objects these days?
This is going to extend beyond just smelting, so having them separate will make sense
smithing in general
...and also does having steel do anything having iron doesn't, because in vanilla they seem 100% interchangable for crafting.
Well that's why I said it's gonna go beyond that. I plan on making improvised weaponry and armour account more for the material it's made of
It's going to be a long process
makes sense, especially for anyone bootstrapping on a wilderness playthrough.
If you dig up raw ironstone you're in the iron age, not steel age
MEanwhile I've been taking cars apart and have more steel than I will ever need.
Iron is gonna be the baseline material, so having it be the most common material you come across makes sense.
yeah, adding bronze age stuff would be silly
I mean it will certainly be an option, but will mostly serve as a trophy type thing
like how you can make gold and silver masks in vanilla, but why would you do that
we already have stone/bone/wood era tech.
Idk if they're fully implemented crafting wise, but they're there
Because you have being able to see but don't like wearing a gas mask?
also, why are they three recipes instead of one recipe using the new item mapper thing?
Probably written before item mapper was a thing and not updated.
Hello guys someone here know where i can find the craft code of Refill a BlowTorch in the game ?
The thing I'm the least looking forward to is implementing retextured armour/weapons
Media/Scripts/Recipes/something related to metalworking
thx
I haven't managed to get a retexture to work using vanilla models, and have had to import the models into blender, resize them, then export them back
try RefillBlowTorch in scripts\recipes\recipes_metalWelding.txt
(I use powershell to look for strings in all the lua & txt files to help find stuff like this)
Are the textures embedded in the .fbx files?
scripts\recipes\recipes_metalWelding.txt craftRecipe RefillBlowTorch { timedAction = Welding, Time = 50, OnCreate = Recipe.OnCreate.RefillBlowTorch, Tags = InHandCraft;Welding, category = Metalworking, inputs { item 1 [Base.BlowTorch] mode:destroy flags[NotFull;ItemCount], /*item 1 [Base.RubberHose] mode:keep,*/ item 1 [Base.PropaneTank] flags[NotEmpty], /*item 1 tags[OxygenTank] flags[NotEmpty],*/ } outputs { item 1 Base.BlowTorch, } }
lua\server\recipecode.lua
-- Fill entirely the blowtorch with the remaining propane
function Recipe.OnCreate.RefillBlowTorch(craftRecipeData, character)
local items = craftRecipeData:getAllConsumedItems();
local result = craftRecipeData:getAllCreatedItems():get(0);
local previousBT = nil;
local propaneTank = nil;
-- local oxygenTank = nil;
for i=0, items:size()-1 do
if items:get(i):getType() == "BlowTorch" then
previousBT = items:get(i);
elseif items:get(i):getType() == "PropaneTank" then
propaneTank = items:get(i);
-- elseif items:get(i):hasTag("OxygenTank") then
-- oxygenTank = items:get(i);
end
end
result:setUsedDelta(previousBT:getCurrentUsesFloat() + result:getUseDelta() * 30);
while result:getCurrentUsesFloat() < 1 and propaneTank:getCurrentUsesFloat() > 0 do
-- while result:getCurrentUsesFloat() < 1 and propaneTank:getCurrentUsesFloat() > 0 and oxygenTank:getCurrentUsesFloat() > 0 do
result:setUsedDelta(result:getCurrentUsesFloat() + result:getUseDelta() * 10);
propaneTank:Use();
-- if oxygenTank then oxygenTank:Use(); end
end
if result:getCurrentUsesFloat() > 1 then
result:setUsedDelta(1);
end
end```
thx
you need both the script and lua, idk if it calls for any other parts in recipecode.lua
Would be nice if everything using "item.blowtorch" was replaced with "tag:blowtorch" so I could make a bigger, heavier blowtorch.
Mainly so it could hold more fuel without feeling like cheating lots of fuel into a tiny handtorch.
no I don't think so, I just couldn't get it to render in game idk why
This isn't everything btw, this is just everything that had one of the existing smeltableiron tags
I still have to go through and group them into sizes to tag them with lua for crafting purposes
No I couldn't have used the existing smeltable iron tags. You ask why? Aluminum foil would be included in that list if I did.
same with steel
I could have for the smeltableironlarge tag, but that's only 6 less items on that list
Yeah that's right. 136 items on that list, only 6 are considered large amounts of iron
in vanilla at least
Aluminum foil pisses me off because when you turn it into a hat it becomes a tinfoil hat
I have two choices, change the display name of the tinfoil hat, or have a random person comment on my mod "why does the TIN foil hat smelt into aluminum?"
"America" is a perfectly acceptable response
I might unironically make a mod that literally just changes the display name of the hat to aluminum foil hat
or just foil hat
probably foil hat
Hate to get side tracked, but I'm gonna do that right now.
that's the level of nitpicking that I respect
that's the level of nitpicking that gets you put in those qol immersive mod collections with like 10k mods that conflict with each other
it's not a good collection unless I have to restart the server every 8.5 minutes for updates
fuk u, this is kentucky
americans sometimes call it tin foil too
I noticed the "large" category was rather lacking.
yeah it's dumb, that's part of what inspired me to make this mod
they can suck my gun stock
so you're saying there's a lack of Big Iron?
Americans love calling it "tinfoil" even though actual tin foil is immesly rare and probably never used by regular people

If you update itrems programattically or by adding a new translation entry you shouldn't have issues conflisting, it's when you copy the entire script things break.
Or two mods makes conflicting changes... I've got two mods fighting over jackets right now, so they look completely different when you open/roll up sleaves and swap from the "better looking vanilla version" to "Pongies' version with options.
Okay to make this not completely a meme mod, should I also make it so you can turn the foil hat back into aluminum foil?
cuz you can't in vanilla
I'm thinking of making an edit of TOC just for me and a server I'm in (just so you can use rifles and shotguns slowly instead of dropping them, because irl you can operate most long guns with one hand)
Does anybody know about the code of TOC that can help?
what is toc
The Only Cure
ah
I've seen videos of people doing training drills to reload rifles one-handed, it's very possible
And you can definitely fire them one-handed
I could've sworn I used a shotgun as an amputee last time I played with TOC
I think there's a mod that allows you to use a vanilla sawn off double barrel
But that's it
Maybe it was brutal handiwork or advanced trajectory that was indirectly making me able to operate it one handed
I guess I could try it
I know something was letting me use a shotgun one handed
I think I found the block of code that makes you drop stuff when it's two-handed
I could just delete it but that'd also make you able to use two-handed melees
Which isn't what I want, just guns
check brutal handiwork, it makes it so you can fight with your left arm if you lose your right arm
might be related
Yeah, I know about that
Must have for TOC tbh
My character got a laceration on his left upper arm because my computer bugged out and there was nothing I could do by the time a zombie was on me
If that doesn't let you, then check advanced trajectory. Which I don't know why you wouldn't be using that in b41
And it infected him
tragic
It went to like
0.0005 fps
For like 20 seconds
Zombie lacerated my arm and when last I saw it, it was like 40 feet away and barely visible
I can't make a prosthetic
I know reload speed can be managed in LUA, because it does things like checking for bullet bandoliers
I'd use debug mode to fix that.
Multiplayer
ah, well if you can get the server admins to install a mod you make for single-handed gun use you can get an extra bit of code to regrow your arm. π
Lmao
I'm just gonna roll with the punches and make it possible to use the gun one-handed
I don't know shit about lua, that's the main reason I need help
if your screen freezes but you can still do actions and hear sounds, pause the game, then tab out and back in
The most complex mod I've made was a sensory overload trait that makes the character gain stress and panic from loud noises
I couldn't do anything
could you hear sounds
Nope
Yea, I'm just explaining why I asked for help
No probs, we can help - at least point you in teh right direction wehere possible.
I deleted the block of code that takes 2 handed weapons into account, gonna see what happens
I cut it so I can paste it back if it causes a catastrophic error
What would need to be changed...
- TOC not letting you hold two handed guns
- reload speed (big penalty?)
- aiming penalty
is that all or am I missing some obvious things?
Yeah
Reload speed would probably be half or 40%
Because the videos I've seen of people reloading rifles one handed isn't too slow
I'm pretty sure TOC increases the time to complete any timed action anyway
so should still be covered
I may try adding custom animations for stuff like racking a shotgun some day, but for now I'm just gonna let the character use the gun using normal animations
If not, check out ISReloadWeaponAction.setReloadSpeed()
I still say you should see if advanced trajectory does what I was experiencing
It's a must have for 41 imo anyway
ah I think that's an entirely different mod, not entirely sure
Almost forgot to change the vanilla recipe name too
It's funny cuz this is actually an indirect buff to aerosol bombs
Since it adds another method of obtaining aluminum for the recipe
Once you confirm that does what you want, think about what code you could insert before or after the function to do what you want and we can help you make a lua patch for the function instead of replacing it.
Hopefully it's a nice standalone-ish function and not embedded in the middle of something huge
It's connected to the function that forces you to drop something in the amputated hand
It's called "take two handed weapons into account" or something akin to that
It might be as simple as a prefix that says "if weapon is two handed gun then return" that skips the rest of the function.
https://steamcommunity.com/sharedfiles/filedetails/?id=3430130418
DESCRIPTION
Thought control rays, psychotronic scanning
Don't mind that, I'm protected cause I made this hat
From aluminum foil (Foil)
Wear a hat that's foil lined
Renames the "Tin" Foil hat to Aluminum Foil Hat, and also adds a recipe to roll the foil hats back into usable aluminum.```
Can't get it to appear in my modlist
It's a build 42 mod but if you care enough I will backport it to 41
For reference, aluminum not tin wouldn't show up for you either since you're playing build 41 so I thought it was about that
Switching from workshop to mods fixed it
who needs to when you can stuff everything into a freezer
for my long trip with stale foods? idk how other country does but for me, I use foil for my lunch when it's summer. we eat rice, and rice will be easily stale when it's too hot.
al you min yum
It already works perfectly, besides needing reload speeds slowed
The gun is upside down for some reason
With the block of code from TOC removed?
Yeah
Are you going to get the server and all players to install your custom version of The Only Cure, and keep it updated whenever TOC updates?
Hi! I was wondering how could I make my mod generate a random number that is the same for all players in a server with this code:
randomDailySprintTime = ZombRand(23);
lastDay = day;
soundPlayed = false;
end```
Well. this is certainly... a little bit overwhelming 
Probably, yeah
I could just send it to the server's discord or something
I don't know if the host is down to use it, if not it's still good for personal use
How exactly would I go about sending it to them to apply to the server?
That's why I suggest doing it as a prefix patch if you can - that way you make your own mod that adjusts the TOC code
I'm pretty sure mods on servers are tied to steam, but I don't do multiplayer
This is a locally hosted mod so I don't know what to do. π€£
All I know is that my friend and I get different numbers.
Maybe I could publish it as an unlisted mod on steam and send the link?
Two ways: you either generate a number in one place and push it to everyone OR you use a hash function on values that will be the same for everyone like servername..dayselapsed
(assuming there is a "servername" value somewhere)
A hash function will always generate the same value, and will look random... asusming you're not worried about players looking at the lua code and knowing the random numbers in advance.
you can use seeded random to ensure the same value is calculated for everyone
I think something is wrong with your mod.info
could you show the mod's mod.info?
Does Zomboid has a seeded RNG function? I can make one from scratch if this is not the case. π€
Thank you for all the help. π
local rand = newrandom()
rand:seed(theSeed)
randomDailySprintTime = rand:random(0, 22)
cache the rand object if you can, it's wasteful to create it each time you use it
Perhaps there's some characters I'm not allowed to use? This is what I got ```
name=Drink From Troughs
id=DrinkFromTroughs
modVersion=1.0.0
description=Troughs will now act as a water source refilled by rain and giving tons of water to use.
poster=poster.png
versionMin=42
not sure exactly what would be the problem with it tbh
You're a godsend, thank you so much!
I just realized I badly named it but that's not what's important right now 
try versionMin=42.0.0
yeah an invalid versionMin bricks the entire mod manager lol
Huh, I guess I read the wiki a little to faste then I thought that was fine. Let's try!
seems to be a common issue, no worries
it doesn't seem like they have examples for it on there, and it's natural for 42 to work in other places that expect a version
i think wiki does not say anything yet about versionMin
author=VerySaltyOreos
id=AluminumNotTin
description=Renames the "Tin" Foil hat to Aluminum
version=1.0
poster=preview.png
icon=icon.png
versionMin=42.0.0```
This is what my most recent mod uses
yeah a full x.x.x is needed
Awesome, yeah I reloaded lua and now it's showing the mod. Progress!
oh yeah I'm anticipating some pain, but I'm a web dev, I know hurdles π

I'll continue working on the smelting mod tomorrow. Eepy
How do I reduce the fire rate of rifles and shotguns? Just wondering
(also the reload is the same speed, gonna have to fix that)
Also gonna add pain to the arm from holding up a heavy gun with one hand, idk how to do that though
Once I've made changes to the mod files, if the game is running, can I reload the mod code from the running game or do I have to quit to main menu to reload?
Press F11 (or F10) to open debugger, search for your lua file, and click reload
bear in mind that this very often won't actually work how you want it to
for the most part it just runs the new version of the file, it doesn't undo anything that already happened and if you're relying on events for initialisation or something they won't refire
yeah there's a new file too so I'll restart this time and see what happens
Just realized the block of code I deleted might not have even done what I thought it did, this says TODO lmao
Gonna have to test
AimingTime and HitChance are probably what you want to change, rather than the rate of fire; teh weapon will shoot just as quickly, but be harder to aim and less accurate
Keeping in mind B42 does a weird thing now where hitchance become something about modifiying damage unless you untick a sandbox option under character, the theory being the player is responsibel for aiming and the character stats determine the damage or something? I don't really get it. Also I hate it.
Theyβre in build 41
Oh then you're on the old system, so guns are technically melee. π
Fantastic. Why on earth
The owner of the server said I should reduce fire rate too for balancing
Why are guns melee? My guess: because that was how they got workig guns done for minimal effort and always planned to redo them later
Also, with the advanced trajectory thing I don't even need that edit
Besides for balancing changes like reload speed
advanced trajectory will completely invalidate any advice I have on adjust gun starts - it does it's whole own thing.
Ah
Just means you need to look at the advanced tragectory code and see how it deos stuff
Is there an event for the client that fires when you 'exit' the game, not seeing anything in the wiki
This maybe?
Thank you I knew there must be something I was overlooking
-- Any of these may be nil, so we can't take advantage of "..." syntax :-(
pain.
(from ISContextMenu, referring to the use of param1, param2, param3, param4, ... args)
I just wish I could travel to the past to inform whoever wrote this of unpack and save us all from this pervasive anti-pattern but this is the reality we live in now
I didn't know that nil would break it? Of course, I guess I never tried
The problem the comment is referring to is saving ... for later use; if you pack it into a table as-is ({...}) then unpack later, you lose everything after & including the first nil
yea, I see now. Brain is a little slow right now
This can be avoided by saving the result of select('#', ...) & later using it with unpack but that presumably was not known when that code was written
just passing it around, couldn't they just save it like args = {...} and then pass args
If they pass it as a table then whoever accesses it wouldn't know the original argument length (in the nil case, that is)
Because #args in that case would only count up to before the first nil
pairs would work for getting the values after the first nil, but typically these are used for passing arguments to a callback so that would be very cumbersome for the intended purpose & wouldn't have guaranteed ordering
No stupid questions around here
The onclick callback for a button, for example
function ISButton:setOnClick(func, arg1, arg2, arg3, arg4)
self.onclick = func
self.onClickArgs = { arg1, arg2, arg3, arg3 }
end
Hmm
arg4 feeling a little left out there
that's good to know. thanks!
Same typo exists in two other places, another thing that would be avoidable with the select/unpack thing π
copy/paste ftw
Some stupid questions around here
I would like to thank everyone who help us figure stuff up while making our simple mod π you guys are awesome. β€οΈ
Helping out with zomboid questions is a lot more fun than atually doing the work I'm supposed to be doing.
we are actually surprised it went well , not know anything to making a mod. lol. what a experience lol.
Fast forwarding the game will make your wetness increase, while near the tent. so.. (we don't know how to fix it.. yet.... since we never modded before.)```
--> you can multiply
```lua
local gameSpeed = getGameSpeed() == 1 and 1 or getGameSpeed() == 2 and 5 or getGameSpeed() == 3 and 20 or getGameSpeed() == 4 and 40
bodyDamage:setFoodSicknessLevel(currentLevel - adjustedForce * gameSpeed)
the gameSpeed is fixed value so you can copy and paste mine
hahaha... we never actually figure that out until someone with us press fast forward LOL.. and we just.. stare at it lol
#mod_development message
btw it's me too i didn't know that until last month lol
we gonna try this, π
Does anyone know of a way to get a list of what fluids are in a FluidContainer, I cant seem to find a way in the API shown here
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/entity/components/fluids/FluidContainer.html
declaration: package: zombie.entity.components.fluids, class: FluidContainer
HOLY MOLY!! we actually made it work.. thank you.. that fixes the fast forward issue. π
Looks like the way to do this would be to get a FluidSample with createFluidSample & check the fluids on that (via getFluid)
Yikes, thats what i was afraid of
Im trying to add a custom progress bar to a tooltip, but running into the issue that the bar itself is empty, seems like others have ran into this but not finding a solution
Hi guys, im only staring on making mods. Where can i get all tiles for 42 build?
Are you talking about for making map mods?
If so I think they are part of the Project Zomboid Modding Tools you can install through steam, but hopefully someone who has actually amde map mods can give a proper answer.
I found here in project zomboid modding tools tiles. But i can't find new log door frame, new log fence
Maybe i need to update it to 42 build?
Not sure. This is teh brush manager from inside B42:
I haven't really figured out how to use this program yet.π
That's i see in tiles but game using "walls log" file in scripts
But i can't find here walls_logs
If they are from b42 I remember seeing a github link to an unofficial b42 modding tools, as far as I know the ones on steam haven't been updated
But to be sure, maybe ask in #mapping
I couldn't get custom progress bars working but I did make smokable items have a tracked remaining amount on them now so you can smoke part of a cigarette/cigar/etc and save the rest. Saved into the item modData so it persists on reload 
Hi there? I new! I'm trying to finish a mod that I started a few days ago. The idea of the mod is to make the animation speed change when a certain temperature is reached. In the default case, it will be 0 Β°C. The truth is that I already have the animations modified and even the lunge changed by a script and converted into slow_walk, but the issue is when I want this to be activated by a specified temperature. Could you help me create a functional LUA script for what I'm doing?
What do you exactly want to know?
- How to check temperature
- How to run animation via lua
or both?
anybody can tell me how to make new tiles? like make a new floor or wall or furniture.
Hi! Thanks for getting back to me. I'm trying to create a mod for Build 42 that changes zombie walk animations based on temperature. I've already modified some animation XML files in 42.0/media/AnimSets/zombie/walktoward/ (specifically, I have zombieWalkSlow1.xml, zombieWalkSlow2.xml, and zombieWalkSlow3.xml which are slower versions of the default walk). These changes work, but they're always active. I want the slower animations to only activate when the zombie's temperature is 0Β°C or below
-
Getting the individual zombie's temperature: I need a way to get the temperature of each specific zombie, taking into account whether it's inside or outside (and any other factors that affect a zombie's temperature). I'm not looking for just the ambient temperature. In Build 41, I believe the function was
getClimateManager():getAirTemperatureForCharacter(zombie), but I'm not sure if this is still correct or if there's a better approach in Build 42. -
Switching animations based on temperature: Once I have the zombie's temperature, I need the Lua code to do the following:
- If the temperature is <= 0Β°C: Randomly select one of my custom slow walk animations (
zombieWalkSlow1,zombieWalkSlow2, orzombieWalkSlow3) and apply it to the zombie. I believe the function to apply an animation iszombie:getAnimationPlayer():setAnimSetName("animationName"), but I want to confirm this is still the correct function in Build 42. - If the temperature is > 0Β°C: Apply the default "zombieWalk" animation to the zombie.
- If the temperature is <= 0Β°C: Randomly select one of my custom slow walk animations (
-
Continuous updates: I would like the code to do it constantly, or at least, very often, so the zombies react to the temperature changes.
I've tried using Events.OnGameTick.Add(), but I'm not getting the expected results. The temperature check doesn't seem to be working, and the zombies are always slow.
Could someone provide me with the correct Lua code snippets for Build 42 to achieve this? Specifically:
- The exact function(s) to get the individual zombie's temperature.
- The exact code to apply the animations (slow and normal) based on the temperature check.
- Confirmation that
Events.OnGameTick.Add()is the correct way to do this, or if there's a better event to use.
Thanks in advance for any help!
you could do it on the EveryHours event and then grab all the zombies from the current cell maybe
Let's see, I'll try it! It makes sense because it would be much more efficient.
i cant remember the command to get the zombies but ive seen another mod do it so i need to check
You would do me a big favor if you could help me figure this out! TY
I tried but they still appear slow, I don't know how to make it play one animation above 0Β°C and another below.
found it
local cell = getCell()
local zombieList = cell:getZombieList()
local zombieListSize = zombieList:size()
for i = 0, zombieListSize - 1 do
local zombie = zombieList:get(i)
--do stuff here
end
i have no idea if the animation thing will work or if its possible but this should get all the loaded zombies
Thank you very much! I will try it and let you know how it went.
Is there a better way of making a food item have a certain number of uses like UseDelta than something like
`item food5
{
ReplaceOnUse = Base.food4
}
item food4
{
ReplaceOnUse = Base.food3
...` etc.
Is that so the player can eat it with more precision than eat all/eat 1/2/eat 1/4?
Yes
I want it to have 5 identical uses