Welcome to the AFK Mods bug tracker. In order to report an issue, please select a project from the drop down menu below. Select “Open New Issue” and fill out the form with as many details as possible.

An account will be required to submit an issue, so if you need one and are unable to register, please contact us via the forums at https://afkmods.iguanadons.net/

Issue Data
Status: Closed
Issue Type: Bug Report
Project: Unofficial Fallout 4 Patch
Component: Fallout 4: Vanilla
Category: Papyrus
Assigned To: Sclerocephalus
Platform: All
Severity: Low
Votes: 0
Watching: N/A
Opened By Sclerocephalus on Mar 31, 2017 8:58 am
Last Edited By Arthmoor on May 8, 2017 4:58 pm
Closed By Arthmoor on May 8, 2017 4:58 pm
Resolution: Fixed
Comment: Fixed for UFO4P 2.0.1.

Issue #22251: WorkshopParentScript - issue with transferring resources from linked workshops

This is handled by the TransferResourcesFromLinkedWorkshops function which is called by the daily updates (on WorkshopScript) whenever the resources of a workshop (i.e. the sum of daily production and stored resources) is not sufficient to feed the settlers. The daily updates then calculate the differences and pass them as NeededFood and NeededWater to the TransferResourcesFromLinkedWorkshops function.

This function fills all linked workshops (i.e. any workshops connected to the affected workshop by a supply line) in an array, then loops through that array and checks all workshops to get the needed items.

The problem is that the vanilla script doesn't keep track of how many items are transferred, but instead tries to transfer the needed amounts from all workshops in that array. This has two unwanted side effects:

(1) The affected workshop may end up with significantly more food and water in its workbench than needed, and it the worst case, the number of stored items may temporarily exceed the limts beyond which the scripts disallow further production. Simply speaking, the workshop may stop producing for a while although the settlers are starving.
(2) If there's more than one starving workshop in the linked workshop array, resources are permanently swapped forth and back without any need.

In addition, the script wastes performances in that it always loops through the full array even when the job might have been done already after a few linked workshops have been checked (although the gain is admittedly probably minor).