Project Zomboid

Project Zomboid

68 ratings
Fix "Rip Clothing" Character Corruption
4
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
229.668 KB
16 Nov, 2023 @ 12:11pm
18 Nov, 2023 @ 8:48pm
4 Change Notes ( view )

Subscribe to download
Fix "Rip Clothing" Character Corruption

Description
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
19 Comments
Alyx 4 Jul @ 3:48pm 
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 Feb @ 5:38am 
这是做什么的 可以查看其他mod冲突吗
jeetrix 28 Dec, 2024 @ 3:17am 
ty
Chertolet 15 Dec, 2024 @ 2:45am 
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 Dec, 2024 @ 12:47pm 
Ran into this same issue on my current save. I favorited rip clothing, reloaded, and bam I'm a NoneNone.
Trigg  [author] 7 Dec, 2024 @ 6:37am 
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 Dec, 2024 @ 4:39am 
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?
Drryst 19 Jul, 2024 @ 5:36am 
The modlist is "cleaned" after i removed some mods trying to fix it. Try adding the mod AuthenticZ that isnt in the list right now. After that i tried to add rip clothing to favorites and it caused the crash. But its possible that i removed any other mod that was also affecting.
Actually, these 3 mods were in the original list also if i think about it
-Militek clothing
-Militek vehicle skins
-AuthenticZ

The thing about the save is that i replaced the players.db with a db from a different save, to see if i could replicate the error, and it kept happening. So i can give the save but its not gonna be the exact same that i had the error with sadly
Trigg  [author] 18 Jul, 2024 @ 6:07pm 
I went through your modlist and downloaded almost all of them, and was unable to cause a corruption in an obvious way.
Removing this mod, however, does immediately let the corruption happen.

Are you sure the mod is active? Zomboid seems to load the saved modlist of an existing save regardless of changes done in the main screen.
Send me a friend request if you'd like me to take a look at your corrupted save without having to upload it in a public place.
Drryst 18 Jul, 2024 @ 5:28am 
this is the modlist, sadly i cleaned it and removed a lot of mods last night, but if i remember correctly, the only clothing mod i removed was AuthenticZ, because it seemed that added way to many clothings. The rest are mods not related to clothes, like ammo drops from zombies, better walls and stuff like that

https://pastebin.com/7uhLSW1m