Jump to content

Help with script to fix stuck hardcore need meters.


jimnms

Recommended Posts

I'm playing a heavily modded game that adds a lot of new quests, and it has been and is going to be a very long game. I just finished Honest Hearts and my food, hunger and sleep meters do not increase in real time anymore. Sleeping, waiting or fast traveling will advance them, but after that they immediately stick again. I don't remember having this problem in previous play throughs, but I just may not have noticed it or I got lucky. It appears to be a common problem based on what I found when searching for a solution, and it's documented on the Fallout wikis.

 

This is bothering me, so I've spent the past two days trying to find and a fix for it. I found two mods that claimed to fix it, but they don't work (one just kills me on the spot). Those two mods fix the "bug" when starting DLC and finishing DLC where your sleep gets set to -10000 and causes them to get stuck, but they gave me an idea to poke around at the values. I knew about the actorvalue (getav), but I did not know there was a different permanentactorvalue variable. I checked the values and they were off, so I manually zeroed all of them (which is pretty much what those mods do). This still didn't fix the problem, the meters remained stuck, only increasing after sleeping, waiting or fast traveling.

 

Then I remembered another post I found while searching (that I can't seem to find again) where someone said there was a bug in the GetDaysPassed variable that cropped up after it went higher than 64. I checked my GameDaysPassed variable and it's 83.XXXX. After checking the GameDaysPassed variable, I let the game sit for a few minutes, then checked again and it had not advanced, so it's stuck like the needs values are stuck.

 

I set the GameDaysPassed variable to 1, saved and restarted, and now the needs meters are increasing as they should and checking the GameDaysPassed variable every few minutes, it also is increases in real time. I reloaded the save where the GameDaysPassed is 83.XXXX and stuck, then added 0.1 to the variable and the needs meters increased with it, so the needs variables do increase with GameDaysPassed variable.

 

TL;DR

 

Since GameDaysPassed is what is getting stuck, fixing that will take care of the needs meters. Setting GameDaysPassed to 1 will fix the needs meters, but this will probably break quests and scripts that read and stored this variable at some point. Although the value is not increasing in real time, the game is still tracking it, but it doesn't apply the time passed to it until you do something like sleep, wait, fast travel or load a save, then it increases it. Are there any commands that will force the game to update the GameDaysPassed variable? If so, then a simple fix would be to make a script that runs every few minutes to kick the game and force GameDaysPassed to update.

 

EDIT:

I managed to create a stupid simple script that fixes it. It takes a snapshot of the GameDaysPassed variable, then compares it to the current GameDaysPassed variable on the next run. If the snapshot is equal to the current GameDaysPassed, it increases GameDaysPassed using the GetSecondsPassed variable (after adjusting it to the TimeScale and then converting it to days), then takes a new snapshot and repeats. If for some reason GameDaysPassed increases on its own, it just takes a new snapshot and waits. I'm not a scripting expert, so this is probably a crude and inefficient solution. There is probably a better way to do it, but no one (to my knowledge) has done it yet.

 

I tested it quite a bit today and I'm confident it works, so I'm going to go ahead and throw it up on NexusMods.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...