Project Zomboid

Project Zomboid

62 ratings
[LEGACY] Noir's Attachments backpack weight reduction fix (java mod)
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
51.421 KB
Jun 9, 2024 @ 6:14pm
Jun 9, 2024 @ 9:41pm
2 Change Notes ( view )

Subscribe to download
[LEGACY] Noir's Attachments backpack weight reduction fix (java mod)

In 1 collection by fc
fc's HandWeapon getActualWeight fix collection
3 items
Description


ねぇしってる?
Please consider using my other mod, Hotbar Attachments Weight Reduction Fixes & Overhaul (requires Java mod), instead! It requires my other java mod but they not only fix but also expand on hotbar weight reduction mechanics :) This mod is not required for those mods; it's technically compatible with them, but is completely superseded if you let Hotbar Attachments Weight Reduction Fixes & Overhaul (requires Java mod) manage Noir's Attachments' weight reduction.



This is a java mod! needs to be manually installed
Fixes an issue where weapons are practically unaffected by setActualWeight/setWeight This means that (for example) backpack weight reduction from Noir's Attachments will be able to affect weapons with this fix :)

The problem is brought up here: [41.73] Implementation of HandWeapon:getActualWeight() makes HandWeapon:setActualWeight() ineffectual[theindiestone.com]

This is a java mod! needs to be manually installed
Must be installed manually! Must be installed on the server and per player for multiplayer! Docu: zombie.inventory.types.HandWeapon.class's notable methods: getActualWeight and getWeight returns the InventoryItem versions of the methods + the sum of the WeaponPart weightModifiers; a bit of weird logic: setActualWeight and setWeight subtract WeaponPart weightModifiers and ContentsWeight (ammo usualy) from the argument

manual installation steps
  1. Navigate to ..\steamapps\common\ProjectZomboid\zombie\inventory\types\
  2. Create a backup copy of HandWeapon.class (I recommend putting it in your %USERNAME%\Zomboid\ folder)
  3. Subscribe to this workshop item to download the replacement file
  4. Navigate to ..\steamapps\workshop\content\108600\3264807739\mods\HandWeaponFix\
  5. Copy the mod's HandWeapon.class file
  6. Navigate to ..\steamapps\common\ProjectZomboid\zombie\inventory\types\ again
  7. Paste HandWeapon.class, overwrite existing if you've made a backup

---

check out my other mod made possible by this one! Weapon Skills Improve Hotbar Weight Reduction (requires a java mod) :) it might be buggy but the sooner i spot the bugs the sooner i squish em!

---

im still brainstorming a way to do this without java modding, so watch this space?
rn im thinking using an invisible negative-weight item to do a corrective total player inventory contents weight adjustment, using moddata to store the working values, and hijacking the tooltips to show the corrected values...

---

plans
bugfixing if ppl kindly report them, then some mods to take advantage of this, like customizing hotbar weight reduction (in general or equipment-based)

many thanks to Tchernobill and Konijima for their great decompiling guides here and here[github.com] and ofc Noir for Noir's Attachments and its super good (!!) NATT_WeightReductionHandler that was the impetus for getting this mod done!

--


Workshop ID: 3264807739
Mod ID: HandWeaponFix
18 Comments
fc  [author] Jun 17, 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] Jun 16, 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 Jun 16, 2024 @ 2:48am 
Does this reduce the weight of items in the other slots like utility, sides, flashlight, bedroll, etc?
Xenon Jun 15, 2024 @ 2:52pm 
Nice mod!!! this works on multiplayer?
monster6268 Jun 15, 2024 @ 10:18am 
good
fc  [author] Jun 13, 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 Jun 13, 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 Jun 13, 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 Jun 13, 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] Jun 12, 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) :)