Jump to content

Wearing Multiple Backpacks


ArpyClarkson

Recommended Posts

So there was a mod that let you wear a Satchel with another backpack, Bag Plus Satchel, but it got deleted. I really liked the mod but can't find another download anywhere, so I figured I'll take a crack at remaking it. Anyways, I have no experience with PZ modding, so I'm just looking for some pointers for where to start. Any mods that do something similar, a conceptual gist, or an explanation of how I can go about achieving this would be greatly appreciated.

 

Thanks~

Link to comment
Share on other sites

So after poking around a bit I stumbled across the 'clothing_bags.txt' file in 'ProjectZomboid\media\scripts\clothing' and after a bit of fiddling I've got the satchel working like a fanny pack but only wearable in the rear; and working well with a fanny pack in the front.

 

I achieved this by modifying the satchel code to such:

1.  item Bag_Satchel
2.      {
3.          WeightReduction	=	30,
4.  +       ClothingItemExtra = Bag_Satchel,
5.  +       ClothingItemExtraOption = FannyPack_WearBack,
6.          Weight	=	1,
7.          Type	=	Container,
8.          Capacity	=	15,
9.          DisplayName	=	Satchel,
10.         IconsForTexture = Satchel_Leather;Satchel_Green;Satchel_Khaki,
11.         OpenSound   =   OpenBag,
12.         CloseSound   =   CloseBag,
13.         PutInSound   =   PutItemInBag,
14. +       BodyLocation = FannyPackBack,
15.         ClothingItem = Bag_Satchel,
16.         BloodLocation = Bag,
17. +       CanBeEquipped = FannyPackBack,
    -       CanBeEquipped = Back,
18.         RunSpeedModifier = 0.99,
19.         ReplaceInSecondHand = Bag_Satchel_LHand holdingbagleft,
20.         ReplaceInPrimaryHand = Bag_Satchel_RHand holdingbagright,
21.     }

Now I'll go over the changes, as far as I know from my 5 minutes of testing:

 

The additions to lines 4 and 5 add a context menu item allowing the satchel to be equipped; this is important because the changes to line 17 removes the standard "Equip On Back" menu item all backpacks have. Without these additions there was no context menu item that would allow the player to equip a satchel, however, the player could still double click the satchel to equip it as desired. I had to modify the code from the fanny pack as without doing so the satchel would turn into a fanny pack if a front fanny pack was moved to the back while wearing a satchel. From what I can tell this was caused by the 'ClothingItemExtra' line being set to 'Bag_FannyPackFront' or 'Bag_FannyPackBack' as it is for the fanny pack. Changing it to 'Bag_Satchel' got rid of any apparent issues with the satchel turning into a fanny pack, or being able to be swapped with a fanny pack when moving it from the front to the back; with the satchel instead being unequipped when doing so. There more than likely is a much better way to do this, but this was a quick solution and the only noticeable downside is the satchel retains the "Wear On Back" menu item while equipped.

 

The additions and changes to lines 14 and 17 are pretty self explanatory; I assume they affect the equip location of the satchel, actually allowing it to be equipped with a backpack- however I have not tested either attribute to isolate their actual function, but I assume they have already been well documented in far greater detail elsewhere.

 

So is this the right way to go about doing this?

 

Also, if so, how can I go about making these changes compatibility friendly and in a mod format that I can upload to the workshop? Do I need to make these changes via a LUA script?

 

Any tips, pointers in the right direction, or examples would be extremely appreciated!

 

Decided to just wing it and got it on the workshop, someone please let me know if I can do any of this better.

https://steamcommunity.com/sharedfiles/filedetails/?id=2578003871

 

Edited by ArpyClarkson
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...