SKKmods Posted April 18, 2024 Posted April 18, 2024 Nope if it has a construction recipe that allow it to be built or moved it can always be stored. My workaround is for the main object that can be constructed once (recipie condition GetWorkshopObjectCount == 0) to detect workshop mode and swap itself out for the workshop movable proxy object that uses the same NIF, then manage that; ;******************************************************************************************** Event OnLoad() Self.RegisterForRemoteEvent(Self.GetLinkedRef(pWorkshopItemKeyword), "OnWorkshopMode") EndEvent ;******************************************************************************************** Event ObjectReference.OnWorkshopMode(ObjectReference akSender, bool aStart) If(aStart == true) Self.Disable() ObjectReference MyProxy = Self.PlaceAtMe(pMyProxyObject) Self.SetLinkedRef(MyProxy, None) Else ObjectReference MyProxy = Self.GetLinkedRef(None) Self.SetLinkedRef(None, None) If(MyProxy != None) && (myProxy.is3dloaded() == true) ; it has not been stored Self.MoveTo(MyProxy) MyProxy.Disable() MyProxy.Delete() EndIf Self.Enable() EndIf EndEvent ;********************************************************************************************
worm82075 Posted April 18, 2024 Author Posted April 18, 2024 Hmmm, lets approach this from another angle. I don't really want to prevent storage but the build conditions do not apply to placement of an object that is already built. When limiting a single object to one per settlement the build condition need not check storage for an instance of itself because we would have to place the existing one in order to build another. However if you have 4 different objects that you only want to allow one of simply building one and storing it will allow you to build one of the others and then place both of them. Is it even possible to query the current workshop inventory for specific items? I think the only way I am going to be able to limit the workshop to only 1 of 4 different objects is by tracking all of the object placements with a quest script. Unfortunately for me, even after 18 years in this community I'm still not ready to learn how to write entire scripts from scratch. Especially for FO4 as i just moved over from Skyrim 8 months ago and opened the render window for the first time yesterday. Thanks anyway.
SKKmods Posted April 19, 2024 Posted April 19, 2024 Use condition GetWorkshopObjectCount on each of the objects to construct exclusion and inclusion recipe logic.
LarannKiar Posted April 19, 2024 Posted April 19, 2024 (edited) On 4/18/2024 at 11:52 PM, worm82075 said: Hmmm, lets approach this from another angle. I don't really want to prevent storage but the build conditions do not apply to placement of an object that is already built. When limiting a single object to one per settlement the build condition need not check storage for an instance of itself because we would have to place the existing one in order to build another. However if you have 4 different objects that you only want to allow one of simply building one and storing it will allow you to build one of the others and then place both of them. Is it even possible to query the current workshop inventory for specific items? Expand I don't think you can query "Items stored in the Workbench." in vanilla Papyrus or through a Condition function. (It gave me the idea to make some custom functions for them though ) Form[] Function GetWorkshopStoredForms(ObjectReference akWorkshopRef) native global Int[] Function GetWorkshopStoredFormsCount(ObjectReference akWorkshopRef) native global I can write a simple Quest script function later for a Condition e.g. GetGlobalValue check to detect whether you have a stored item but I'll need to test these functions more first.. Edited April 19, 2024 by LarannKiar 1
Recommended Posts