Project Zomboid

Project Zomboid

Unbreakable Vanilla Weapons
 This topic has been pinned, so it's probably important
Sanakan  [developer] 17 Sep, 2023 @ 3:08pm
IMPORTANT: Details about mod & disclaimers
DISCLAIMER:
Unbreakable Vanilla Weapons (UVW) may or may not be compatible with other mods that modify weapon or items. This mod is built & maintained by ONE person on their free time. I don't have the resources or willpower to verify which mods UVW is compatible with for every patch a mod makes, or every update Project Zomboid has. If UVW is not working, it is highly likely that UVW is conflicting with another installed mod that is modifying the properties of weapons within Project Zomboid.

Installation tips:
  • Ensure that Unbreakable Vanilla Weapons (UVW) is the last mod to be installed to ensure proper function. This should allow UVW to overwrite the "items_weapons.txt" file and apply its modifications. You can ensure that the mod is installed correctly by hovering your cursor over a weapon item within the game (example: kitchen knife). If the item reports that it is being modified by Unbreakable Vanilla Weapons, the mod has been installed properly. This text should be displayed at the bottom of the item's information window in blue text.

How the mod works
This is a technical, nerdy explanation of how Unbreakable Vanilla Weapons (UVW) works. Hopefully you find this interesting, or even useful.

In Project Zomboid, every weapon possesses certain stats and qualities that are defined on a per-weapon basis in "items_weapons.txt"

Every weapon has a certain amount of maximum possible hitpoints, defined in the "ConditionMax" line. Additionally, every weapon possesses a roll to lower the amount of hitpoints by 1, defined by the "ConditionLowerChanceOneIn" line.

I'll use the Kitchen Knife as an example. Here's the raw code for the Kitchen Knife within "items_weapons.txt":

item KitchenKnife MaxRange = 0.9, WeaponSprite = Knife, MinAngle = 0, Type = Weapon, MinimumSwingTime = 2, KnockBackOnNoDeath = FALSE, SwingAmountBeforeImpact = 0.02, Categories = Blade, ConditionLowerChanceOneIn = 2, Weight = 0.3, SplatN.umber = 0, PushBackMod = 0.3, MaxDamage = 0.6, SubCategory = Stab, AimingMod = 0.8, ConditionMax = 10, MaxHitCount = 1, IsAimedHandWeapon = TRUE, DoorDamage = 1, SwingAnim = Stab, WeaponWeight = 1.7, DisplayName = Kitchen Knife, MinRange = 0.61, CloseKillMove = Jaw_Stab, SwingTime = 2, MinDamage = 0.3, KnockdownMod = 0, SplatBloodOnNoDeath = TRUE, Icon = KnifeChopping, RunAnim = Run_Weapon2, IdleAnim = Idle_Weapon2, BreakSound = PZ_MetalSnap, TreeDamage = 1, EnduranceMod = 0.5, MetalValue = 10,

As we can see, the "ConditionMax" for the Kitchen Knife is 10, and the "ConditionLowerChanceOnceIn" for the Kitchen Knife is 2.

The "ConditionMax" means that the MAXIMUM amount of HP a Kitchen Knife can have is 10. NOTE! It is possible to find a Kitchen Knife within the game possessing less than the maximum HP. The "ConditionLowerChanceOneIn" means that the Kitchen Knife has a 1/2 chance of lowering the "ConditionMax" by 1 point when it is used.

This mod works by completely removing the "ConditionLowerChanceOneIn" line. This means that every time a weapon is used, the check to lower the HP of the weapon is never rolled, thus, the weapon becomes indestructible.
Last edited by Sanakan; 5 Nov, 2023 @ 5:04pm