Here's a simplified version of what I did in my Flourishing Salem mod, might not be the nicest solution but it definitely works..
1) Place your fake workbenches. They should be an Activator and they has to be linked to the real workbench with WorkshopItemKeyword.
Add the Activate Text "Start Workshop". Attach a script like this to the activator:
Scriptname YOURSCRIPTNAME extends ObjectReference Const
Keyword Property WorkshopItemKeyword Auto Const
Event OnActivate(ObjectReference akActionRef)
So, when you activate the activator (primary activate choice), workshop mode starts.
2) Add a perk to the Player.
Entry Point: Activate.
Function: Add Activate Choice.
Button label: TRANSFER.
Target Conditions: GetIsID "The activator you'e made above" == 1, Run on: Subject.
; Add these properties to the script:
; Keyword Property WorkshopItemKeyword Auto Const
; Keyword Property WorkshopKeyword Auto Const
; The code:
ObjectReference WorkshopRef = akTargetRef.GetLinkedRef(WorkshopItemKeyword)
If WorkshopRef && WorkshopRef.HasKeyword(WorkshopKeyword) ; HasKeyword(WorkshopKeyword) can be replaced with a Condition, run on GetLinkedRef with "WorkshopItemKeyword"
So, when you press "Transfer" (secondary activate choice), the workshop's inventory opens. (Removing the keyword WorkshopKeyword makes the workbench (the real workbench, which is linked to fake ones with WorkshopItemKeyword) a "normal" Container so, instead of workshop mode, its inventory is going to open). Utility.Wait() does nothing until you exit the inventory panel. Once you exit it, after 0.1 seconds, the WorkshopKeyword will be added back to the workbench).
Edited by LarannKiar, 25 August 2022 - 10:35 AM.