Hi!. I have a doubt about something to execute from papyrus. I would like to open the industrial workbench menu from an item that had been added to the player's inventory. I though using the .Activate from ObjectReference of a workbench added in a cell and called from a quest script would work.. but nope. this is the code I am using. (Thanks LarannKiar for the initial help on this topic)
Form Property ItemToOpenWorkbench Auto Const
ObjectReference Property ItemToOpenWorkbenchRef Auto Const
ObjectReference Property WorkbenchRef Auto Const
Event OnQuestInit()
Actor PlayerRef = Game.GetPlayer()
PlayerRef.AddItem(ItemToOpenWorkbenchRef, 1, False)
RegisterForRemoteEvent(Game.GetPlayer(), "OnItemEquipped"); when the Player equips the item
EndEvent
Event Actor.OnItemEquipped(Actor akSender, Form akBaseObject, ObjectReference akReference) ; event received
Actor PlayerRef = Game.GetPlayer()
PlayerRef.UnequipItem(ItemToOpenWorkbench, False, True)
If akSender == PlayerRef && akBaseObject == ItemToOpenWorkbench; check sender and the equipped item
Debug.ExecuteConsole("HideMenu InventoryMenu"); hide the menus
Debug.ExecuteConsole("HideMenu DataMenu")
Utility.Wait(1.0); wait until they are closed
Debug.Notification(WorkbenchRef as string)
bool bRun = WorkbenchRef.Activate(PlayerRef); activate the workbench reference to open the associated menu
Debug.Notification(bRun as string)
EndIf
EndEvent
I got the debug notification with the workbench ref and true of the activation.
The workbench is in a Cell to able get the reference from papyrus