Jump to content

Access the workshop menu


Zorkaz

Recommended Posts

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

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

  • Recently Browsing   0 members

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