mikvat Posted July 25, 2022 Author Posted July 25, 2022 1. Create a quest: MyMod_HandlerQuest. In the Quest Data tab, check the checkboxes of: Start Game Enabled and Run Once. Quest Prority: 0. 2. Open the Scripts tab >> Add >> New Script. Name: HandlerScript. Namespace: MyMod_Scripts. Paste this code: Scriptname MyMod_Scripts:HandlerScript extends Quest Const Quest Property DLC04DryRockGulch Auto Const {High Noon at the Gulch.} ObjectReference Property MyWorkshopWorkbenchRef Auto Const {Object Reference of your Workshop Workbench.} Event OnQuestInit() If !DLC04DryRockGulch.GetStageDone(2000) ;2000: completion stage. RegisterForRemoteEvent(DLC04DryRockGulch, "OnStageSet") Else Initialize() EndIf EndEvent Event Quest.OnStageSet(Quest akSender, int auiStageID, int auiItemID) If (akSender == DLC04DryRockGulch) && (auiStageID == 2000) UnRegisterForRemoteEvent(DLC04DryRockGulch, "OnStageSet") Initialize() EndIf EndEvent Function Initialize() MyWorkshopWorkbenchRef.SetOwnedByPlayer(true) (Self as Quest).Stop() EndFunction 3. Fill the Script properties. 4. Load your settlement, right click on your workbench (the property MyWorkshopWorkbenchRef should point to this). Scripts tab >> EnableAutomaticPlayerOwnership: set to False. Hi! Finally I had time to try this but I can´t get it to work. When I have filled in the properties I get this error message:The parent script doesn´t exist, please choose one that does I guess I am doing something wrong. Can anybody help me out?
Zorkaz Posted July 28, 2022 Posted July 28, 2022 I'd do it the dummy way:Copy the SetownedTriggerScript and alter it a little bit Quest Property DryRockGulchQuest Auto Event OnTriggerEnter(ObjectReference akActionRef) If DryRockGulchQuest.iscomplete() if akActionRef == Game.GetPlayer() WorkshopScript myWorkshop = GetLinkedRef() as WorkshopScript if myWorkshop myWorkshop.SetOwnedByPlayer(true) Delete() endif endif Endif EndEvent
LarannKiar Posted July 31, 2022 Posted July 31, 2022 1. Create a quest: MyMod_HandlerQuest. In the Quest Data tab, check the checkboxes of: Start Game Enabled and Run Once. Quest Prority: 0. 2. Open the Scripts tab >> Add >> New Script. Name: HandlerScript. Namespace: MyMod_Scripts. Paste this code: Scriptname MyMod_Scripts:HandlerScript extends Quest Const Quest Property DLC04DryRockGulch Auto Const {High Noon at the Gulch.} ObjectReference Property MyWorkshopWorkbenchRef Auto Const {Object Reference of your Workshop Workbench.} Event OnQuestInit() If !DLC04DryRockGulch.GetStageDone(2000) ;2000: completion stage. RegisterForRemoteEvent(DLC04DryRockGulch, "OnStageSet") Else Initialize() EndIf EndEvent Event Quest.OnStageSet(Quest akSender, int auiStageID, int auiItemID) If (akSender == DLC04DryRockGulch) && (auiStageID == 2000) UnRegisterForRemoteEvent(DLC04DryRockGulch, "OnStageSet") Initialize() EndIf EndEvent Function Initialize() MyWorkshopWorkbenchRef.SetOwnedByPlayer(true) (Self as Quest).Stop() EndFunction 3. Fill the Script properties. 4. Load your settlement, right click on your workbench (the property MyWorkshopWorkbenchRef should point to this). Scripts tab >> EnableAutomaticPlayerOwnership: set to False. Hi! Finally I had time to try this but I can´t get it to work. When I have filled in the properties I get this error message:The parent script doesn´t exist, please choose one that does I guess I am doing something wrong. Can anybody help me out? Sorry.. Replace this line: MyWorkshopWorkbenchRef.SetOwnedByPlayer(true) with this: (MyWorkshopWorkbenchRef as WorkshopScript).SetOwnedByPlayer(true)
Recommended Posts