Project Zomboid

Project Zomboid

Fix NaN Nutrition Stats
38 Comments
SocietysGone 5 Jul @ 11:54pm 
didnt work for me
podpivas 19 Mar @ 11:25am 
dont work
小人物 19 Mar @ 6:48am 
This BUG kept bothering me all night until I found this MOD. Thanks a lot.
Catasu 27 Feb @ 5:12pm 
worked great, thanks a lot friend
.HeXaGoN. 25 Feb @ 11:50pm 
Thank you!
可疑的火星人 16 Feb @ 7:16pm 
This mod perfectly resolved my issue. Thank you so much!
Barc 14 Feb @ 5:45pm 
just what i needed, cant be arsed to go into debug mode and mess around
technological_tv 14 Feb @ 3:17pm 
you might be the goat for this one
Vorshim  [author] 14 Feb @ 3:15am 
yes Jack! They theoretically fixed it in version 42.3.1...
Jack Crimson 13 Feb @ 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] 13 Feb @ 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] 13 Feb @ 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] 13 Feb @ 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å 13 Feb @ 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 13 Feb @ 1:00am 
Thanks a lot
hoshie 13 Feb @ 12:50am 
o7
Vorshim  [author] 13 Feb @ 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 13 Feb @ 12:26am 
good job.
Sick Boy 13 Feb @ 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 12 Feb @ 11:24pm 
Love you too bby
ash_williams 12 Feb @ 10:22pm 
42.3.1 fixed
Metal Izanagi 12 Feb @ 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 12 Feb @ 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 12 Feb @ 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 12 Feb @ 6:19pm 
Working great. Thank you! :D
Dumbledood 12 Feb @ 6:13pm 
Maybe I missed the update, gonna try re-subscribing.
Dumbledood 12 Feb @ 6:10pm 
Or am I just still getting fat? He's at 85 kg now with a positive chevron ^^
Dumbledood 12 Feb @ 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 12 Feb @ 4:40pm 
bless u sir
MeanSmoker 12 Feb @ 2:45pm 
thanks goat
Vorshim  [author] 12 Feb @ 2:14pm 
yes! it works with existing saves! ;)
Hy 12 Feb @ 1:59pm 
Does this mod work on existing saves as well? Thanks for the great bug-fix mod!
Vorshim  [author] 12 Feb @ 1:21pm 
No problem. just let me know if you need something ;)
Anamijå 12 Feb @ 12:41pm 
thanks for the clarification. i'll give your mod a try.
Vorshim  [author] 12 Feb @ 12:31pm 
<3 exactly! thanks!!!
Schmootle 12 Feb @ 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] 12 Feb @ 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!