#mod_development
1 messages · Page 373 of 1
Either way the army wins while people with low skill get put in a waitlist for the next drone to come online.
(or literally just yaknow, buy the army another drone)
The best firearms reference books: https://www.headstamppublishing.com
After World War One, the Italian military spent some time studying the effectiveness of reduced-power cartridges, including both pistol calibers semiautomatic carbines and submachine guns as well as intermediate-caliber rifles. One of the rifles developed for the subsequent ...
lol "I have this magazine, and this gun, they don't fit but.."
I think the prototype magazine was lost to time
so he's using a magazine from a different gun that uses the same mechanics
to demonstrate
ah.
As far as prototypes go, I kinda like it
does it properly cycle if one section jams? (or easy enough to forward to the next section?)
I don't think the tab would raise fully if it jams, meaning it wouldn't cycle to the next section until it's unjammed
as the tab fully raises and has a lil arm that latches onto a mechanism to cycle to the next magwell
ah k, that kinda sucks
would be nifty if it actually resolved a jam automatically by skipping to the next section
wouldn't the casing just, still be in the way from it jamming
or a failure to feed, a rack also shifting sections
then you'd also see a mag with some rounds left in it and be like "Yep need to replace this mag (or its springs in the ones with a round left over)
I dunno I make cooking mods that stab the people who cook.
lol
I've been working on this one mod for over a year now, and it's only recently become actually functional
wanna give me some feedback on mine? lol
I'll do the same for yours if you want.
I've change the foundation to it repeatedly, and have become much more complex than I initially anticipated
uhhh your cooking mod ?
Neat so it turns the context menus into a gui ?
that and rewrites how happyness/boredom/ingredient count/etc works
along with requires a knife, has chance of injury at low skill and (future plan) food poisoning if your filthy when you cook
but id need to rewrite food poisoning to.. yaknow, not kill you.
I do think it's funny that eating some burnt hamburger is equivalent to drinking bleach
it also lets you add multiple of the same ingredient with no penality (just a loss of bonus effectiveness) by just.. adjusting the hunger added
Pretty sure iv slightly burnt my hamburger for the past 20 years just ot make it taste better...
RIP im ded
negative happiness because I added too much cheese.. Unrealistic, it's impossible to add too much cheese
Yea. I made it so adding 10lbs of cheese only gives you the happyness of like, 3lbs worth of cheese.
I think that's just called a sear
much more realistic.
a little bit of <X> adds a large improvement but more adds less, so you have a reason to collect other stuff -_-
Unfortunately the introduction of this new mag type means I have added in 2 more guns that are technically the same guns as the other 4
but if all you have is 100 <insert farm vegi> then well... just go for it.
It doesn't have to be like this, I'm just too lazy to set it up
also will show you that no matter how many radishes you use, your still not getting a single damn calorie.
It would probably only need to actually be like, 1-2 guns if I set up the lua
Pretty much, ModData is awesome.
This is how I find out Radishes have no caloric value ??????????
Yes, you can eat all the radishes you want, for free! its like eating wood
spicy wood
That sounds fake
Like I know now that it's true
but it just
what
what do you mean there's a vegetable that just, does nothing
huh
Look up the calories of like... everything you can grow in zomboid
how does that even work
only like 20% of them have any calories whatsoever.
but like
"Why do I keep losing weight!??!" - guy who keeps eating stuff with 0 calories.
there are a lot of foods that barely have any calories
so go look up how many calories a potato, cabbage, tomato, etc has...
yep
you can eat them until you are full to bursting and still starve to death
ps 2000 cals in PZ is you just standing around all day.. its more if you walk/jog/do stuff
lemme just go eat 28 pounds of radish real quick for my daily serving of calories
which you very likely are, since you are having to run around and whack things a lot in this game
thats why I added the slider that lets you add up to 100 hunger in one button press
whats the easiest way to play an animation on a player character?
I guess that depends on what it’s related to
Does the wiki have a list of all procedural distribution spawn locations?
If you mean distributions, yes:
https://pzwiki.net/wiki/Procedural_distributions
perfect
Hello all, quick OnFillWorldObjectContextMenu question: When trying to capture a North or West facing door, as pictured, via OnFillWorldObjectContextMenu is there an already established method? My initial thought is to just check an adjacent square as a fallback, but wanted to see if anyone had come up with anything more clever/elegant.
not sure what mod that would be.. if referring to the time thing. I got 3-4 weather related stuff.. but I dont remember that being the issue.
General note that the reports, requests, and suggestions thread has found a new home here:
https://canary.discord.com/channels/136501320340209664/1476602902607954043

Modding reports, requests and suggestions
Good job TIS getting PZ to hit 244FPS on my POS rig.
A++ work, I love a good optimization.
Don't think this is quite what you meant, but
lol.
https://cdn.discordapp.com/attachments/1470838623225122983/1476708931438117028/2026-02-26_16-31-59.mp4?ex=69a21bdd&is=69a0ca5d&hm=7409f38b2b5e4241cec66dee2b95120e5bbd6c0f540da8e8cc62263565c7de1a&
Different video after changing the code so you rack it when ejecting the mag
hey! just finished my first mod, how i public it in the workshop?
thanks!! i uploaded it! is there a chat here were i can share it?
Showcase channel generally. or if anyone asks about it you can post it in that channel
So whats it about anyway? 😛
ha ha... just don't zoom out!
The difference between zoomed out and zoomed in is so funny, you can watch your system go from a beast to a potato in a literal second
Hi people, I have a really cool idea on applying vehicle vinyl wraps to vehicles. I have a few questions, please dm me if youre free. 🙂 TY!
i took the fnaf 2 map mod that someone made and made the animatronics actually go and kill the player
Nice!
175 in the middle of nowhere zoomed out
Just ask your question here, don't expect people to DM you just to find out what you actually want help with
Can you look at fetch.door to check for a door object?
In theory that will get populated with the door for the tile you clicked on and is used by vanilla to populate the door related context menu options... but you might need to click on the tile the door is on when you approeach from the north or west.
But I feel it's fine for your mod to have the same quirks as vanilla does when it comes to click position -> door detection.
yeah, I went with the adjacent query workaround, for the short term at least, where is fetch.door defined, did a quick look through the docs and projects and didn't see it
and thanks for the reply 😄
where is fetch.door defined,
Defined? that's a very strong word for this, but... ISWorldObjectContextMenuLogic.java is now the place for most of the world context menu logic.
tyty
It was easier to understand when it was a giant lua mess, now it's a giant java mess.
That's where it gets set, but it's a bit of a nightmare because fetch is a recursive function with different behaviors based on arguments instead of being broken into getFetchVarsForSquare() that iterates through getFetchVarsForWorldObjects() and getFetchVarsForInventoryObjectsInWorld()
Also ISWorldObjectContextMenu.createMenu (LUA) loops through world object so It's even more confusing to make sense of teh logic flow.
...yet somehow this is much more fun to work on than the #$%^@#^@ MSSQL stored proc I'm supposed to be debugging.
lol yeah, really makes me wish I could just attach a debugger
15 years ago someone who only knew SQL was asked to write a simple "check if this URL responds to a request" logger and instead of a 5 line script it's a collection of huge stored procs and a custom DLL that only works with one specific version of dotNet, because SQL is not the correct language for this task!
that sounds awful, I don't envy you lol
hello - I am interested in developing a mod that places a custom generator item but doesn't place it in the lootable distribution, instead I would like to hand place a few object instances in interesting spots on the map. Is this easily possible without requiring me to edit the map itself? I am thinking you might need to use a LUA script although I have never modded PZ before.
Yes. Making an item and not adding it to loot tables is super easy... you just skip the step of adding it to loot tables.
For spawning an item at specific locations there is no elegant way, but the best way I have found is used by Excalibar
Basically it has a table of locations and what to put there, every in-game hour (or maybe every 10 minutes) it checks if any of those locations are loaded, and if so 1) spawns the thing and 2) removes the entry from the table
Hey, can threads be allowed in that channel so we can discuss about specific requests and suggetions of people directly there ?
We might wanna do that somehow before making the request? so they don't need to read through it all and can just read the summerized request after discussion.
(Cause im sure we're going to bikeshed about stuff that will be faster to implement then it was to discuss how we'd like it implemented)
@dull moss Iv got some mods that bypass the limits properly for MP btw 😉 but Java mod.
See Total Capacity Override at https://steamcommunity.com/sharedfiles/filedetails/?id=3587204390
Eh not really
People won't bother discussing before about it, or they already did
It's best that other modders come and criticize a report, request or suggestion and the author adjusts it
Sure, that could be a method (You start a thread to discuss a report if needed and OP can modify his message/repost it once its been discussed)
Yes but java mods are pain
Absolutely, id rather the limits be removed, but until then... :0
Yep
but also just proves your point of 'yea modders don't like limits' lol
I saw one guy who rewrote every bit of inventory transfer code to break the limits in a MP compatible way -_-
but then he didn't bother using reflection to actually.. bypass getCapacity limiting things -_-
So it only breaks the limit for stuff that registers with his mod
Is there another step required to make sounds generate noise to attract zombies? I've been testing and increasing the distance values, tried swapping the vanilla event for a local .ogg file, and still not drawing any attention?
{
is3D = true,
category = Player,
clip
{
event = Character/Survival/Carpentry/BuildMetalStructure/SmallPoleFence,
distanceMin = 2000,
distanceMax = 2500,
volume = 0.8,
}
}```
this is played via the player's emitter, if that matters
Yes, sounds don't attract zombies
there is a specific event I forget the name of that does
maybe look into the shout code
thanks - is Excalibar a modder or is this some type of framework/library?
Excalibar is a mod.
You need to collect the pieces of Excalibar, which are a mix of random zombie drops and specifically placed items
The is relevent code:
P4Excalibar.spawnList = {
{ id="rc", item="P4Excalibar.P4RustedCrowbar", locx=8639, locy=15045, locz=0, x=0.20, y=0.20, z=-0.18, r=0, force=true },
{ id="sb", item="P4Excalibar.P4ExcalibarBook", locx=12342, locy=2132, locz=5, x=0.52, y=0.50, z=0.30, r=160, force=true },
{ id="sb1", item="P4Excalibar.P4ExcalibarBook", locx=7706, locy=11880, locz=0, x=0.54, y=0.49, z=0.35, r=0, force=false },
{ id="sb1-z1", item="Zombie", locx=7702, locy=11879, locz=0, outfit="Doctor", femaleChance=50, force=false },
{ id="sb1-z2", item="Zombie", locx=7703, locy=11880, locz=0, outfit="Doctor", femaleChance=50, force=false },
{ id="sb1-z3", item="Zombie", locx=7705, locy=11880, locz=0, outfit="Doctor", femaleChance=50, force=false },
[...]
Events.EveryTenMinutes.Add(P4Excalibar.CheckSpawn)
P4Excalibar.CheckSpawn = function()
local spawnReserves = P4Excalibar.getSpawnReserves()
for k,v in pairs(spawnReserves) do
local square = getSquare(v.locx, v.locy, v.locz)
if square then
if v.item == "Zombie" then
local crawler = true
local isFallOnFront = (ZombRand(2) == 0)
local isFakeDead = (ZombRand(2) == 0)
local knockedDown = true
spawnZombie = addZombiesInOutfit(v.locx, v.locy, v.locz, 1, v.outfit, v.femaleChance, crawler, isFallOnFront, isFakeDead, knockedDown, false, false, 2):get(0)
if not isFakeDead then
spawnZombie:setHealth(0)
spawnZombie:DoZombieStats()
end
else
local spawnItem = square:AddWorldInventoryItem(v.item, v.x, v.y, v.z)
spawnItem:setWorldZRotation(v.r)
spawnItem:getWorldItem():setIgnoreRemoveSandbox(true)
spawnItem:getWorldItem():transmitCompleteItemToServer()
end
spawnReserves[k] = nil
end
end
end
From media\lua\client\P4Excalibar.lua
If you want to spawn a world sprite (like a placed generator) the commands to generate would be different, but that gives you a basic structure to work with to spawn things from a list when the player gets near.
The maybe-not-obvious part is square = getSquare(v.locx, v.locy, v.locz) will get nil if the location is not in the loaded area around the player
Thank you 🙂
what is the difference between weapon:getClipSize and weapon:getMaxAmmo ?
this please
WorldSoundManager.instance.addSoundRepeating( likely other functions too
lol thanks, literally just woke up and was back on the trail
worked like a charm, much appreciated
(also addSound if its a one off)
Do note theres like, 10 different overrides that all call the 14 parameter addSound -_-
Is there any actual difference between them functionally? Do they not both just return the gun’s max ammo?
Or can max ammo be larger than clip size ?
i don't know for sure, but i imagine if the gun can hold an extra bullet in the chamber that would affect max ammo but not clip size
Hmm
and do it with LoadGridSquare? That the code only works if the square being loaded is one of those in the coordinate list. Or wouldn't it be as efficient?
because LoadGridsquare is called literally hundreds of times in a single frame, even callbacks that return quickly can impose a significant overhead
as somebody who fights to redeem ontick's reputation, loadgridsquare is actually worth avoiding whenever you can
someone even made a framework (I forget the name) for doing stuff on chunk load without spamming LoadGridSquare so badly
load grid square is pretty much an abomination of programming TBH -_-
at the very least it should be loadChunk
unfortunately i've heard of issues with the chunk not being fully loaded when that event is triggered
that'd reduce the call frequency by 64 (or more?) and its not like you load less then a chunk at a time
....
i think it's something like only the bottom layer is actually loaded or something like that
i haven't personally run into it since when porting my mods to b42 i happened to find smarter (and very specific to my needs) ways to target specific squares loading rather than just upgrading to a less intensive event but i think sim has had issues with it
Should give a Z for the chunk loaded then I guess -_-;
I honestly kinda hate interfacing with the world in PZ
can't really put my finger on it, but it leaves a sour taste in my mouth whenever I have to interact with world objects/cells/grid squares
pff ok, I liked LoadGridSquare best. So is OnTick better where there is an "if then" and if it is not met the code does nothing?
Maybe its just the constant use of XYZ positions instead of having a dedicated int position class...
please don't ontick spawn code when every minute (executes every 2~5 seconds depending on worldtime scale, IIRC) would work just as well
PS if its inside a building you could also consider OnSeeNewRoom perhaps.
OnSeeNewRoom: Triggered when a room becomes visible for the first time.
yes, that's what I do. I do TickRate
Would be nice if we could do that natively TBH, it seems to come up enough that having some kinda java map of LUA callbacks for when location <X> gets loaded wouldn't be the worst idea
so that it doesn't activate on every tick
would be nice yeah
literally what set me on my quest for learning lua - i hated not having a color type for UIs
You mean how we have a color type but like nothing uses it except for all the things that do use it and immediately require translation back to RGBA?
like it could be so nice but because its only used in some places it just adds 3 levels of extra pain
yeah, and then the other day i found a constant? for named colors that i feel needs a wrap
lol the named colors -_-
i mean it seems available - just needs to be context aware
pretty sure fluids can only be named colors? -_-;
i think a good lua wrapper could do most of the lifting
also fluid mixing is still wrong
50% black + 50% white = 50% brightness, but that doesn't properly respect gamma colorspace, it should be near 25% brightness.
so what about an API like Color.Water.<NamedColor>() and it returns the shape it should be in for the context?
also some super weird code that only applys when mixing fluids with the dye tags...
and then being able to add new colors that have the same benifit
or even Color.Water(<NamedColor>) that looks for a defined color then tries to fall back to the defaults
is there a way to add a tag onto an instanced item through lua?
I don't mean adding it to the item type/entry, but the individual item
You can try getTags():add or something
public Set<ItemTag> getTags()
Nevermind
public Set<ItemTag> getTags() {
return this.scriptItem.getTags();
}
items don't have their own tags, Use modData
not mutable?
Doesn't matter if it was, you'd be changing the script item
public boolean hasTag(ItemTag... tags) {
return this.scriptItem.hasTag(tags);
}
all the code runs directly on the scriptItem
Ah was my idea too, I guess not then
inventoryItem's don't have tags.. period
Rip
Use modData and <some other hack to do whatever you wanted to use tags for, like onTest if it was a recipe thing)
(Check how respirators add/remove filters work for an example of that)
Note: Respirator_nofilter variants are not used.
I should be able to get away with just using weapon attachments for my purposes
Just gonna, rewrite all of butchering... to be configurable.. and based on animal weight.
is it not based on animal weight ?
Would be weird for fish butchering to be based on it, but not livestock
haha no its based entirely on lifestage, animal size (something the butcher hook incorrectly sets to 0.6) and meat ratio
.. and then a sheett ton of RNG
oh and genom stuff that is totally obscured by the RNG
Only if you assume buthering different animals is consistent.
could have modifiers for animal types while still being based off weight
Quick update on the ProjectLife RP framework I've been working on for the past 6 months — about a month out from playtesting.
The core architecture runs a Rust backend that's completely decoupled from PZ's game tick. Economy, jobs, police, NPCs, inventory — none of it runs inside PZ's loop. So when the game hitches at 10fps under load, my RP systems are still running at full speed. Every player action gets a request-correlated response back in a single pass — ACK or ERROR, no silent failures.
The performance difference vs running a full RP stack inside PZ's game thread is night and day. PZ's server tick is 10fps. My backend processes commands in microseconds and returns state before the next frame renders. Database-backed atomic transactions mean no desync, no rollbacks.
tl;dr PZ handles rendering and input, everything else runs on my own stack
If anyone is interested in being a play-tester, leave a checkmark above and i will message you on discord when playtesting starts
Place item on ground, single player: all done with LUA.
Place item on ground, multi player: all done with LUA.
Drop item on ground, single player: all done with LUA.
Drop item on ground, multi player: halfway through the client side the code swap to duplicated functions in Java because &#$^! YOU.
You are doing the Lord's work
Thanks
Basically exactly what I did, since while im sure some people are totally up for "I wanna butcher one cow for my 6 month run" others are gonna be like "Well, I want cows to last like... 2 weeks, but id still like to get 1 day of food outta a rabbit"
the game even nicely increments animal weight every day based on health
Very cool concept! Sounds like it was a good idea compared to trying to shoehorn all that into LUA
Lua is amazing, but running on a single game thread with so many systems….. disaster. My goal is to achieve what no pixel did for fiveM, and eventually provide it to everyone as a framework to run their own servers
Yea, nothing in PZ actually runs in the background once its unloaded, its all updated.. poorly, upon area load
Like im pretty sure if your away and your generator runs out (Im not even sure it can) your fridge will either act like its been without power the entire time or no time at all
I think rain barrels might update with proper amounts of rainfall when you come back but not 100% sure
rain barrels are meta entities
Also not sure if animals can breed while your away.. last game I had in B42.12 I never once had a single pregnancy or fertile egg with my farm just outside of load area of my base
(maybe had sterile males dunno)
Gonna have to add genetic defect viewing to animal info too -_-;
im thinking level 4, you can see active defects and level 8 you can see if they carry the gene for defects
(apparently you need 2x defect genes for it to be active or something?)
ELI5 since I know very little about how the world map entities work
I could have sworn I saw something in the climate manager about tracking rainfall though
(maybe that was for plants?)
meta entities are simulated even when they aren't loaded
chunks be chunking
Neat, is there a shortlist of those?
chunk authority too was a headache while i was figuring out npcs
@paper ibex theres a player craft history?
yup, it's used for the sorting function in the craft UI. Client-side only, but saved to the server. -> https://steamcommunity.com/workshop/filedetails/discussion/3651576948/690873299732886822/
Another feature I didn't even know existed
how about entity ui with xuiskin api ?
Iv briefly glanced over the Xuiskin thingy
Wondered if I could make my own crafting stations...
with blackjack.
Fun fact: I once wrote a game with an incredibly complex chemistry system.... I could maybe bring it to PZ in some of the most cursed ways...
Imagine a system where you 'cooked' fluid mixes to make something new.
not sure what your goal is, but the Entity UI is good. The API is still a WIP, though. I managed to get it to work by creating multiple UI components and coding them with initialise() and instantiate()
The hardest part is understanding XUISkin?, ISTableLayout, row registration, and calculateLayout(). ||not sure what they are yet, might be related to XML-based User Interface||
calculateLayout() gets called on resize and can be used to limit the window size....
and by that, I mean part of bugzapper 9000 was about 8 hooks to calculate layout (I was considering just hooking the baseclass at one point) to keep crafting windows from exceeding screensize -_-
A while ago I got as far as asking butchers on Reddit how much meat someone with no idea what they were doing could get from a dead cow. If you want some more input on what is "realistic" then check out the replies: https://www.reddit.com/r/Butchery/comments/1jart6s/roughly_how_much_usable_meat_could_someone_with/
Yea thats why I made it all sandbox options
over 10 components kill the fps (my bad code) so i disabled the resize haha, less stress on the layout design and improvement
The best (and also easiest for the modder) way to balance things!
everyone is gonna argue anything half way is either too little or too much.
So, you start with defaults half way, and go "Have fun!" with sandbox options
Yeah, a slider from, 0% to 100% for yield and who cares if the extreme numbers make no sense... people can play however they want, I'm not limiting that sort of thing to some realistic range.
Yea really just likely your bad code. I had realistic cooking drop FPS from 244 to 20 with 100 ingredients near by
fixed one stupid 2d loop that was.. just dumb, and FPS jumped right back to 244 with even 400 ingredients near by
text entry numbers in this case but yea.
we have sandbox options for milk yield, animal age speed, plant yield, plant speed, etc etc etc
but absolutely none for animal butchery yield?!?
Because the yield code is so ****ed up they couldn't figure out how to make a sandbox option work.
the code is so meh that you couldn't even tell half the time what was causing stuff because yield was like +50% -50% based on RNG
I remember thinking "it's not worth re-writing this because animals were just added and this must be a placeholder" but that was a year ago
and also bugged where butcher hook reduced yield to 20% intended due to bug that applyed 3 times over and devs have refused to fix it stating "it will be rewritten for B43"
The fish code is great - half is in kilograms, half is in pounds.
2026: "this system will be rewritten for B43 so we're not fixing the bug you provided us a fix for"
They did fix the "No Gay Porn In Kentucky" bug I submitted a fix for.
But they ignored "No White Strippers"
Apparently thats more important than getting more than 1 days worth of meat from a 1500lb cow in a survival game.
It was a trivial fix... but rewriting the yield code to be "animal weight * sandbox number * (butchery skill/10)" would also be really quick
they don't use animal weight at all
[42.9.0][rev:29171] White strippers are a myth, no-one hires strippers wearing pink and there are not enough strippers. Version: [42.9.0] Mode: [Singleplayer] Server settings: [N/A] Mods: [None] Save: [New Save] Reproduction steps: While working on adding cute little bows to stockings I found two...
every animal has, <X> items that it will spawn, between <min number> and <maxnumber> at each life stage (calf, cow)
animal size, is applied to the number that will spawn.
They did mention it was sent off for a fix, but last time I checked it has not been adjusted
animal size, is applied to the size of each item that will spawn.
animal size, is used to adjust the chance of 'prime' cut vs 'poor' or average cut, resulting in a 1x 2 or 4x calorie bonus
but... animal weight is so obvious and simple as a base for meat yield! I feel angry at you right now and you're just the messenger here!
animal size, is used to adjust how many of each item will spawn.
yes, animal size is used 3 times over.
animal size, is hard set to 0.6 for any animal that goes on a butcher hook
hahahaa
resulting in your yield dropping to like 0.2x if you had a 0.9 animal size (typical) and even lower if it was higher (can be up to 1.2)
this is why rabbits give 2x as much as cows in calories.
im so goddamn angry at this system im rewriting it from scratch basically
Not that TIS will ever use it or hire me or whatever but I just can't play a game with such a shit system where a rabbit gives you more calories than a cow.
btw: meatratio? 100% hidden from player
size? 100% hidden from player.
Still broken. And StripperWhite still does not exist.
animal weight? You get to know that on the animal info page at animal care level 4
the one factor not used in meat yield in vanilla.
not used for.. anything.
I wonder which part of the zomboid code is most rage inducing.
Butchery yield is definitely a contender because of how simple it should be and how complicated and broken it is.
did you know they have a whole genom system with like 20 genes and inhairtence and defects and stuff?
I saw that!
of course you didn't because its completely hidden under RNG and not exposed to the UI at any animal care level.
-_-
Will be great for the game where I last for 20 years breeding better quality cows
lol.
just think, after 20 years of breeding them, you might get a cow that produces as much calories as a rabbit!!
I think there's a debug option to show genetics, but... who's going to care?
(* Not really because they added in hardcoded meat ratio limits if it produces enough milk to feed its calves)
someone actually made a genom mod where you get to view their genoms lol
Heresy, everyone knows rabbits are so full of meat they can explode a car that runs into them.
(without the debug mode edit genom options)
they fixed that, maybe.
TIS also refusing to add this fix to the game: https://steamcommunity.com/sharedfiles/filedetails/?id=3399431185
-_-
TIS still unable to make milk expire
bullet physics
It's a one-line lua mod and it's more popular than most of my many-days-of-effort mods.
Seems like something I could figure out in 2 days of hooking UI interaction code..
what it only took me a few hours to figure out how to make cars stop sinking into the world.
(over 1400kg)
Physics for bullets, or Bullet Physics the API that controls physics? Because both suck.
The game will crash to desktop if you put more than 9 pellets into a shotgun round because of a buffer overflow.
runtime editing of bullet physics lemme rephrase that
Yes I do redefine the physics of the world at runtime..
do you.. not use realistic car physics?
I do! It's a big help, and better than Better Car Physics
il show pics soon im almost done but, i got drifting and custom rims in. i said fuck fighting it
and no i do not
i have to do everything myself unfortunately thats my flavor of autism
i didnt even use zombiebuddy i made my own java agent
...
I tried out Vein a few days ago, one thing that impressed me was how much easier cars were to drive. They're not even good to drive, I'm pretty sure they are just unreal marketplace assets with generic unreal drive a vehicle code... but they handled better and First-person means you can see more than 15 metres away.
yea we need more zoom or something in PZ.. also the 'pan while driving' mode is painful
Does pan while aiming still make all your shots miss?
I turned it offer a while ago, haven't retested
macbook flex
?
https://steamcommunity.com/sharedfiles/filedetails/?id=3405048727&searchtext=zoom I use this, it's not perfect because if you expand the zoom levels too much it too big a jump between them but it's still good for more zoom out when driving.
😎
@paper ibex there's an history craft ?
fully adjustable ride height, track width, camber, angle-kit (driftmode) and attach/detach bodykit. mechanic job is gonna be 🔥 nothing done in scripts so its fully instanced
yes , player craft history use for sort in Craft UI
Didn't knew it sorted by craft history too
How many recipes does it keep in memory ?
And how ?
No limit, which causes player save bloat (over 64KB) after playing for about 2-3 weeks on a heavily modded server.
TIS patched the player save limit to 128KB in 42.14, but I'm worried it only doubles the time before bloat happens again.
What do they store ?
The server saves and syncs the entire crafting history array, even though it's only used for sorting the Crafting UI. This contributes to save bloat over time.
iirc the crafting history is stored in a HashMap<String, Integer>, mapping the recipe name to the crafted count
So that's a string and an integer
And its this heavy ? Surprising
I mean 64 KB is not a lot anyway
Can we really talk about bloat ?
It's not just the crafting history; favorite recipes are also saved to the player modData. This issue actually existed back in B41, but it's becoming more noticeable now.
B41: https://steamcommunity.com/sharedfiles/filedetails/?id=3384313958
B42: https://steamcommunity.com/workshop/filedetails/discussion/3651576948/690873299732886822/
from the source code of B42.13.2
The PlayerCraftHistory uses a HashMap<String, CraftHistoryEntry>
Each CraftHistoryEntry stores:
// public void addCraftHistoryCraftedEvent(String craftType)
entry.craftCount++;
entry.lastCraftTime = this.player.getHoursSurvived();
I'm not 100% sure about the exact cause, but I've already dealt with bloated characters caused by the accumulating craft history. I managed to fix it by applying a Java patch to completely void the craft history saving on the server side. Since then, the save bloat issue hasn't come back.
Does anyone know how to add a water supply system like in the dwap?
anyone got a clue why the hitbox is freaking out like a little girl that just got her lollipop stolen?
The extents isn't taking the whole height here compared to the car ?
with the offset i set there shouldnt be any collision with a zombie under the truck?
have to redo all the trucks cause the double axle has the physical wheel in the middle, so they like to tip now pretty fast to the side ~.~ and i just now realised how stoppingMovementForce is rly working xD
I have no idea, I'm not familiar at all with how vehicles work
at like 15seconds, you think thats cause by the corpse size?
https://streamable.com/ictr33
I mean, at 15 seconds your wheels drive over a corpse yea
So not too surprising
Maybe your truck isn't heavy enough too ?
I believe weight can have an impact, or they take into consideration in the physic of the vehicles
cant make it any heavier since the suspension will fail due to overload
i can increase stoppingMovementForce that helps too, but then i need to increase horsepower too
@knotty stone Could be related: https://theindiestone.com/forums/index.php?/topic/91663-42140-character-spins-erratically-whenever-they-are-abovebelow-a-vehicle-on-any-floor/#findComment-459871
Version: [42.14.0] (has existed since MP released) Mode: [Multiplayer Only] Server settings: [Hosted and Dedicated] Mods: [None] Save: [New Save] Reproduction steps: 1. Start the game as a hosted or dedicated mp server. 2. Find or drive a car under a roofed area (or build above it). 3. Walk EXACT...
Can you not increase the suspensions ?
only till a certain point then the box will grind the wheels no matter what
also a great addition to the wtf list https://streamable.com/un1b87
Is there any way to change the parameters of a unique item as defined in scripts, dynamically in real time with a lua function? I have found this(https://theindiestone.com/forums/index.php?/topic/23525-lua-dynamically-creating-special-and-unique-items-advanced-tutorial/), which I assume runs while the game is launching/loading items, not with constantly monitoring. Could it be possible to do something like adjusting a script parameter in real time, just for the item the function is interacting with, based on a real time value? Like dynamically adjusting the encumbrance of an item(defined in a script) to the current actual real time durability (calculated with each swing)? Would all butter knives, for example, everywhere suddenly get lighter, or is it possible to just make the one in my hands lighter?
So I was working on some code for our server mod, and it turned out pretty cool. Since I haven't written a tutorial in a while, I thought I'd share. The problem: I wanted to create special upgraded items, and unique(ish) ones, without having to define the objects in the media/scripts/*.txt files,...
you can use the setters on the item to change most properties, listed here https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/inventory/InventoryItem.html
do note that some properties of the item are linked directly to the script and can't be changed per-instance, but this affects less of them than you would probably expect
"oh no, our game bloats the save constantly and 64kbyte is infact, not enough for everybody! thanks a lot bill gates"
"WE'll up it to 128kbyte, nobody could ever fill that up!"
TIS seriously not clear on the concept of 'limits are dumb' and 'computers have more then 64kbyte of memory to spare when it comes ot things that will end a 4 month long run that took the player hundreds of hours of playtime'
Like I know ram is expensive but im pretty sure 128kbyte is still only like 50 cents...
Also, in a game where the saves average a few 100megabytes... I feel like we could have just left player save data limit uncapped if it was going to be a 'delete the players hard work' kinda issue if he runs out..
i could need some more player memory, its completly laggin my game with that bug xD getting 4700 blowtorches with give ingredients and its using all of em 😂
cant delete them right click crashes the game 🤪
Yea last I checked, didn't we invent growable arrays sometime... 40 years ago?
hi i’m working on some custom tiles right now I’m making signs but I’ve run into an issue whenever I walk up to them they pop to the foreground and end up covering the character
You prob need to give them a depth map texture
modpack is released 🎉 https://steamcommunity.com/sharedfiles/filedetails/?id=3675696752 🎉
@primal schooner Pretty sure that code is fine.
if self.character and (not self.character:hasTrait(CharacterTrait.DESENSITIZED)) and self.item:getContainer() and self.item:getContainer():getType() and
( self.item:getContainer():getType() == "inventoryfemale" or self.item:getContainer() == "inventorymale" ) then
Oh, nm your right
one is getcontainer():gettype() and the other is getcontainer()
i was trying to catch another bug and stumbled on this
so what does it affect? lol
@willow tulip Got any clue where they're hiding most of the vehicle radial menu textures? Looked in "media/ui/vehicles" but I only see the window breaking refueling related icons. Considering they're pathed to that folder (e.x. media/ui/vehicles/vehicle_exit.png), I can't think of anywhere else they could be.
95% of textures in the game are in .pack files
I'm assuming you don't know the name of the pack file, but I'm asking anyways in hopes
Im pretty sure almost all the files are in one pack file
I'm in ProjectZomboid\media\texturepacks and there's quite a few with very generic names
oh man the file sizes do tell me how many there are lol shoulda looked
UI2 has what I need, thanks
any ideas why setting an item's name on the server won't trigger translations in multiplayer?
I'm trying to dynamically set names like so
item:setName(getItemNameFromFullType(translationKey))```
it works in single player, but in multiplayer it just sets to the key. printing the key shows the actual translated line, so I'm not sure why its not displaying
I have 5 generic items and 180+ translations. trying to save myself from creating an actual item for each translation
I just remembered the Wiki has these icons already 
If the patch increases the byte buffer limit, it might have side effects on other calls that need the byte buffer (I haven't had time to look at the 42.14 source code yet)
when you rip clothing on zombies you are supposed to get stress and unhappiness, so with this oversight you only get it from ripping clothing on inventoryfemale
Damn, thats sexist.
... so no stress if you remove it from the zombie first?
ISCraftAction:update()
-- players that aren't desensitized gain mild stress and unhappiness from stripping items from corpses
apparently lol
Hi, so New to moding and I figured I would try and look into making padlocks work on any container. Cuse It annoyed the heck out of me that by moving a player built container you can no longer padlock it. I started looking around and honestly understand almost nothing I'm looking at. But I spotted something in the Javadocs that says "canBeLockByPadLock" and am now wondering is the decision on if something is lockable on each Item and not part of the locks code?
I was hoping it was part of the locks code and I could just change it to think all containers where lockable not just player crafted.
Hey team, what's a good way to define a new BodyLocation, and which clothing layers the item fits over/under?
does OnServerCommand only work in multiplayer? shouldn't it still excute in sp?
Events.OnServerCommand.Add(function(module, command, args)
if module ~= MOD then return end
print("test print")
end)
does nothing
check the pdfs released with B42.13, especially the registry stuff.
- make a media/registries.lua file with something like:
NEPBODYLOC_CLBFYS_REAR = ItemBodyLocation.register("nep:stockingbow_rear")
2)somewhere under media/lua/shared:
local group = BodyLocations.getGroup("Human")
group:getOrCreateLocation(NEPBODYLOC_CLBFYS_REAR)
That adds it to the very end of the body location list, if order matters use BodyLocationGroups:moveLocationToIndex()
Thanks brother
Might be a property that is set when a world object is built that is not preserved when it it picked up/placed down. Maybe have a look at ISPadLockAction.lua, but the logic for context menus has been shoved into java.
You probably need to write your own context menu thingy that runs after the vanilla one, and if it's something you want padlockable and the padlock option is not in the menu already add it.
@bright fog dude, i just posted my mod, is there a place for me to announce it here?
i am about to post it on reddit too
I don't see any issues posting a newly released mod here, it's not like there a problem with teh volume of such posts and you should be proud of what you've built!
how is player teleporting done in multiplayer? I tried doing setx setlx on server it does nothing, it works normally from client, does it mean im only teleporting on the client and my character will be desynced for others?
Does it make more varied/tougher zombies as the game progresses?
I'd look up how teh debug mode teleport works. Assuming that works in Multiplayer, it woudl show you what is needed.
i looked at one of the interior rvmods to see and it seems to be that they're doing 100% clientsided teleporting
is there no anti cheat in this game
There is half-assed anti-cheat
are you developing for build 41 or 42
latest 42
.14 or w/e it is
ig it isn't a big deal if every server has admin
since it's all self hosted
so w/e
i dont think anti cheat mattters that much in this case
from DebugContextMenu.lua
DebugContextMenu.onTeleportValid = function(button, x, y, z)
if isClient() then
SendCommandToServer("/teleportto " .. x .. "," .. y .. "," .. z);
else
getPlayer():teleportTo(tonumber(x), tonumber(y), tonumber(z))
end
end
wasn't aware of teleportto
So in multiplayer it sends the /teleportto command to the server, which presumably handles that.
im guessing it's just setlx and setx
it's a java thing.
and more or less exactly what you predicted. (that code is from IsoGameChaarcter, not the server command handler)
In b42, no
Wouldnt you happen to have a guide on how to do modding with java?
I have only been able to make mods using lua so far
I guess the possibilities using java would be even bigger
Short version: dont.
Longer version: it's a pain, and it will require you to constantly update your mod... sometimes with every hotfix, depending on exactly what you changed. And users need to manually install the java files. And you will be inundated with "not working!" comments from people who do this wrong.
Theres no support for mods made with java on the workshop?
Your mod will also conflict with any other mod changing the same java classes, though there are not many java mods so that isn't a big problem.
server side code should validate/move the player then client side code can change it, check out my mode for details https://steamcommunity.com/sharedfiles/filedetails/?id=3641268718
If by "support" you mean "subscribe to mod on workshop then manually copy files from the steam mod download fodler into the game's zombie directory" then yes.
Typically you need some lua stuff as well as the java, for things like settings if nothing else.
I don't know of any mod actually using Leaf of ZombieBuddy, but you can look into those if you want to try java modding
IMO ZombieBuddy's so OP, it's basically a hack.
All right it looks like it really gives you more liberty than lua
I dont know nothing about Java, im specialized on javascript but I could easily learn if java modding really gives you more options when modding
And based on the wiki you could basically remake anything you want
Because it allows you to rewritte vanilla java classes
I have a feeling that Java guys hate JavaScript guys (me)
We dont hate nobody here. Only the people that does pure javascript. Typescript > Javascript
https://steamcommunity.com/sharedfiles/filedetails/?id=3676018580
Adds in an improvised Pipe Rifle.
You can craft this rifle through collecting/manufacturing the individual attachments for it.
The rifle's appearance and stats are determined entirely by what it's made of, offering a wide variety of form and function for a single gun.
[Pipe Rifle]
4 Barrel Variants
3 Front Stocks (8 tape colors)
3 Back Stocks (8 tape colors)
3 Grips (8 tape colors)
3 Mag Feeds (2 Mag types with different functions and capactities)
2 Receivers (Bolt-Action and Semi-Auto)
1 Gas Cap
That would be exactly 1 million combinations
4x(1+3x8)x(1+3x8)x(1+3x8)x(1+2x1+1)x2x2
(Feel free to correct my math)
With the way it's set up, there are tons of unique combinations for how a single gun could spawn in.
Currently this functionality is only for a singular rifle, but I intend on expanding this to more weapon types, and have more customizability & interchangability of gun parts.
This Rifle is also animated!
The gun has two slightly different cycle animations depending on the barrel.
Shows a loaded magazine in real time.
And has a unique "animation" for the Cube mag that changes as the mag empties.
Some planned inclusions are:
Cosmetic:
Spray paints
Engravings
Design Trims
Functional:
Melee weapons
Melee attachments on guns
Alternating between ammo types
Please note!!!!!!!
I have NOT tested this mod in multiplayer.
It is fully functional in SINGLEPLAYER, but I have not had the opportunity to bug test it in a multiplayer environment!!!
Please let me know if any bugs come up, and be sure to mention if it is a Multiplayer or Singleplayer bug!!!!
No tips needed, but are appreciated!
https://ko-fi.com/verysaltyoreos
Workshop ID: 3676018580
Mod ID: SaltyModularWeapons```
Initial Release 🥳 🎉
would be cool if you can craft ammo for it
would then def download
That's a planned mod in the future, you could always use some other ammo crafting mod, like the one my friend has called "Hot Brass Ammo Crafting"
the gun currently just takes standard rifle rounds, but I do plan on improvised munitions in the future
Just write javascript and leave the script out. 😛
might be redundent then to do craftable ammo if there is already a popular ammo craft mod, i just never used ammo crafting mod so i brought it up since it would make sense for this style of gun
There are plenty of popular mods, yet I don't feel it would be redundant for me to to it in my own way :P
Same friend is making a framework with aspects similar to stuff in mine, but the way they function are quite different mechanically and would not inherently replace each other despite their similarities
well ill give it a shot, i like fallout style pipe weapons anyhow
You need Lua to start modding PZ, but Java is an upgrade :0
but you'll still need to know Lua for UI stuff
all the UI framework is in Lua
The end goal will be guns that function like multi-tools
Being as specialized as you make them, and function how you want them.
I have a few gun types in mind that I will be implementing, and the idea is that they will have shared parts that can be swapped between them
a gun will only really be defined by its core
I was thinking of making a "heavy improvised shotgun" where ammo is crafted using a tin can, gunpoweder, and scrap metal.
Instead of normal projectile logic it just kills all the zombies in a cone, then knocks the player backwards and sets muscle strain to max.
While it's currently not functional/enabled, I have a bayonet and axe attachment I'm working on
Make a gun that shoots knives!
Gone will be the days of only using your gun as a way to kill zeds, attach a collapsible spade to the end of your firearm and dig your own grave!!
that would be the sickest thing ever ngl
a gun that's also a proper melee
Yep!
I even have it working to scan the bayonet directly and use its stats without damaging/affecting the gun function
would be cool if you can swap modes between gun and melee but i think that's like a lot of work
When you replace your bipod with an entrenching tool
That's how it works, it swaps between them
the code is easy, the user interface and user experience is horrible.
or not yet
Not quite, having some minor issues so it's delayed
but it's the next thing I'll be working on for the mod
Which can probably be fixed by a huge amount of additional code.
Really it's just forgetting it has a magazine loaded
it's easy to have a weapon that has functions of ranged and melee? how would you do that
that's the only current issue
i can only think of having a fake melee clone tool that gets inserted
That's exactly what I'm doing
no no no! You have two weapons that transform into each other.
That's why it's a horrible user experience.
Remember this is a game where a watch becomes a completely different item when you wear it on yoru other wrist
I saw some guy with working bayonets
I assume he just made it autoswap based on distance of nearest zombie, or some hack like that
https://cdn.discordapp.com/attachments/232196827577974784/1423569964123815986/2025-10-03_02-13-14.mp4?ex=69a49118&is=69a33f98&hm=7074d634c76267d0a136f3e15ca8b3c3037ac295254e4451a78025e23238fd03&
https://cdn.discordapp.com/attachments/232196827577974784/1423570666833055784/2025-10-03_02-13-43.mp4?ex=69a491bf&is=69a3403f&hm=a19ab27af68eff764c097902d7c25ab1d8c2e7c4b35806de914a62292cdaba25&
https://cdn.discordapp.com/attachments/232196827577974784/1423572702064545912/2025-10-03_02-18-51.mp4?ex=69a493a4&is=69a34224&hm=aa3d754aeebe1487b818aa8dcca370f900a4d489e6968e1825cc06dff6de022a&
Here's some old videos from an earlier stage in the project
https://www.youtube.com/watch?v=_luBh6eFANU This would be a viable mod; a melee weapon where you can right click -> reload and replace the shell, and on hit if there is a shell do a bunch of bonus damage.
Engineers get Onshape Professional free up to 6 months https://Onshape.pro/integza
JLC3DP 3D Printing & CNC Service Starts at $0.3: https://jlc3dp.com/?from=integza
Stainless Steel Properties: https://jlc3dp.com/help/article/316L-Stainless-Steel
@hacksmith Bobblehead: https://hacksmith.store/products/bobbleheads
Machines
Bambu Labs X1 Carbo...
Not a viable weapon, but a viable mod.
Hi, im busy with a mod ive been building while i learn lua, i just want to find out about the moddata. how big can a players mod data be before it starts giving issues in single player or multiplayer or if their is any limit at all
the mod im making is a skill tree - that allows the user or admins to create their own tree and build their own hierarchy with multiple categories and im currently effecting about 50 + stats with the option of creating active skills that active when conditions are met on the above stats - eg: panic hits 80% then skill activates giving you 100% dmg increase and increase amount of multi hit targets you can hit for a limited time or until it goes below
i played with around 200+ nodes unlocked and didn't really see any difference but I'm curious when on a server and their is 10 or 20 people with that amount
honestly yea maybe just having space bar do damage is better than a swap
Does "200 nodes unlocked" mean you're just storing 200 numbers?
Well I plan to add in a hotkey
This is just the proof of concept
I don't think storing the nodes will be an issue, I think the bigger potential issue is the performance of constantly checking the conditions for active skills
And the reason why I'm hyping this up is because the melee version of the weapon is generated in real time.
It's not just a dummy item with set base stats
200 nodes are as follows
i store the nodes as unlocked and track which skill they effect so im not grabbing every stat on every tick only the one that player needs
when nodes are unlocked and their is multiple of the same stat it reruns the calcualtion and stores the value on the player
Player save data is limited to 128kbyte, but dunno how expensive syncing a ton of mod data is
Meaning the functionality can be used theoretically in any mod that adds in one or two specific tags to their guns
if we have endurance gain increase - 3 node 1.5 + 1.6 + 1.5 i store endruance gain as 4.6 and when the tick runs to getthe value it applys that single value but im still storing the node id for each node a player has
It's also because I meant it when I said it's going to be designed for your gun to turn into a multi-tool
Provides quality options for different melee builds without having to carry multiple weapons and encumber yourself
i had an issue in the start where i would just sync everything at once but ive got it to be alot smoother by only updating the values that changes when unlocking a node or refunding it or if a world buff applies
ill most likely have to just get a dump of my mod data by unlocking 1000+ nodes and see how big it is
also 25 seconds into the last video, you can see my bayonet break and instantly swap to firing mode
You could back 200 booleans into 25 bytes, instead of 800 bytes if they get sent/stored as regular ints.
A lot of of the zomboid client/server communication is written like every bit is precious.
its LUA...
If you wanna bitstuff doubles.. be my guest 🙂
That just makes the packing & unpacking less efficent!
Lua doesn't even have an int type.
If the sending-over-the-network stuff is a bottleneck that will help.
But stuff goes into java before getting sent, so it will be a lua number -> java decides on int or float probably
java decides on double, it would be crazy for it to randomly typecast it
regardless a double can't store every integer value
it doesn't matter if java is converting it to an integer if the double doesn't represent the right integer to begin with
Lua does have a native boolean type however, and PZ would likely send that as byte.
looks like i should be fine im only doing about 7.5kb with 1000 nodes on the player mod data
would it be better to store unlocked nodes on the global side and then just amend all players that have it when they unlock or refund them
i see this in the mod data section
In online multiplayer, GlobalModData is not saved on clients (client-only save), so it will not persist on reconnect!
does this mean it gets lost on every restart? or am i just reading this wrong
it's lost by the clients
in other words there is basically no reason to use global mod data on the client anymore, it doesn't behave differently from any other table
^ ie, you need to make your own sync packets both ways.. its just an isolated table in MP on client side.
thanks for the info, just trying to see where i can squeeze out any performance or bugs that may happen when scaling
Use sendClientCommand / sendServerCommand for specific cases and never send the whole table. IMO, multiplayer mods should follow a proper client-server architecture instead of just syncing client-only data to the server.
i was sending the whole table on ui close to force sync - ill change that now to look at the data and not be lazy
if the server have nothing to do with your data, you can try use mod options (small data) and file writer (structured) on client
especially for ui
Project Zomboid should follow a proper client-server architecture, yet here we are. 😛
all ui stuff im placing on the client for things like opacity
but the server does the calcs and node data checks
Is there anyway to change the tags on mods without re-uploading via the game? I want to add [Multiplayer] to teh mods I've updated for MP, but I don't want to go through the game and deal with having to make sure I'm not about to wipe out the description by uploading an old one unless I have to.
Yes with the steam uploader tool, but you can also do what I do: Open the mods 'edit description' in steam workshop (browser), upload mod via PZ, then hit 'save changes' in browser.
You should be fine don't worry
Here, reddit, other discord servers, modding Discord and supportive saturday
Also read this to make your mod page better
#1235648828900642966 message
Hey, is there a guide or a page of the wiki were i can learn to make a mod that add a challenge?
Nop no docs
i see, i found the "dochallenge" and "addchallenge" line for lua, do you know if i can add it to the game just like that or i need more archives or sm
New Update (Hidden King) https://steamcommunity.com/sharedfiles/filedetails/?id=3675696752
Hello everybody, quick question. Is there any way to mutate the texture of a vanilla firearm?
I'm looking to create a recipe to change the texture of a gun, without needing to create a new gun, something like:
gun.texture = 'newUrl'
But all the references I have read showed me this is not possible and I would need to create a whole new gun and inherit all the values from the previous gun
Is there an UI editor for B42, I seen many making nice looking UI.
no
i've noticed a lot of the fancier uis are ai coded, i guess it's good at something
lol
IIRC someone has a UI framework? but other then that, I just go and steal stuff from vanilla UI's
its a pretty decent UI framework TIS has really
my own I made was muchless capable and more annoying to use (for my own game years ago)
The existing UI components seem quite flexable though and have all the major options you'd want from a UI
while still allowing enough raw drawing API to let you do any kinda special component you might want.
(theres a few calls that let you draw only part of an image via UV cords for example)
My best UI so far:
Actually you can make a new model with a different texture and change the InventoryItem model if I'm not mistaken
A bit tedious to do tho
You can completely replace the model of a weapon. I've never tried just doing texture, but worst case you define a model identical to the base model with a different texture.
Look at the Survival Rifle mod for an example that swaps the weapon model (you'll obviously want different triggers)
Missed that, yeah that makes sense 😄
Done
Hey Nasko, any chances we could get a forum like #1162438206516645948 but specifically for Mod Showcases?
Technically we can just showcase then here on the chat or on the original showcase channel but a place dedicated to that would be really neat for organization and better individual visibility!
Thx !
You would also need to add in code to keep the model as the correct one, or it will default back to the original
when reloading the game
this could easily be accomplished with a simple modData check onEquipPrimary/onCreatePlayer event
Hi, is there a way to get the ItemKey (I guess from an item type string) in order to use as first parameter of ItemContainer.addItems for MODDED items ?
Does anyone know how I can add something to this menu?
Posting this here again for engagement
https://steamcommunity.com/sharedfiles/filedetails/?id=3676018580
Hello again, is there something specific to make modded containers (bags) to have a base Encombrance (Weight) ? When I duplicate the duffel bag definition in a modded module, my bag empty weight is 0 instead of 1.0. (B42.14.1). I've tried many bags variants and got the same for each one tried. Parameters other than weight (Capacity, WeightReduction, Icon, ...) are set according to my changes. module TestMod { item Bag_DuffelBag { DisplayCategory = Bag, ItemType = base:container, Weight = 1.0, IconsForTexture = Duffelbag;DuffelBag_Green;DuffelBag_Grey;DuffelBagBlue;DuffelBagRed;Duffelbag_Sport;Duffelbag_Sport2, CanBeEquipped = base:back, CanHaveHoles = false, Capacity = 18, CloseSound = CloseBag, ClothingItem = Bag_DuffelBag, EquipSound = EquipDuffleBag, OpenSound = OpenBag, PutInSound = PutItemInBag, ReplaceInPrimaryHand = Bag_DuffelBag_RHand holdingbagright, ReplaceInSecondHand = Bag_DuffelBag_LHand holdingbagleft, RunSpeedModifier = 0.95, SoundParameter = EquippedBaggageContainer DuffleBag, WeightReduction = 65, WorldStaticModel = DuffelBag_Ground, Tags = base:isfirefuel;base:isfiretinder, } }
Need a translation name for items to have weight
thanx
Just gonna.. leave a report about that on #mod_portal
Seems like once a day we get someone with that issue
(Since its very confusing and the only way to know its the translation tag is have someone tell you or code dive for an hour)
Yeah, or I could just not have cared until I finished the mod, and it would have disappeared when I'd have done the translation. People with good task priority management probably avoid the time loss.
Most people just bang there head against the wall for hours wondering why it doesn't work lol
if they notice it
Lets call it mechanics eye? xD
I think the colored version is a bit to heavy on the eyes?
Hi, new to modding. I'm trying to get the world age, date time, and current weather.
I'm having a hard time getting the weather. Reading through the docs, I don't think its possible in .lua? or am I missing something.
All I could see is this class
https://pzwiki.net/wiki/ClimateManager
print("Is Raining?:"..tostring(c:isRaining()).." // Rain Intensity:"..c:getRainIntensity().." // Temperature:"..c:getTemperature().." // Fog Intensity:"..c:getFogIntensity().." // Wind Speed:"..c:getWindspeedKph())```
Thanks for taking time. I believe I already did something similar. But let me try again. It's like the .lua can't access some methods within the ClimateManager class. Or maybe I'm doing something wrong.
Has someone already created a new item type from lua ? (without .txt)
I was thinking about doing something similar where you don't have to open the hood to interact with some parts like the wheels, doors, etc. I love this view (and the colored version is definitely too much lol)
yea i think its doing a good job this way
Does it work like foraging?
nah thats just me playing with shortsighted xD
Understandable, but I think that would be cool to consider if it's not per vehicle view
yea its using a 3 tile range to find the car so you could see multiple cars, esle with slightly longer cars you dont get a display if you stand in front of it
I also have this limitation of getting the vehicle distance because I want to consider burnt car wrecks for a different feature. Can you check for per part areas and get those coordinates instead?
that should be doable
I wish getNearVehicle had a custom distance check instead of a set distance
That seems like too small of an ask for #mod_portal lol
got it that it triggers when it finds a part in a 1 tile radius, but thats not any help when trying to read burn cars 😄
How do you grab the vehicle to begin with?
getcell():getvehicles()
i can give you the whole thing for you to look ```--- Returns the single nearest vehicle to the local player, determined by
--- finding the part-area coordinate on each vehicle that is closest to the
--- player's position. Returns nil when no vehicle is within FOCUS_RADIUS tiles.
local FOCUS_RADIUS = 1 -- hardcoded; not user-configurable
local function getNearestVehicle()
local player = getSpecificPlayer(0)
if not player then return nil end
local px, py = player:getX(), player:getY()
local bestVehicle, bestDist = nil, FOCUS_RADIUS * FOCUS_RADIUS
local vehicles = getCell():getVehicles()
if not vehicles then return nil end
for i = 0, vehicles:size() - 1 do
local v = vehicles:get(i)
if v then
-- Use each part's area centre for the distance test so we match
-- the coordinate system the badges are rendered in.
for j = 0, v:getPartCount() - 1 do
local part = v:getPartByIndex(j)
local area = part and part:getArea()
local center = area and v:getAreaCenter(area)
if center then
local dx = px - center:getX()
local dy = py - center:getY()
local d2 = dx * dx + dy * dy
if d2 < bestDist then
bestDist = d2
bestVehicle = v
end
end
end
-- Also test the vehicle origin for vehicles whose parts have no area
local dx = px - v:getX()
local dy = py - v:getY()
local d2 = dx * dx + dy * dy
if d2 < bestDist then
bestDist = d2
bestVehicle = v
end
end
end
return bestVehicle
end```
i just have to get rid of the focus radius stuff since i dont need it to adjust anymore
I just think it would be easier to settle on 1 vehicle at a time and not have to deal with that + potential overlapping text with just getNearVehicle ha ha
Wait, your first comment is about only returning one vehicle...
Now I'm confused
Range 4 only shows 1 at a time
stil have to work on that zoom <.< that the field shrinks
Oh so you want more than 1 sometimes? This might be more expensive, but you can always do a per tile search for vehicle containers in a radius around the player. That doesn't require the vehicle's exact x and y
no, just wanted to show that it only shows 1 even with a range of 4. displaying more than one is not something that would be healthy for the eyes 😄
That's why I was confused lol it sounded like you could have multiple vehicles' parts (multiple vehicles) showing lol
so why not getNearVehicle then?
yea i could replace all that stuff with a 1 liner, but i have to limit the range, its triggering like 4 tiles away
You can always do the range check after getNearVehicle, it always does the closest and most center facing one from the player's cone
so late again, have to go to bed, thx for the input 🛌
Oh no problem, I get enjoyment from talking about the only things I know about this game code-wise lol
how on earth do you check to see if a player has a trait? it returns nill for literally everything
You need to check versus CharacterTrait
what is 'literally everything'
TraitCollection.hasTrait, HasTrait,conains, getTraitSlot
what are the arguments?
look middle line
if
smokerModData.SmokingAddiction >= SBvars.SmokerCounter
and not player:hasTrait(CharacterTrait.SMOKER)
and SBvars.TraitsLockSystemCanGainNegative
then
we can't tell you what you're doing wrong without knowing what you're doing in the first place
Right? Some people get annoyed at me complaining about food all the time but I just love it when I meet someone who I can actually talk details about the food with. Hard to work on systems when you only have your own opinions on the subject.
what if it's a custom trait
Speaking of code issues... what is the operator precidence for ==/>= etc and 'and/or'
Like....
if a > 0 and b > 0
is this
A: if (a > 0) and (b > 0)
or is it
B: if ((a > 0) and b) > 0
and/or are a lower precedent than ==/~=
Or something even more cursed?
if (a > 0) and (b > 0)
i have the regestriy, is it just :hasTrait("mymod:mytrait")
K thanks. I could have sworn I had bugs till I added more () in some code and was wondering if that was a thing or not.
What operators are lower then and/or?
if either you or the compiler is getting confused the brackets never hurt
the one i trip over occasionally is not has the highest precedence (i prefer ! since that makes this a lot more obvious visually)
Operator precedence in Lua follows the table below, from the higher to the lower priority:
^
not - (unary)
* /
..
< > <= >= ~= ==
and
or
so not x and y means (not x) and y ?
yeah
Hu, or is lower then and.. makes sense. I kinda assumed they would be equal
the reason i trip over it is if not a == b looks like it means if a ~= b
Typically and has higher precedence in languages
Ah yea
no, you import ur registry
for example registry
---@class EvolvingTraitsWorldRegistries
ETWRegistry = ETWRegistry or {}
---@type EvolvingTraitsWorldTraitsRegistries
ETWRegistry.traits = {
AV_CLUB = CharacterTrait.register("ETW:AVClub"),
}
then u have a lua file that returns ur registry
return ETWRegistry
then u require it
---@type EvolvingTraitsWorldRegistries
local ETWRegistries = require("ETWRegistry")
---@type EvolvingTraitsWorldTraitsRegistries
local ETWTraitsRegistry = ETWRegistries.traits
then u use ur registry
if
not player:hasTrait(ETWTraitsRegistry.PLUVIOPHOBIA)
and modData.RainCounter <= -SBCounter
and not desensitized(player)
and SBvars.TraitsLockSystemCanGainNegative
then
i like languages with ! better since if !a == b is very obvious about that
Yea, Im not a huge fan of Lua's not and ~=
~= makes me mad fr
I am indifferent about ~=
I get so many errors about forgetting to convert != to ~= when I convert java to Lua -_-;
true and real
i don't really know why they went with ~, seems completely arbitrary to me
Apparently ~ came first. but im pretty sure != was around before Lua was invented...
I think they should have gone all in with the word operators and made us type out greater than
"greater or equal but not lesser than"
x >= y? What the hell, this is a scripting language. We should be writing x greater than or equal to y
Even better
You gotta define all your codepaths in english or the AI interpeter will get confused
It certainly was, I wonder if any old documents say why they chose it
nil over null is pretty silly too but i think that one might be to differentiate interpreter errors and runtime errors
"Can't reproduce bug report. Please turn your computers tempature down so it stops hallucinating so many instructions"
"We need to make this language easy to use for non programmers!"
"What about easy to use for programmers?"
".... %$^& EM"
And thus, the more you learn about Lua, the more of a programmer you become and hence the worse you become at Lua /s
So, how do you in 42.13 and higher hook onto smoking? Before I used to do sth like
local original_OnEat_Cigarettes = OnEat_Cigarettes
---Overwriting OnEat_Cigarettes here to insert ETW logic catching player smoking
---@param food any
---@param character IsoGameCharacter
---@param percent number
function OnEat_Cigarettes(food, character, percent)
ETWExportedFunctions.smokingAddictionMath(character)
original_OnEat_Cigarettes(food, character, percent)
end
Needless to say it ain't working no more 
it's just in a different place now i think
maybe you should.... smoke the cigarettes? I dunno I don't smoke anymore I dunno what you kids do with em these days.
probably RecipeCodeOnEat.consumeNicotine
Pretty sure its in a table
Ty, will look into it
Go look at the cigarette onUse() in the .txt if that doesn't work or you wanna confirm.
(or for future items)
Kinda happy to see stuff like that being moved outta globals and into tables. Not 100% sure the shift to java was entirely needed but whatever. Shows someones pushing back on technical debt.
the move to java is just because it allows type safety with their script generator
script generator?
I get the desire for type safety as I had seen a number of bugs to do with typos and such, especially in item scripts
Just was a little annoyed that we saw about as many bugs from them converting the scripts to java as I had seen in typos 😛 (though I guess many typo bugs where fixed long before I started looking so thats a bit unfair compairson)
the inversion of dirty/clean rags was funny.
bugs being introduced by any major conversion is inevitable, potential bugs have been prevented into the future
ty
Not sure if it changed in B42.13, but you used to eat cigarettes and the eat action would play the smoking animation/sounds.
Now I'd guess either Tags = base:smokable, or EatType = Cigarettes, is what handles this
I'm still annoyed you can't wash rags in a washing machine, and the code needed to change that is in java. And they updated this... to put it in a different bit of java.
Could always throw it in #mod_portal, if you haven't already
There are lots of thing I'd like them to fix first!
Can't we make them just like... soak and replaceonwet like magazine armor does?
(or is that only destroy on wet?)
oh its a tag base:breakwhenwet
Oh no wait onBreak is a lua callback
I can't see where the "do this when it breaks" code/replacement item is
I assume it's using the newer system of not making a new item, but having a different name when condition is 0
crap, rags don't even get wet -_-
Oh... OnBreak = is only for weapons, doh
so yea, cleaning rags is.. pretty broken -_-
even from a modding standpoint
Does it not still trigger when other items reach 0 condition?
Can’t you just change that, or is it hard coded
Is there a mod that adds the browning hi power?
Does anyone have any idea why, when I place the sprite of an object that has an inventory and build it, it comes with items inside?
Im not sure other items even have it.
I think thats only for clothing...
So we'd have to turn rags into clothing and/or weapons 😛
I feel like the best we could do is a 'mass wash rag' recipe that requires X water and lets you wash multiple rags at once, with an onTest that requires you be near a washing machine or something
I'm pretty sure that is hardcoed, in that only the Clothing class can get wet
does player:playSound replicate in multiplayer? (if i sendClientMessage to all players to play sound, it will pay mulitple times for everyone based on # of players)
IIRC, it does, you want playSoundImpl or something for non-replication
(Kinda required to have proper volume control over sounds, make sure to adjust it based on the game sound slider -_-)
getFileWriter doesn't seem to work on my mod for 42.14 server, did they change it?
@gaunt junco wrong channel, ask questions here
My bad @bright fog
Anyone have a fix for container liquid not showing in context menu on cooking pots. Like I can’t do anything with it. 4/5 cooking pots are bugged like this. No clue if it’s a mod or pz.
Uuuuhm, how does one hook onto it, considering it's a java method? Haven't done it before so not entirely sure how can one do it
Like I want to run some lua code whenever nicotine is consumed 
Hey, i am currently making a big modpack with specifics settings for a long time now.
But since the B42 is updated sometimes, some mods are causing bugs and i try to solve it on my own (even if i am not a dev).
And im looking to fix a mod that basically allow the instakill with a short blade in combat again, like B40.
The mod Better JawStabs give you the chance to instakill a zombie if a another zombie is not close (in vanilla it is determined if a zombie has saw you).
Do you know a way to fix it or maybe a easy way to program a script?
Not an answer you are looking for but making modpacks in b42 rn is crazy due to how often game updates and likely to break mods
I know, but im addicted to this modpack.
I will share this modpack with the community later, but i swear i have never had such a cool experience in gaming with this modpack when all the mods were fine.
It is a complete overhaul of the game, making shamblers a real danger again, and the game look so realistic and dangerous.
So the short version is you have a mod that used to work, now it doesn't, and you wnat to fix it?
If it's a B42, start with what is actually wrong - what errors or problems do you get when you try to use the mod?
I do agree with @dull moss that huge modpacks are not worthwhile right now; it's fine to run lots of mods, but don't bother trying to make something to share because 1) you will have to constantly fight to keep it all working and 2) IMO downloading huge modpacks is a terrible idea since people have no idea what is actually going on, and it's best to build up your personal preferences for your own use.
But fixing up a mod you like that stopped working? I do that all the time for personal use, and since it's often a very small fix I'll psot in the mod comments for teh author./other users to make the same fix if they want.
(BTW> the reason jawstab in vanilla only works agsint a single zombie is it has a chance to disarm you and you have to pick your knife and re-equip it... and you can't alter that behavior in a mod because it happens in CombatManager.java)
I will remember that thx.
Anyway, when i said that i will share the modpack tare, it's not tomorrow.
I know i'll need to wait for the B42 to be finished.
Aye, dedicated place for them makes sense.
https://canary.discord.com/channels/136501320340209664/1478418176516558880
Thanks 
It's at the bottom of the Workshop category atm, let us know if y'all want it placed elsewhere
really ?? huh
strange
Would be interesting to have like
certain normal-type items be affected by being wet
this is gonna sound really dumb, but could you get around this by turning dirty rags into water containers?
Like don't get me wrong, gameplay wise this would be dumb as hell, but could it theoretically work ?
Water container is a special case
books/magazines being ruined by being left in a soaked bag
rags being unusable for bandaging until dry (or acting like dirty rags)
Instead of being part of the object type, where type literally causes items to be a different java class, fluidcontainer is a class that can added to something high level all items descend from
why does Java have genetics
They did that in B42, and it was very exciting because I thought theyightvtry to fix up the old junk too
did what
Class inheritence
I've yapped a lot
Made fluid container a modular thing
So the hydration backpack is a container that has a fluidcontainer
Common nasKo W
It's why you can't do stuff like a drainable weapon, because drainable is one java class and weapon is another
Or if you want to convert underpants into something you can put stuff in you have to change them from type clothing to type container, which if done mid-save deletes all existing underpants from the world.
A sane design spec would let you add a "inventorycontainer" property to objects, like fluidcontainer... but all the classes were coded separately.
place
they have made an intention to do this clear
@bronze yoke hi 
it's the same as a lua function
you can hook any java method as long as it's being called through lua (what you are modifying is lua's copy of the method, not the method itself)
and OnEat is one of the weird times where java uses lua to call a java method
so sth like
original_func = RecipeOnEat:consumeNicotine() -- or whatever its called
local RecipeOnEat:consumeNicotine()
...
end
local original_func = RecipeOnEat.consumeNicotine -- or whatever its called
function RecipeOnEat.consumeNicotine()
...
end
Anyone with experience making tiles know off the top of their heads why a custom tile might not show up in the tile report? Some obvious bit I may have missed?
Oh, so true. Thanks.
i'm trying to make a local mod to add a recipe
i tried adding my recipe to one of the script .txt files but i leads to my game crashing
Does anyone know if the ItemType reverts back to its original state on game reload if you use setItemType() to change it?
If it gets saved to the individual item, it could be helpful for some ideas I have
but if it reverts to its original state on game load, then it would be a waste of time trying to do stuff that way
okay it doesn't crash my game anymore but i just can't see it in game now 😭
i also change the name to "craftRecipe CarveLongStickFromLargeHandle" so it doesn't overlap with the vanilla recipe but still nothing
is there no module block in your file
i didn't mean to sound demeaning, just wasn't sure if you'd sent the full file or just the recipe you were having trouble with
wrap the whole thing in this and it will probably work```
module Base {
...
}
nah you didn't but i also realised that it's a beginner mistake lol
😭
why is it crashing agian
nvm i found a typo
whoops
thank you very much albion and oreos
it works now
i do have some polish question about how to make the crafting recipe name different from its id and how to make it not require a surface to craft
the name needs to be set in a translation file
at the moment you have the tag AnySurfaceCraft, there's a different one for not needing a surface at all, iirc it's InHandCraft but it should be listed on the wiki somewhere
i ended up just putting the spaces in the craftingID and it had the desired effect
i have one final question for the recipes
if i want to make it so a recipe needs to be next to a specific building (chopping block in my case) how could i implement that?
OnTest of the recipe, IIRC
(though the UI feedback of said 'failure' may not be clear to the player)
since I believe its designed to test if input ingredients are valid..
yeah
Alternatively, I think you can make the chopping block a whole crafting station thing
also looks like it needs lua coding which is beyond my skill level
it already is one actually
Oh
though it jsut opens the regular crafting menu
yea look at how... the pottery wheel works for example
Hmm, seems to be that it has a matching tag to the target crafting system?
craftRecipe MakeCeramicCrucibleSmall
{
timedAction = Craft_PotteryWheel,
time = 100,
Tags = PotteryWheel,
SkillRequired = Pottery:1,
xpAward = Pottery:25,
category = Pottery,
inputs (...)
outputs (...)
}
(trimmed inputs and outputs)
if you look up that tag (PotteryWheel), you get this:
entity Pottery_Wheel
{
component UiConfig
{
xuiSkin = default,
entityStyle = ES_Pottery_Wheel,
uiEnabled = true,
}
component CraftBench
{
Recipes = PotteryWheel,
}
ah alright i see
thanks
i was looking through the different crafting stations kinda scratching my head
I dunno if you can just define your own, but if it turns out you can plz report back because I really wanna know :0
Yea im pretty sure its the tags on the recipe and the Recipes = PotteryWheel, in the craftbench component that align the crafting menu to the station
(I picked pottery wheel because its simply with a tiny number of recipes)
WHat you do is, search for its exact ingame name in *.txt
then, that leads you to the english translation file, copy that translation tag (or at least, part of it..) and search for that.
*.txt?
Yes, use a program that can search all files in a directory for phrases
target all .txt files
that is where entities, translations, recipes, etc live
in project zomboid\media\
it can tell you files yes, but not where in the files, get programmers notepad or notepad++ or something
(or a real IDE)
Ok then, tag your recipes ChoppingBlock
(no other tags, unless you want them doable elsewhere as well)
i'm adding "CanBeDoneFromFloor" because logs heavvy
thats prob fine
IIRC that means the ingredients can be on the floor, but otherwise crafting works as normal
Nice
alright just tested it out too
works as intended
waow i already got a subscriber
something something self promotion
Anyone know what security vulnerability this was?
And was it discovered by a modder poking the game internals?
it was yes
I vaguely remember mentions about that
Don't think anyone said what the vulnerability was tho
Was it Omar who mentioned it ?
it was somebody i hadn't seen before
The thing I reported was minor compared to what this one appears to be
They've said their position on it is not sharing details to protect people, so anyone who knows is likely to do the same
I'll say TIS is very likely justified in emergency patching it.
Would be nice if TIS would focus a little more on save updating in the future. B42.12/.13/.14 have been rough.
Sounds fun. And also not very surprising when they are making custom multiplayer stuff in java instead of using an established engine and data standard.
They still haven't fixed the "if an object fails to load because of changes to the script then just reset the entire chunk it was found it"
I tried adjusting an object in a non functional mod to work in B42.13.2+ and on load it expected different data serialization and BOOM! You're naked and half your base in gone. Instead of something sane like "Object X failed to load, I'll discard object X and continue"
that sucks. Also find it weird when an object is removed from the game, if its in a container, everything AOK... if its on the ground... the tile is replaced with ?
Factorio on the other hand, almost goes too far in loading old saves
"You are trying to load a save from: the dawn of time. Some tile overlap may occur" as seemingly the only thing that is wrong is turrets changed sizes and now overlap each other in some places
Can't imagine how much it must suck having to ensure old saves always load from eons ago.
Hi everyone, I'm looking for someone who could update the mod infected of The Last of Us. All the mod's code is available on GitHub, but it only works for version B41 and needs to be updated to B42.
We are also looking for someone to create a mod that would adjust the in-game voice chat, preventing voices from travelling through ceilings or walls. We have searched for a similar mod, but it seems that none exist.
Merci à tous et pour plus d'informations contactez moi via discord.
Anyone know a map that is JUST forest
I already updated it for B42, there's 2 versions
But the B42 version is outdated
hi
actually, question regarding this.
there are 2 exact funcs that have different args, how does that work? 
kahlua will determine which overload to call at runtime based on the types of the arguments
ah, so i need to do 2 overwrites, one for each but with diff args, ok, ty
I assume dis is right
local original_RecipeCodeOnEat_consumeNicotine = RecipeCodeOnEat.consumeNicotine
function RecipeCodeOnEat.consumeNicotine(item, character)
ETWExportedFunctions.smokingAddictionMath(character)
original_RecipeCodeOnEat_consumeNicotine(item, character)
end
function RecipeCodeOnEat.consumeNicotine(item, character, percent)
ETWExportedFunctions.smokingAddictionMath(character)
original_RecipeCodeOnEat_consumeNicotine(item, character, percent)
end
EDIT: it works
hm, yea it aint working 
ERROR: General f:0, t:1772642067149> ExceptionLogger.logException> Exception thrown
java.lang.RuntimeException: attempted index: consumeNicotine of non-table: null at KahluaThread.tableget(KahluaThread.java:1446).
on
local original_RecipeCodeOnEat_consumeNicotine = RecipeCodeOnEat.consumeNicotine
swapping for local original_RecipeOnEat_consumeNicotine = RecipeCodeOnEat().consumeNicotine
gives
ERROR: General f:0, t:1772642586825> ExceptionLogger.logException> Exception thrown
java.lang.RuntimeException: Object table 0x1394026142 did not have __call metatable set at KahluaUtil.fail(KahluaUtil.java:99).
I think if i combine things long enough eventually I'll get it 
Anyone knows a mod that does it so I look up correct syntax? 
you don't need to do anything weird like this
RecipeCodeOnEat.consumeNicotine is a magic box that, when called, picks the right java method to call based on the arguments you give it
there is only one of it
This line
local original_RecipeCodeOnEat_consumeNicotine = RecipeCodeOnEat.consumeNicotine
crashes saying that RecipeCodeOnEat is null
So I'm a bit confused
I double-checked with javadocs, no typos
^
are you definitely on latest b42?
today I learned that if you overwrite funcs you gotta restart the game fully, not just reload lua from main menu
I had a typo initially, so i fixed it and reloaded the lua from main menu
(it works)
xd
I don't think that's true
Well then idk, maybe something went wrong and i fucked it up in some other place 
has someone been able to update reliably X & Y rotations (on each render cycle) for InventoryItem in WorldObjects ? I've tried with 0,360 / -180,180 and some other weird ranges and the result is always similarly unsatisfying: the item is blinking (invisible on some-most- updates). ```lua
setWorldZRotation-- works wonders
setWorldXRotation-- blinks
setWorldYRotation-- blinks
Try not to override the vanilla function; instead, you can hook into it and return the original function once finished
look the snippet higher up
return it
the original function doesn't return anything
yeah even void func, just return it
oi vei
I wasnt returning in other places either 
local original_ISFixVehiclePartAction_perform = ISFixVehiclePartAction.perform
---Overwriting ISFixVehiclePartAction:perform() here to insert ETW logic catching player doing any kind of repairs
---@diagnostic disable-next-line: duplicate-set-field
function ISFixVehiclePartAction:perform()
local player = self.character
local modData = ETWCommonFunctions.getETWModData(player)
---@type DebugAndNotificationArgs
logETW("ETW Logger | ISFixVehiclePartAction:perform(): caught")
local conditionBefore = self.item:getCondition()
carPartStartingCondition = conditionBefore
logETW(
"ETW Logger | ISFixVehiclePartAction.perform(): car part conditon: "
.. conditionBefore
.. " VehiclePartRepairs="
.. modData.VehiclePartRepairs
)
original_ISFixVehiclePartAction_perform(self)
end

wait but why
do i need to return
if someone else overwrites in this way both our funcs run, no?
you store the original func, run ur stuff and then run original func, no?
oh, nevermind, I do return original func when it has return
local original_forageSystem_addOrDropItems = forageSystem.addOrDropItems
function forageSystem.addOrDropItems(_character, _inventory, _items, _discardItems)
if ETWCommonLogicChecks.HerbalistShouldExecute() and SBvars.TraitsLockSystemCanGainPositive then
local player = getPlayer()
local detailedDebug = detailedDebug()
if not _discardItems then
for item in iterList(_items) do
logETW("ETW Logger | forageSystem.addOrDropItems(): picking up foraging item: " .. item:getFullType())
if filteredForageHashMap[item:getFullType()] then
local modData = ETWCommonFunctions.getETWModData(player)
modData.HerbsPickedUp = modData.HerbsPickedUp
+ ((SBvars.AffinitySystem and modData.StartingTraits.Herbalist) and 1 * SBvars.AffinitySystemGainMultiplier or 1)
logETW("ETW Logger | forageSystem.addOrDropItems(): modData.HerbsPickedUp: " .. modData.HerbsPickedUp)
if
not player:hasTrait(CharacterTrait.HERBALIST)
and modData.HerbsPickedUp >= SBvars.HerbalistHerbsPicked
and SBvars.TraitsLockSystemCanGainPositive
then
player:getTraits():add(CharacterTrait.HERBALIST)
ETWCommonFunctions.addRecipes(CharacterTrait.HERBALIST)
if notification() then
HaloTextHelper.addTextWithArrow(player, getText("UI_trait_Herbalist"), true, HaloTextHelper.getColorGreen())
end
ETWCommonFunctions.traitSound(player)
end
end
end
end
end
return (original_forageSystem_addOrDropItems(_character, _inventory, _items, _discardItems))
end
man not checking ur own code for a while cripples a man

The hook is meant to return the original for other use cases; so don't break it.
I dont though?
yes, both run, just add extra code
if I do
local original_RecipeCodeOnEat_consumeNicotine = RecipeCodeOnEat.consumeNicotine
function RecipeCodeOnEat.consumeNicotine(item, character)
-- code abc here
original_RecipeCodeOnEat_consumeNicotine(item, character)
end
and someone else does
local original_RecipeCodeOnEat_consumeNicotine = RecipeCodeOnEat.consumeNicotine
function RecipeCodeOnEat.consumeNicotine(item, character)
-- code xyz here
original_RecipeCodeOnEat_consumeNicotine(item, character)
end
both will run, no?
to nitpick, it doesn't 'return the original function',it returns the return value of the original function
it is not necessary for functions that don't return anything in the first place
and you will usually break a lot of stuff if you forget to return from a function that does return something, so it's unlikely a mistake with that will make it very far
what's important for compatibility is the storing and calling of the original function
I guess technically you can add a return from func that doesnt return anything so in case that someone/TIS will ever make it return something you dont need to change anything 

yep, me lazy like that
it would take me more effort to remember this tbh
and I'll end up with part of code that follows this convention and part that doesnt
Its probably possible to setup lua pipeline on github that would check so every func retruns a value
eh, too much effort
just use lua linter no?
true, I only use formatter tbh
anyone here uses vscode-lua?
Actually, lemme rephrase, "what lineters y'all use for lua in vscode and do you recommend it?"
my combo lmao
extra is ls-lint, lefthook for pre-commit, and selene
oh, and Lua Debug (actboy168) for offline test suite
stylua ?
stylua is a formatter
@finite dune Uhhhh... Any particular reason my mod "Realistic Car physics" is now This item has been removed from the community because it violates Steam Community & Content Guidelines. It is only visible to you. If you believe your item has been removed by mistake, please contact Steam Support. ?
I mean it says right there, contact steam support

I doubt TIS have anything to do with it
Prob someone reported it or sth
Steam takes down mods first and then you can contact if it was not justified
It's much easier legally for them this way
To be fair DMCA strikes work the same way on big platforms, when platform gets a notice they shut down ur stuff and if u disagree they unblock or whatever
Somehow it feels targeted 1 day after they update the game for 'security risks'
Nope.
was it java mod? maybe java mods got nuked
Was.
I imagine vulnerability was on java side
