Jump to content

Help adding new patch types other than Cloth, Denim and Leather


Mowba

Recommended Posts

Can anyone point me in the right direction in the PZ code on where to find the stat values for patch types.

 

I am able to create a new fabric type and have it show in the UI, but I am struggling to find where the scratch, bite and bullet values for the original 3 patch types are (when added as padding to clothing), and where I can add values for a new patch type so that they are added to the clothing item when the new patch type is applied via padding. 

Link to comment
Share on other sites

  • 2 weeks later...

On the off chance this still helps replying 10 days later, these values are defined in the Java enum class Clothing.ClothingPatchFabricType in zombie/inventory/types/Clothing.

 

Taking a quick look, everything seems to reference it to determine these stats, such as the addPatch method where it checks the FabricType on the script item (e.g item LeatherStrips in media/scripts/newitems.txt). Then the final bite and scratch defense is determined by the value defined in this class for the fabric, which is multiplied by the player's tailoring value divided by 10 (in other words, the defined value equals the maximum at highest skill level). Don't see much on bullet defense, I assume it's equal to scratch defense since all the vanilla patch types are according to the PZWiki.

 

I don't think you can add to the class directly with just Lua modding, but I'm also better with Java than Lua, so any tricky way to recreate the same result is probably beyond me. If I had to take a couple guesses of where to start, maybe you could define your own value somewhere else, store mod data on clothing items, and modify the clothing items themselves by doing some checks on a PlayerUpdate event (or wherever) with methods like setBiteDefense, in order to imitate the way the vanilla patches work. This is assuming you can make it all interact with the tailoring menus and patch options nicely, I have no clue when it comes to UI modding apart from knowing item tooltip stuff is Lua side.

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...