Project Zomboid

Project Zomboid

[LEGACY] Noir's Attachments backpack weight reduction fix (java mod)
18 Comments
fc  [author] 17 Jun, 2024 @ 6:47pm 
given the kinds of questions ive gotten, i think its fair for me to mention that ive updated my mod that uses this, it reduces weight in other slots based on skills: Weapon Skills Improve Hotbar Weight Reduction (requires a java mod)
fc  [author] 16 Jun, 2024 @ 10:08pm 
it should work on multiplayer assuming installed in every player's copies and, if on a dedicated server, the corresponding folder under java\zombie of the server

---

Noir's attachments already corrects the weight of flashlights and bedrolls if you enable the feature via the other mod, ModOptions--i have to note that yes ofc that option has to be enabled for *this* mod to work, too, because it's what tells Noir's Attachments the mod to try to begin with!
kreamythings 16 Jun, 2024 @ 2:48am 
Does this reduce the weight of items in the other slots like utility, sides, flashlight, bedroll, etc?
Xenon 15 Jun, 2024 @ 2:52pm 
Nice mod!!! this works on multiplayer?
monster6268 15 Jun, 2024 @ 10:18am 
good
fc  [author] 13 Jun, 2024 @ 5:34pm 
<3




> Does it work with modded items? is it a fix in general. Like, if I have,idk, a chainsaw attached, will it get reduced emcumbrance? Thanks!

it should, given how Noir's Attachment works!




> Side note: would you happen to know how to apply the same weight reduction percentage OR adjust the weight reduction percentage on sling weapons with Noir's sling mod?

while im not too motivated to keep working off this because it's a java mod (i think most anyone would prefer a fix to be just lua), id say it would be similar to how ive implemented in my other mod (which has this one and Noir's Attachments as a dependency): Gun Skills Improve Holster Weight Reduction (requires a java mod)
godlyrecon 13 Jun, 2024 @ 1:13pm 
Thank you for this! This mod helps a ton.

Side note: would you happen to know how to apply the same weight reduction percentage OR adjust the weight reduction percentage on sling weapons with Noir's sling mod?
Lil Beetle 13 Jun, 2024 @ 8:41am 
Does it work with modded items? is it a fix in general. Like, if I have,idk, a chainsaw attached, will it get reduced emcumbrance? Thanks!
Retardus Maximus 13 Jun, 2024 @ 7:42am 
I might do that at some point, but I want to test it in co-op first with a buddy of mine. And possibly add some more items to the list. If I do decide to upload it I'll be sure to credit you, Uncheat and Noir obviously.
fc  [author] 12 Jun, 2024 @ 5:18pm 
congrats, proud of you--once you're happy w what you have i encourage you to publish it! (the mods i publish are just a fraction of all the personal adjustments ive made over the years) :)
Retardus Maximus 12 Jun, 2024 @ 12:38pm 
I got it to work! I expected it to take me a long time to figure out how it works, but it turned out to be quite easy when the hard work has already been done for you lol. Had to fix some problems I encountered along the way, like adding the same line for a full kettle of water.

Now I just need to find a way to adjust the position/orientation of the guitar. It's good enough as is but I would have liked it to be diagonal and offset from the backpack instead of straight down and on the center, although that would also introduce a lot of clipping with other attachments.

But the fact I can actually attach them now and have the models show up is amazing, thanks!
Retardus Maximus 12 Jun, 2024 @ 4:24am 
Thank you so much for taking the time to write this!
I'm going to try it out over the next couple of days and see if I can get it to work for myself, it's going to take me a while but I hope I'll succeed in the end.
Thanks again!
fc  [author] 11 Jun, 2024 @ 6:20pm 
you dont have to do it that way, you could just make a mod that has a lua file in client (copy an existing mod and erase everything but the folder structure you need) that has...
[code]require 'NATT_ItemTweaks'

local kludge = function ()
local attachments = {
Hat_GasMask = 'Mask',
Hat_HockeyMask = 'Mask',
WeldingMask = 'Mask',
ClosedUmbrellaRed = 'NIghtstick',
ClosedUmbrellaBlue = 'NIghtstick',
}

for k,v in pairs(attachments) do
Tweaker(k,"AttachmentType",v)
end
end

Events.OnGameBoot.Add(kludge)[/code](untested code i just wrote here but it should work give or take)
fc  [author] 11 Jun, 2024 @ 6:02pm 
[continued..] so my kludge is basically having lua code that has the equivalent of the leadup to the Tweaker code...like, annoyingly, AuthenticZ's Backpacks feature redefines a lot of them so I redefine them again to work with Noir's--ideally i should define for both), so i have the following entries in my definitions table:
{'Hat_GasMask' ,{{'AttachmentType','Mask' },{'StaticModel','GasMask' },}},
{'Hat_HockeyMask' ,{{'AttachmentType','Mask' },{'StaticModel','HockeyMask' },}},
{'WeldingMask' ,{{'AttachmentType','Mask' },{'StaticModel','WelderMask' },}},
{'ClosedUmbrellaRed' ,{{'AttachmentType','Nightstick' },}},
{'ClosedUmbrellaBlue' ,{{'AttachmentType','Nightstick' },}},
[...]

...etc, which is then fed into a function that runs the DoParam method for each param in each item in each module that's in the table

i hope that helps!
fc  [author] 11 Jun, 2024 @ 5:59pm 
i could eventually post a patch-mod at some point, but to explain it: in ..\steamapps\workshop\content\108600\2754567348\mods\NoirsAttachments\media\lua\client\Hotbar\NATT_ISHotbarAttachDefinition.lua you can see what items correspond to what attachment points (defined w the code in lines 19-253)

now look at Nightstick = v.."Weapon",[//b] inside the slot type = v.."Weapon", (line 51) in particular, because in ..\steamapps\workshop\content\108600\2754567348\mods\NoirsAttachments\media\lua\shared\NATT_ItemTweaks.lua you can see that in attachments the ClosedUmbrella.. s are defined as NightStick s (lines 93-96), which ultimately means their (Script)Item is DoParam 'd to "AttachmentType = NightStick", done with the code surrounding Tweaker(k,"AttachmentType",v) (lines 167-169) [continued..]
Retardus Maximus 10 Jun, 2024 @ 3:46pm 
I took a look at the code from that mod and I must admit, I don't understand a thing about it haha.
Could you possibly upload that kludge somewhere, if it's not too much of a hassle?

I would be willing to try and write it myself if I knew how but I truly haven't got a clue of where to start.
My only experience with "modding" was some file merging and edits on other games.
fc  [author] 10 Jun, 2024 @ 1:11pm 
i have a running kludge for that in a server im playing/working on, just a bunch of "that looks right and it let me attach the thing to the bag" code--im mainly looking at the code in https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2900853768 for that!
Retardus Maximus 10 Jun, 2024 @ 12:10pm 
Awesome, thanks for this mod!

I was wondering if you could or would know how to add more items as backpack attachments? I love Noir's mod but I wish I could attach a kettle or an acoustic guitar to my backpack.