MesaSolar Posted April 28, 2022 Author Share Posted April 28, 2022 Ok so I have my custom settlement in place. It adds the NPC's to the workshop and adds the player to the workshop after a certain dialogue line, but now when I go to talk to the quest giver to get the 1st beds objective it defaults to "I want to trade a few things" then opens that NPC's inventory. Even though I have my dialogue set with a getstage condition in the scene. I can move the line for player ownership to later, but I need to come back to this NPC for the other objectives. Link to comment Share on other sites More sharing options...
LarannKiar Posted April 29, 2022 Share Posted April 29, 2022 when I go to talk to the quest giver to get the 1st beds objective it defaults to "I want to trade a few things" then opens that NPC's inventory. Even though I have my dialogue set with a getstage condition in the scene. Set your quest's priority higher than the priority of the quest WorkshopVendorGreetingsGeneric (so higher than 20). Link to comment Share on other sites More sharing options...
MesaSolar Posted April 30, 2022 Author Share Posted April 30, 2022 Thanks LarannKiar! That worked. Now I'm on to the really tricky part. Getting the game to recognize when I build something in the settlement and setting the appropriate quest stage. Under the workshop objectives property, I set my custom global variables under current count, max count and percent complete.Index of 50, Start stage 50, Done stage 60, rating index of 3 (for 3 beds) My quest stage 50 papyrus fragment looks like this: where kmyQuest refers back to Min01Script. SetObjectiveCompleted(40)SetObjectiveDisplayed(50) ; initialize bed countkmyQuest.InitializeBedsObjective() Quest Objective reads: Build sheltered beds for Tea Party settlers (<Global=APWQuest07BedPercent>%) Here's the custom script that I modeled after Min01Script: Scriptname APW:APWQuest07Script extends WorkshopEventsQuestScript Conditional bool initialized = false bool bAllObjectivesComplete = false Conditional;WorkshopEventsQuestScript myWorkshopEvents ; called once by startup stagefunction InitializeQuest()if initializedreturnendif ;myWorkshopEvents = (self as Quest) as WorkshopEventsQuestScript endFunction ; call when starting beds objective to check for beds already madefunction InitializeBedsObjective()float beds = GetBedsRating()debug.trace(self + " InitializeBedsObjective: starting beds=" + beds)if beds > 0WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript); check if everything is complete alreadyHandleWorkshopEvent()endifendFunction ; call when starting water objective to check for water already madefunction InitializeWaterObjective()float water = GetWaterRating()debug.trace(self + " InitializeWaterObjective: starting water=" + water)if water > 0WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript); check if everything is complete alreadyHandleWorkshopEvent()endifendFunction ; call when starting food objective to check for food already madefunction InitializeFoodObjective()float food = GetFoodRating()debug.trace(self + " InitializeFoodObjective: starting food=" + food)if food > 0WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript); check if everything is complete alreadyHandleWorkshopEvent()endifendFunction ; call when starting food objective to check for food already madefunction InitializeSafetyObjective()float safety = GetSafetyRating()debug.trace(self + " InitializeSafetyObjective: starting safety=" + safety)if safety > 0WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript); check if everything is complete alreadyHandleWorkshopEvent()endifendFunction function HandleWorkshopEvent()WorkshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript ; wait for recalc to finishworkshopRef.WaitForWorkshopResourceRecalc() ; if all objectives are complete, then set completion variablebool allComplete = true int i = 0while (i < WorkshopObjectives.Length) && allCompleteWorkshopParentScript:WorkshopObjective theObjective = WorkshopObjectivesif IsObjectiveCompleted(theObjective.index) == falseallComplete = falseendifi += 1endWhilebAllObjectivesComplete = allCompleteendFunction float function GetBedsRating()return WorkshopParent.GetRating(Alias_Workshop.GetRef() as WorkshopScript, WorkshopParent.WorkshopRatingBeds)endFunction float function GetPowerRating()return WorkshopParent.GetRating(Alias_Workshop.GetRef() as WorkshopScript, WorkshopParent.WorkshopRatingPower)endFunction float function GetWaterRating()return WorkshopParent.GetRating(Alias_Workshop.GetRef() as WorkshopScript, WorkshopParent.WorkshopRatingWater)endFunction float function GetFoodRating()return WorkshopParent.GetRating(Alias_Workshop.GetRef() as WorkshopScript, WorkshopParent.WorkshopRatingFood)endFunction float function GetSafetyRating()return WorkshopParent.GetRating(Alias_Workshop.GetRef() as WorkshopScript, WorkshopParent.WorkshopRatingSafety)endFunction ;ReferenceAlias Property Alias_Workshop Auto Const Location Property APWWDLDMadTeaPartyLocation Auto Const ;WorkshopParentScript Property WorkshopParent Auto Const GlobalVariable Property APWQuest071BedCount Auto ConstGlobalVariable Property APWQuest071BedTotal Auto ConstGlobalVariable Property APWQuest07BedPercent Auto Const GlobalVariable Property APWQuest07WaterCount Auto ConstGlobalVariable Property APWQuest07WaterTotal Auto ConstGlobalVariable Property APWQuest07WaterPercent Auto Const GlobalVariable Property APWQuest07FoodCount Auto ConstGlobalVariable Property APWQuest07FoodTotal Auto ConstGlobalVariable Property APWQuest07FoodPercent Auto Const That's all I could find to do from the original Min01 quest, but when I build sheltered beds the percentage in the pip boy doesn't change at all and the quest doesn't progress. So what am I missing here? Appreciate the help! Link to comment Share on other sites More sharing options...
MesaSolar Posted May 5, 2022 Author Share Posted May 5, 2022 Found one thing that I was missing. Adding kmyquest.initializequest() to stage 10 (my start up stage) but that didn't seem to help either. I see the appropriate objective at stage 50, but when I build the sheltered beds nothing happens. I can manually set stage 60 with the console, but can't get the quest to progress on its own. Has anyone here ever tried to duplicate this quest type before? I'm kinda stuck for now and can't continue working on this mod till I solve this problem. Link to comment Share on other sites More sharing options...
MesaSolar Posted May 7, 2022 Author Share Posted May 7, 2022 Tried one more thing. adding a setstage command in the quest script. But it didn't work either. ; call when starting beds objective to check for beds already madefunction InitializeBedsObjective()float beds = GetBedsRating()debug.trace(self + " InitializeBedsObjective: starting beds=" + beds)if beds >=3APWquest07.SetStage(60) WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript); check if everything is complete alreadyHandleWorkshopEvent()endifendFunction Then my stage 50 looks like this: SetObjectiveCompleted(40)SetObjectiveDisplayed(50); start receiving workshop build eventskmyQuest.RegisterForWorkshopEvents(); initialize bed countkmyQuest.InitializeBedsObjective() Running out of ideas here. Essentially the problem is that the game doesn't recognize when I've built sheltered beds at the workshop location and therefore is not advancing the quest. I can't find any discrepancies between my quest and the vanilla Min01 quest when it comes to the workshop events so no idea how to move forward. Link to comment Share on other sites More sharing options...
MesaSolar Posted May 17, 2022 Author Share Posted May 17, 2022 Posting my solution for anyone else that runs into this problem: I ended up deleting the quest I had made from scratch and simply duplicated the Min01 quest and renamed it to match my mod. Then I created extra quest stages to accommodate my mod's requirements and pointed the dialogue to the original quest stages for the workshop objectives using the setstage options in the dialogue menu. One thing I will say is DO NOT under any circumstances delete or clear any quest stages, properties or aliases you won't be using from the original quest. It'll just crash the CK. Instead simply add in the quest stages, properties and aliases you need for your own custom quest. Hope the headache I went through helps somebody in the future. :ermm: Link to comment Share on other sites More sharing options...
Recommended Posts