Project Zomboid

Project Zomboid

74 arvostelua
Fix "Rip Clothing" Character Corruption
4
2
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Tiedostokoko
Julkaistu
Päivitetty
229.668 KB
16.11.2023 klo 12.11
18.11.2023 klo 20.48
4 muutosilmoitusta ( näytä )

Tilaa ladataksesi
Fix "Rip Clothing" Character Corruption

Kuvaus
When you favorite a recipe, the game saves the recipe name, outputs, and all possible ingredients to an identifier string on your character's save file.
If you have too many mods that add clothing items, the recipe to rip clothing can generate a string larger than 32767 bytes, which makes the game unable to load your save file, if you set it as a favorite recipe.
This generates an error on the log such as
java.lang.RuntimeException: invalid lua table type 99

This mod runs every identifier string through a simple hashing algorithm, which makes sure each identifier is of a predictable size, and, most importantly, smaller than 32767 characters. Your save file might even shrink by a couple Kb.
There will be a performance hit from running the algorithm, no clue how much though.


You should be able to safely add and remove this mod from a running save, and you should only lose your favorite recipes.
Note that this does not fix an already corrupted character.

This mod appends to the
ISCraftingUI:getFavoriteModDataString
method. If any other mod overwrites it, simply move this one later in the load order and it should keep working.

I've made a bug report here: https://theindiestone.com/forums/index.php?/topic/69331-favoriting-the-rip-clothing-recipe-if-you-have-too-many-clothing-mods-can-corrupt-your-character-data/
This mod is just a band-aid until this is fixed.

Workshop ID: 3085491446
Mod ID: fixRipClothingCorruption
22 kommenttia
cznorton2 25.7. klo 18.10 
Strange reply but ok...
Trigg  [tekijä] 15.7. klo 11.24 
Thank you for the informative report, now I know exactly how to make it work!

...On a less ironic note, I have not tested this at all in B42 beta and it likely won't do anything at all.
Also, if you're on B41, make sure the mod is actually enabled.
cznorton2 14.7. klo 20.44 
mod doesn't work
Alyx 4.7. klo 15.48 
OMG you literaly save me! i have a big modpack testing, it works but cant load the character propely, u know the game tells you to make a new one, and your mod fix that, you my hero :8bitheart: thanks so much! :mbnyufufu:
123 2.2. klo 5.38 
这是做什么的 可以查看其他mod冲突吗
jeetrix 28.12.2024 klo 3.17 
ty
Chertolet 15.12.2024 klo 2.45 
It seems that it was the common sense mod, so this patch had nothing to do with it in the first place
Come and See 10.12.2024 klo 12.47 
Ran into this same issue on my current save. I favorited rip clothing, reloaded, and bam I'm a NoneNone.
Trigg  [tekijä] 7.12.2024 klo 6.37 
The patch I did shouldn't be specific to just clothing, so if food cans are causing a similar problem then it must be something somewhere else; I'd need a save file to look for it, though.

Really, the root cause of the issue lies in the Java part of the code, which can't be patched with mods as far as I know.
Chertolet 7.12.2024 klo 4.39 
For me there is also the same stuff going on with cans of food, no matter if they require an opener or no. It fixed the bug with clothing for me, but doesn't help with cans. Any idea on how to fix that without disabling all food mods as they didn't use to cause the bug before?