Jump to content

Copying Min01 quest (Sanctuary)


Recommended Posts

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

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

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 count
kmyQuest.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 stage
function InitializeQuest()
if initialized
return
endif
;myWorkshopEvents = (self as Quest) as WorkshopEventsQuestScript
endFunction
; call when starting beds objective to check for beds already made
function InitializeBedsObjective()
float beds = GetBedsRating()
debug.trace(self + " InitializeBedsObjective: starting beds=" + beds)
if beds > 0
WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript)
; check if everything is complete already
HandleWorkshopEvent()
endif
endFunction
; call when starting water objective to check for water already made
function InitializeWaterObjective()
float water = GetWaterRating()
debug.trace(self + " InitializeWaterObjective: starting water=" + water)
if water > 0
WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript)
; check if everything is complete already
HandleWorkshopEvent()
endif
endFunction
; call when starting food objective to check for food already made
function InitializeFoodObjective()
float food = GetFoodRating()
debug.trace(self + " InitializeFoodObjective: starting food=" + food)
if food > 0
WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript)
; check if everything is complete already
HandleWorkshopEvent()
endif
endFunction
; call when starting food objective to check for food already made
function InitializeSafetyObjective()
float safety = GetSafetyRating()
debug.trace(self + " InitializeSafetyObjective: starting safety=" + safety)
if safety > 0
WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript)
; check if everything is complete already
HandleWorkshopEvent()
endif
endFunction
function HandleWorkshopEvent()
WorkshopScript workshopRef = Alias_Workshop.GetRef() as WorkshopScript
; wait for recalc to finish
workshopRef.WaitForWorkshopResourceRecalc()
; if all objectives are complete, then set completion variable
bool allComplete = true
int i = 0
while (i < WorkshopObjectives.Length) && allComplete
WorkshopParentScript:WorkshopObjective theObjective = WorkshopObjectives
if IsObjectiveCompleted(theObjective.index) == false
allComplete = false
endif
i += 1
endWhile
bAllObjectivesComplete = allComplete
endFunction
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 Const
GlobalVariable Property APWQuest071BedTotal Auto Const
GlobalVariable Property APWQuest07BedPercent Auto Const
GlobalVariable Property APWQuest07WaterCount Auto Const
GlobalVariable Property APWQuest07WaterTotal Auto Const
GlobalVariable Property APWQuest07WaterPercent Auto Const
GlobalVariable Property APWQuest07FoodCount Auto Const
GlobalVariable Property APWQuest07FoodTotal Auto Const
GlobalVariable 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

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

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 made
function InitializeBedsObjective()
float beds = GetBedsRating()
debug.trace(self + " InitializeBedsObjective: starting beds=" + beds)
if beds >=3
APWquest07.SetStage(60)
WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript)
; check if everything is complete already
HandleWorkshopEvent()
endif
endFunction
Then my stage 50 looks like this:
SetObjectiveCompleted(40)
SetObjectiveDisplayed(50)
; start receiving workshop build events
kmyQuest.RegisterForWorkshopEvents()
; initialize bed count
kmyQuest.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

  • 2 weeks later...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...