Jump to content

Workshop Food gets placed in a unique container - Possible?


Zorkaz

Recommended Posts

Just a thought but it might prove useful:

 

Settlement food gets normally transfered to the workbench container.

Has anyone ideas how to get settlement food transferred to a unique container?

 

Link to comment
Share on other sites

If your into hacking base game scripts then

 

WorkshopScript.psc Line 717 ObjectReference containerRef = GetContainer()

WorkshopParentScript.psc Line 2846 ObjectReference containerRef = workshopRef.GetContainer()

 

Or register a script for each workshop WorkshopDailyUpdate, snapshot the starting resources, when it finishes count the resources and trasnfer out the difference.

 

Or use the Global Stash off the shelf solution that removes everything from workshops already.

Link to comment
Share on other sites

Changing the main script isn't a solution of course. I then thought of a scripted container that checks if a second container has items in it and grabs them. But so far I haven't gone too deep with it.

 

 

Thing is the main workshop should be out of reach, it's contents too. (That's why there's no crafting option in the Settlement Menu)

Link to comment
Share on other sites

If your objective is to constantly clear the contents of a container to another container the most elegant solution is to put a redirect on the source container rather than remote polling from the destination container.

 

That involves attaching a simple script to the source container that looks like this;

Event OnInit()
   Self.AddInventoryEventFilter(akFilter = None)
EndEvent

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
   Self.RemoveAllItems(akTransferTo  = THEOTHERCONTAINER, abKeepOwnership = false) ;slower but safer
   ;Self.RemoveItem(akBaseItem, aiCount = aiItemCount, abSilent = true, akOtherContainer = THEOTHERCONTAINER) ;faster but less robust
EndEvent

RemoveAlltems is slower but more robust than RemoveItem as OnItemAdded events can be missed during high script system load in settlements which causes stuff to get "stuck" in the source container. Hot info as I am publishing a solution today based on this mechanism.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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