Zorkaz Posted November 9, 2022 Share Posted November 9, 2022 Let's say you have a piece of workshop furniture or activator, full on with Workshopobjectscript and such... You'd have a script on it, like "Event OnActivate()"... How would one be able to access the workshop inventory to add and remove items via script? Link to comment Share on other sites More sharing options...
niston Posted November 9, 2022 Share Posted November 9, 2022 LarannKiar posted a solution some time ago.IIRC it involved dynamically removing and adding the workbench keyword, so the workbench would turn into a regular container for the duration of the scripted activation. Link to comment Share on other sites More sharing options...
Zorkaz Posted November 9, 2022 Author Share Posted November 9, 2022 Okay I thought it would include getlinkedref or something Link to comment Share on other sites More sharing options...
SKKmods Posted November 9, 2022 Share Posted November 9, 2022 Since the base game WorkshopWorkbench is a container, its as EZ as: ObjectReference MyWorkshop = Self.GetLinkedRef(pWorkshopItemKeyword) If (MyWorkshop != None) MyWorkshop.RemoveItem(pMyItem, aiCount = -1, abSilent = true) MyWorkshop.AddItem(pMyItem, aiCount = 1, abSilent = true) Endif Although if your working with hacked Workshops that may not be containers then add some validation; ObjectReference MyWorkshopContainer = MyWorkshop.GetContainer() If (MyWorkshopContainer != None) ; stuff Endif Link to comment Share on other sites More sharing options...
Zorkaz Posted November 9, 2022 Author Share Posted November 9, 2022 Okay thanks. I thought it would get more complicated since there is an external container most of the times Link to comment Share on other sites More sharing options...
SKKmods Posted November 9, 2022 Share Posted November 9, 2022 The external WorkshopLinkContainer is not infact used. It is a holdover from when the original WorkshopWorkbench was Furniture not a Container. Link to comment Share on other sites More sharing options...
Zorkaz Posted November 9, 2022 Author Share Posted November 9, 2022 Oh, wow okay Link to comment Share on other sites More sharing options...
niston Posted November 9, 2022 Share Posted November 9, 2022 Oh I thought you meant accessing the workshop container menu by script. Link to comment Share on other sites More sharing options...
Zorkaz Posted November 9, 2022 Author Share Posted November 9, 2022 Yeah I chose a bad title and meant something different Link to comment Share on other sites More sharing options...
Recommended Posts