Jump to content

FO4: WorkshopParentScript is losing data


Sclerocephalus

Recommended Posts

I had this bug already occurring in an older playthrough which I abandoned eventually because iI had the impression that it had become borked, but now it occurred again in a relatively fresh playthrough with only 40 hours real time invested: the workshop log reports that a workshop location (a valid location !) could not be found in the workshop locaction array. The last time this happened it was Starlight Drive-In, and now it is Outpost Zimonja:

[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]------------------------------------------------------------------------------ 
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]	Vendor income: 
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]------------------------------------------------------------------------------ 
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]		Productivity mult: +0.850000
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] found linked workshop [workshopscript < (0009B1F1)>]
[07/27/2016 - 06:10:06PM]  GetLinkedPopulation: ERROR - workshop location [Location < (00055402)>] not found in workshop location array
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] found linked workshop [workshopscript < (0006F5C5)>]
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] found linked workshop [workshopscript < (0009B1AC)>]
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] found linked workshop [workshopscript < (0001D0E2)>]
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] found linked workshop [workshopscript < (00054BAE)>]
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] total linked population=32.000000
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]		Linked population: +32.000000
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]		Total population: +44.000000
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] found linked workshop [workshopscript < (0009B1F1)>]
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] productivity=0.737500
[07/27/2016 - 06:10:06PM]  GetLinkedPopulation: ERROR - workshop location [Location < (00055402)>] not found in workshop location array
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] found linked workshop [workshopscript < (0006F5C5)>]
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] productivity=0.700000
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] found linked workshop [workshopscript < (0009B1AC)>]
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] productivity=0.700000
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] found linked workshop [workshopscript < (0001D0E2)>]
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] productivity=0.625000
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] found linked workshop [workshopscript < (00054BAE)>]
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] productivity=0.865000
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>] total linked population=24.807499
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]		Linked population (productivity adjusted): +24.807499
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]		Total vendor population: 35.007500
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]		Base income: +4.000000
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]		Population bonus: +4.200900
[07/27/2016 - 06:10:06PM]  [workshopscript < (001654D5)>]		VENDOR INCOME: 9

WorkshopParentScript has a sanity check for this happening, so the error never appears on the papyrus log. It is only displayed on the workshop log (i.e. you won't  see it happening unless you add a line to the wsTrace function of WorkshopParentScript to make sure that the log gets (re)opened and recompile the workshop scripts in debug mode), so it may go largely unnoticed. The current in-game implication is that the location that throws the error is disregarded in the subsequent calculation which then returns wrong values for the linked population and the vendor income (but this may go largely unnoticed either).

 

What's worse however is that the location is missing at all. WorkshopParentScript holds two important arrays: one is the workshop array (with the references of all workbenches), the other is the workshop location array with the corresponding locations. The index at which a workbench appears in the workshop array is the same as the index of its parent location in the workshop location array. Both arrays are filled when WorkshopParentScript runs its initialization procedure and none of them is ever modified again (except when a new workshop is added, either by a DLC or a mod: ithis is handled by a specific function that has to be called by the respective add-on). All functions that access them only read the data (and all those functions are on WorkshopParentScript; no external script is accessing the arrays directly).

 

How this could happen is a complete mystery to me (well ... that's not new either; it's also still a mystery to me how the damage helper markers of two razorgrains at Finch Farm could end up.as invisible crops at Abernathy Farm after UFO4P 1.0.3 fixed them by properly linking them to their workshops ...)

Link to comment
Share on other sites

:wallbash:

 

It's a stupid bug on WorkshopParentScript:

int linkedWorkshopID = WorkshopLocations.Find(linkedLocations[index])
if linkedWorkshopID > 0
   :
   :
else
   wsTrace("GetLinkedPopulation: ERROR - workshop location " + linkedLocations[index] + " not found in workshop location array", 2)
endif

Array index 0 is interpreted as "not found in array" ...

Link to comment
Share on other sites

Well that's special :P At least it's an easy fix for what seemed like a pretty bizarre problem.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...