weefbellington
New Member
- Messages
- 5
Summary
The WorkshopScript#RelinkWorkshopActors() script calls GoToState("RelinkingActors") on function entry and GoToState("Initialized") on exit.
RelinkWorkshopActors() calls GetWorkshopActors() in its function block. In the "RelinkingActors" state, the GetWorkshopActors() function waits continuously for the state to change before proceeding. I suspect that this is causing a deadlock. RelinkWorkshopActors() will not change the state from to "RelinkingActors -> "Initialized" until GetWorkshopActors() returns, but GetWorkshopActors() is waiting forever for this to happen.
If verified, this bug could have pretty nasty implications -- it appears to be blocking the DailyUpdate() fuction.
Details
Source code:
GetWorkshopActors function
RelinkWorkshopActors function
The RelinkWorkshopActors function is triggered by the "Relink Local Settlers" option in the WSFW tools menu: papyrus fragment.
I started looking into this problem when I noticed that happiness was stuck at 50% at some settlements. There is a previous thread on this issue, opened by another user. My symptoms were the same: FallrimTools shows a large number of active scripts calling DailyUpdate() and never terminating. In my case there were ~50 of these scripts.
Each of these scripts is stuck in a waiting loop. They appear to be waiting for the DailyUpdateInProgress variable to be false.
(source code link)
There is a single active script running TryRealDailyUpdate() that looks like it is locking these other scripts. This script sets DailyUpdateInProgress to true, and ends up locking itself by calling GetWorkshopActors(), which is also locked.
(source code link)
I can see the stuck GetWorkshopActors() script too:
I think that this could be the root cause of the "happiness stuck" bug reports that pop up every once in a while on the forums. If anybody would like to help investigate, I can share save files.
I'm familiar with CK and Papyrus so I can take a shot at fixing it, but I've never worked with the WSFW source so I was hoping I could get some eyes on it. Thanks!
The WorkshopScript#RelinkWorkshopActors() script calls GoToState("RelinkingActors") on function entry and GoToState("Initialized") on exit.
RelinkWorkshopActors() calls GetWorkshopActors() in its function block. In the "RelinkingActors" state, the GetWorkshopActors() function waits continuously for the state to change before proceeding. I suspect that this is causing a deadlock. RelinkWorkshopActors() will not change the state from to "RelinkingActors -> "Initialized" until GetWorkshopActors() returns, but GetWorkshopActors() is waiting forever for this to happen.
If verified, this bug could have pretty nasty implications -- it appears to be blocking the DailyUpdate() fuction.
Details
Source code:
GetWorkshopActors function
RelinkWorkshopActors function
The RelinkWorkshopActors function is triggered by the "Relink Local Settlers" option in the WSFW tools menu: papyrus fragment.
I started looking into this problem when I noticed that happiness was stuck at 50% at some settlements. There is a previous thread on this issue, opened by another user. My symptoms were the same: FallrimTools shows a large number of active scripts calling DailyUpdate() and never terminating. In my case there were ~50 of these scripts.
Each of these scripts is stuck in a waiting loop. They appear to be waiting for the DailyUpdateInProgress variable to be false.
(source code link)
There is a single active script running TryRealDailyUpdate() that looks like it is locking these other scripts. This script sets DailyUpdateInProgress to true, and ends up locking itself by calling GetWorkshopActors(), which is also locked.
(source code link)
I can see the stuck GetWorkshopActors() script too:
I think that this could be the root cause of the "happiness stuck" bug reports that pop up every once in a while on the forums. If anybody would like to help investigate, I can share save files.
I'm familiar with CK and Papyrus so I can take a shot at fixing it, but I've never worked with the WSFW source so I was hoping I could get some eyes on it. Thanks!