Project Zomboid

Project Zomboid

Fix NaN Nutrition Stats
38 Comments
SocietysGone Jul 5 @ 11:54pm 
didnt work for me
podpivas Mar 19 @ 11:25am 
dont work
小人物 Mar 19 @ 6:48am 
This BUG kept bothering me all night until I found this MOD. Thanks a lot.
Catasu Feb 27 @ 5:12pm 
worked great, thanks a lot friend
.HeXaGoN. Feb 25 @ 11:50pm 
Thank you!
可疑的火星人 Feb 16 @ 7:16pm 
This mod perfectly resolved my issue. Thank you so much!
Barc Feb 14 @ 5:45pm 
just what i needed, cant be arsed to go into debug mode and mess around
technological_tv Feb 14 @ 3:17pm 
you might be the goat for this one
Vorshim  [author] Feb 14 @ 3:15am 
yes Jack! They theoretically fixed it in version 42.3.1...
Jack Crimson Feb 13 @ 9:46pm 
The bug with the nan nutrition stats are still reproducible when fully emptying a bottle of water through drinking, and it also occurs even in a new game. I was able to prevent the bug to occur by drinking water before my character reaches 50 percent thirst. And then refilling the container again in order to avoid emptying it. So it has something to do with emptying a fluid container through drinking, probably.
Vorshim  [author] Feb 13 @ 8:16am 
What I can suggest or hypothesize is that if you're playing on a save where those stats were previously bugged as NaN, even after restoring them with my mod or simply reopening the game in debug mode and resetting them, it might not have been enough.

Maybe the updateWeight function got stuck, and the only solution is to either start over (or die). Or, as I mentioned, it could simply be a bug in patch 42.3. You should try creating a new game or dying to see if the issue persists.

If it stops happening, then the save was likely corrupted. If it still happens, then it's a bug from 42.3 (or 42 in general), and unfortunately, we'll just have to wait for a fix
Vorshim  [author] Feb 13 @ 8:06am 
You even said it yourself,you removed my mod, and the weight is still increasing. That only confirms that my mod isn’t the cause of the issue.

I don’t mean to dismiss your concern, but it seems like a bit of a rushed assumption to blame this mod. There might be another factor at play—maybe another mod or a change in the game itself. Let me know if I can help figure it out! 😊
Vorshim  [author] Feb 13 @ 8:03am 
I'm sorry, Anamijå, but it must be either another mod you have installed or simply the latest patch 42.3.0 that changed something (maybe another bug).

My mod was fixing a simple bug related to the right-click option "Refill bottle from Sink" in combination with autodrink. Now, the fix has been included in 42.3.1, so I removed it from the mod, meaning you don’t need to install it anymore.

It doesn’t do anything anymore, basically—unless your stats are bugged. The only thing this mod does now is check, after loading the game, if your stats were bugged (NaN) and restore them.

So, I’m sorry, but this mod has nothing to do with it. But thanks for asking!
Anamijå Feb 13 @ 7:29am 
hey when i used your mod i noticed that my character was gaining weight all the time, even when i took your mod out it didn't help, i've gained 3kg now and i've hardly eaten anything. i've had your mod out for two in game days now and the weight is only going up. i've already seen in the comments that i'm probably not the only one, so i'm sure it's because of this mod.
Hy Feb 13 @ 1:00am 
Thanks a lot
hoshie Feb 13 @ 12:50am 
o7
Vorshim  [author] Feb 13 @ 12:28am 
Yeah! They just drop an update for just this bug 😂😅 but unfortunately if you have already stats bugged you will continue to have it so install this mod. Load a game so it will fix your stats and then disable my mod. Thanks Sick Boy.
I will leave this mod online for one week I think
lai_wei1986 Feb 13 @ 12:26am 
good job.
Sick Boy Feb 13 @ 12:19am 
In case anyone needs this, The Indie Stone's recent update doesn't fix an existing save having Nutrition disabled. However installing this mod re-enabled nutrition on a save that had it disabled from the original bug.

(I tested disabling this mod AFTER it re-enabled my Nutrition, and it's still enabled, so you don't need to keep the mod enabled, just activate it, load the game, and then exit and deactivate.)
Olboy Feb 12 @ 11:24pm 
Love you too bby
ash_williams Feb 12 @ 10:22pm 
42.3.1 fixed
Metal Izanagi Feb 12 @ 9:46pm 
Looks like TIS just put out the hotfix for this issue, before I even had a chance to use the bugfix T_T

Thank you for this, though!
Dumbledood Feb 12 @ 6:31pm 
Nevermind, not sure if either mod did the trick! Sorry for the spam. But after being very hungry for a day and a half, he's now stable at 85.
Dumbledood Feb 12 @ 6:20pm 
That didn't work. Installed the other mod down below in the comments to see if that would stop the weight gain, but it didn't either. Any idea what might be going on?
Agaia Feb 12 @ 6:19pm 
Working great. Thank you! :D
Dumbledood Feb 12 @ 6:13pm 
Maybe I missed the update, gonna try re-subscribing.
Dumbledood Feb 12 @ 6:10pm 
Or am I just still getting fat? He's at 85 kg now with a positive chevron ^^
Dumbledood Feb 12 @ 6:08pm 
My character seems to be gaining weight while being very hungry even after installing this. I wanted to gain weight, and was eating fishy meals, so thought it was actually happening, but now I'm not sure. He's weak with hunger, so I don't think he should still be gaining weight.
MrTea Feb 12 @ 4:40pm 
bless u sir
MeanSmoker Feb 12 @ 2:45pm 
thanks goat
Vorshim  [author] Feb 12 @ 2:14pm 
yes! it works with existing saves! ;)
Hy Feb 12 @ 1:59pm 
Does this mod work on existing saves as well? Thanks for the great bug-fix mod!
Vorshim  [author] Feb 12 @ 1:21pm 
No problem. just let me know if you need something ;)
Anamijå Feb 12 @ 12:41pm 
thanks for the clarification. i'll give your mod a try.
Vorshim  [author] Feb 12 @ 12:31pm 
<3 exactly! thanks!!!
Schmootle Feb 12 @ 12:22pm 
Thank you modder! This fixed the bug for me. I'll post here if I experience any issues using it in b42.3

Be sure to enable the mod for your save when loading an existing world. If you have the bug already, it will reset Proteins, Carbs, and Lipids back to zero.
Vorshim  [author] Feb 12 @ 12:06pm 
That's not a real fix. That mod just sets protein and calories to 0 when they get bugged (NaN). My mod actually prevents those stats from becoming NaN in the first place.

My mod specifically fixes the autodrink issue that causes this bug. I just forgot to make it restore the stats on startup for players who have already started a game and encountered the bug—I'll add that now.
Thanks for letting me know anyway!
Anamijå Feb 12 @ 11:44am