Project Zomboid

Project Zomboid

Simple Weapon Durability
 Denne tråd er blevet fastgjort, så den er sikkert vigtig
Kyu  [udvikler] 20. dec. 2024 kl. 2:04
Support for Build 42 Unstable
Please post here if you're encountering issues using the B42 version of this mod.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3387749540


Support will be handled here until build 42 merges into the main branch of Project Zomboid, in which case I will merge the B42 version into this version, and this version will become the B42 version.
< >
Viser 1-15 af 23 kommentarer
Tori 7. jan. kl. 16:32 
There is an issue where the multiplier resets to default.

If I set the multiplier and load the game for the first time, the durability multiplier works fine.
But when I load the game again, the multiplier gets reset.
I tested this using only this mod.
Tori 8. jan. kl. 0:59 
There is an issue where the multiplier resets to default. B42
If I set the multiplier and load the game for the first time, the durability multiplier works fine.
But when I load the game again, the multiplier gets reset.
I tested this using only this mod.
Kyu  [udvikler] 8. jan. kl. 4:06 
According to @dhert this is a known issue for Linux users. Are you using Linux by chance?

@dhert - ”This is a known issue that has been reported to the developers. The "Save" function for the new ModOptions saves to the file "ModOptions.ini". However, the "Load" function uses file "modOptions.ini". On Windows, this would be the same file. On Linux, this is 2 different files.”

If you are on Linux then technically you could run PZ via a script and have the script rename the file prior to starting the game.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3386860561
Tori 8. jan. kl. 5:12 
No, I'm using Windows 11 not Linux.
Tori 8. jan. kl. 5:19 
There comment says it doesn't save parameter, it is a little different from my case.
My issue is the multiplier save normally, but it will be reset soon.
Tori 8. jan. kl. 5:55 
I apologize for not explaining this clearly before.
After modifying the multiplier and if i load the game, it will be applied well, but if i load the game again, the multiplier will be reset to the default value 'in the game'. However, in the mod options, the multiplier seems to be applied normally.
Kyu  [udvikler] 8. jan. kl. 7:53 
That makes sense. When you are loading the game again are you just exiting to the main menu or are you closing the game completely?
Tori 8. jan. kl. 8:38 
I tested exiting to the main menu and loading the save, but i didn't try that closing the game completely.
Sidst redigeret af Tori; 8. jan. kl. 8:58
Tori 8. jan. kl. 8:50 
I just checked both, both are having the same issue.
Kyu  [udvikler] 8. jan. kl. 9:41 
Thanks for checking. What weapon are you using to determine if the mod is working or not?
Tori 8. jan. kl. 10:46 
To verify that various weapons are tested, but since the butter knife has a base durability of 1, it is easy to test.
Sidst redigeret af Tori; 8. jan. kl. 10:46
Kyu  [udvikler] 8. jan. kl. 11:10 
I'll be testing and looking at the values when I get a chance but I would test with weapons with more durability such as the fireaxe, hammer, crowbar, etc.

This mod doesn't increase the durability of weapons, it just decreases the chance in which durability is lost. That means a butter knife, even with the multiplier at the max setting, can still break on the first swing. It just depends on your luck.
Kyu  [udvikler] 8. jan. kl. 13:27 
I'm unable to reproduce the issue. Here are my steps:

1. Launch Project Zombie.
2. Click "Continue" to resume game.
3. Dump condition lower chances to logs.
4. Exit to main menu.
5. Click "Continue" to resume game.
6. Dump condition lower chances to logs.
7. Repeat 3 more times.

Each time the logs show the condition lower chance is correct!

(Debug Simple Weapon Durability) [DUMP START].
(Debug Simple Weapon Durability) Configuration Start.
(Debug Simple Weapon Durability) Configuration: ConditionLowerChanceMultiplier=20.
(Debug Simple Weapon Durability) Configuration: IncludeMelee=true.
(Debug Simple Weapon Durability) Configuration: IncludeRanged=true.
(Debug Simple Weapon Durability) Configuration: EnableDebug=true.
(Debug Simple Weapon Durability) Configuration End.
(Debug Simple Weapon Durability) Item Name: Base.GardenForkHead.
(Debug Simple Weapon Durability) Original Values: Base.GardenForkHead=15.
(Debug Simple Weapon Durability) Current Condition Lower Chance: 300.
(Debug Simple Weapon Durability) [DUMP END].

Were you able to validate that the condition lower chance is not working on higher durability weapons such as axes, hammers, crowbars, etc.?
Tori 8. jan. kl. 20:40 
Oh sorry, i mean condition lower chance has an issue not durability.
And yes, i validated that the condition lower chance is not working on every weapons includes guns, axes, crowbars...

I followed the steps you mentioned, and while the debug shows proper values, in-game the multiplier still doesn’t apply and resets to the default value. Did you actually use the weapon yourself instead of just relying on the logs?

Let me use a butter knife as an example. The default condition lower chance for a butter knife is just 1. Now, let’s assume I adjusted it to 100 using a multiplier. This should mean that the durability decreases about once every 100 swings. However, in-game, that’s not the case. The durability still decreases after just one swing, exactly as if the default condition lower chance was applied. This issue doesn’t only happen with the butter knife—it affects all weapons in the same way.
Sidst redigeret af Tori; 8. jan. kl. 20:59
Tori 8. jan. kl. 20:42 
Here are the steps I suggest you follow:

1. Launch Project Zomboid.
2. Go to "Mod Options."
3. Adjust the Durability Multiplier.
4. Click "Continue" to resume the game.
5. Attack a zombie once with a butter knife (this time should work properly).
6. Exit to the main menu.
7. Click "Continue" to resume the game again.
8. Attack a zombie once more with the butter knife (this time it won’t work properly, it will decrease the durability).


Try these steps, and I am 100% sure you’ll find the issue.
You can test with any other weapon instead of the butter knife, but using the butter knife makes it much easier to verify.
Sidst redigeret af Tori; 8. jan. kl. 20:44
< >
Viser 1-15 af 23 kommentarer
Per side: 1530 50