MesaSolar Posted April 17, 2022 Share Posted April 17, 2022 I'd like to copy/mimic the Sanctuary quest where the player has to build certain items from the workshop to make Sanctuary a settlement for the minutemen. I took a look at the Min01 0005DEE4 quest in the CK and it's a bit of a mess so I'm hoping someone here might be able to dumb it down for me. 1. I need to set up an area within my custom worldspace as a settlement2. Obviously need someone to report to like Sturgess. ( I have an NPC in mind already)3. Need to be able to check for each task being done. Sheltered beds, clean water, food and defenses. Link to comment Share on other sites More sharing options...
MesaSolar Posted April 22, 2022 Author Share Posted April 22, 2022 I have my settlement built and am ready to start scripting the quest. Min01 has its own quest script which I'm assuming I can copy and just adjust some parameters to match my quest. Not sure where to start though and I'm still confused when looking at the quest stages of Min01. Appreciate any help making this work. Link to comment Share on other sites More sharing options...
MesaSolar Posted April 22, 2022 Author Share Posted April 22, 2022 I followed this tutorial but when I activate the workshop I get a message that I need to clear the enemies from the location even though there are no enemies or NPC's at this location yet. Any idea what could be causing this? Link to comment Share on other sites More sharing options...
LarannKiar Posted April 22, 2022 Share Posted April 22, 2022 (edited) Does the Location of the settlement has the Location Ref Type "Boss"? If so, then you need to kill the that NPC (or NPCs) to make the location "Cleared". (You can call SetCleared() on the location). Edited April 22, 2022 by LarannKiar Link to comment Share on other sites More sharing options...
MesaSolar Posted April 22, 2022 Author Share Posted April 22, 2022 I found a property setting to have the player own the settlement. That seemed to fix the enemy problem. Next I'm on to scripting for the actual quest. I copied the script from the Min01 quest and deleted what I didn't need. This is what I have so far: Scriptname APWQuest07Script extends WorkshopEventsQuestScript Conditional bool initialized = false bool bAllObjectivesComplete = false Conditional;WorkshopEventsQuestScript myWorkshopEvents ; called once by startup stagefunction InitializeQuest() if initialized return endif ;myWorkshopEvents = (self as Quest) as WorkshopEventsQuestScript ; register for events RegisterForRemoteEvent(Game.GetPlayer(), "OnLocationChange") RegisterForRemoteEvent(Alias_Preston.GetActorRef(), "OnLocationChange")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 > 0 WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript) ; check if everything is complete already HandleWorkshopEvent() 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 > 0 WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript) ; check if everything is complete already HandleWorkshopEvent() 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 > 0 WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript) ; check if everything is complete already HandleWorkshopEvent() 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 > 0 WorkshopParent.UpdateWorkshopObjectivesSpecific(self, WorkshopObjectives, Alias_Workshop.GetRef() as WorkshopScript) ; check if everything is complete already HandleWorkshopEvent() endifendFunction 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 = 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_Preston Auto Const ;will change to my own NPC ;ReferenceAlias Property Alias_Workshop Auto Const Location Property APWWDLDMadTeaPartyLocation Auto Const ;WorkshopParentScript Property WorkshopParent Auto Const GlobalVariable Property APWQuest07BedCount Auto ConstGlobalVariable Property APWQuest07BedTotal 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 GlobalVariable Property APWQuest07SafetyCount Auto ConstGlobalVariable Property APWQuest07SafetyTotal Auto ConstGlobalVariable Property APWQuest07SafetyPercent Auto Const GlobalVariable Property APWQuest07TravelProgress Auto Const{ tracks Preston's progress to advance travel scene from Concord to Sanctuary } GlobalVariable Property APWQuest07TravelPlayerLastTimestamp Auto Const{ timestamp from last time player was nearby when NPC hit a travel trigger - how long has it been since player was "nearby"} Link to comment Share on other sites More sharing options...
SKKmods Posted April 22, 2022 Share Posted April 22, 2022 If you set the property OwnedByPlayer = True direct on WorkshopScript you will break the WorkshopParent registration. Fact You need to either use the WorkshopSetOwnedTrigger Or call the function myWorkshop.SetOwnedByPlayer(true) in script Or call the function from the comnsole [cf "WorkshopScript.SetOwnedByPlayer" 1] If you are following a fancy guide that sounds great but doesnt actually explain what you are doing, use something which does like https://www.nexusmods.com/fallout4/articles/2298 step 13 seems appropriate. Link to comment Share on other sites More sharing options...
MesaSolar Posted April 22, 2022 Author Share Posted April 22, 2022 If you set the property OwnedByPlayer = True direct on WorkshopScript you will break the WorkshopParent registration. Fact You need to either use the WorkshopSetOwnedTrigger Or call the function myWorkshop.SetOwnedByPlayer(true) in script Or call the function from the comnsole [cf "WorkshopScript.SetOwnedByPlayer" 1] If you are following a fancy guide that sounds great but doesnt actually explain what you are doing, use something which does like https://www.nexusmods.com/fallout4/articles/2298 step 13 seems appropriate.Ok I set the property back to false and I added a WorkshopSetOwnedTrigger, but the trigger doesn't seem to be working, and when I try to save the script I get these errors: variable WorkshopParent is undefinedvariable WorkshopObjectives is undefinedvariable Alias_Workshop is undefinednone is not a known user-defined script typecannot cast a void to a workshopscript, types are incompatible Link to comment Share on other sites More sharing options...
SKKmods Posted April 22, 2022 Share Posted April 22, 2022 No idea what it is that you are doing, but its probably not following the instructions that dont involve saving scripts: (13) ObjectWindow > RenderWindow add WorkshopSetOwnedTrigger infront of workshop to automatically grant player ownership. Are you monkeying around with WorkshopSetOwnedTriggerScript ? Link to comment Share on other sites More sharing options...
MesaSolar Posted April 23, 2022 Author Share Posted April 23, 2022 No idea what it is that you are doing, but its probably not following the instructions that dont involve saving scripts: (13) ObjectWindow > RenderWindow add WorkshopSetOwnedTrigger infront of workshop to automatically grant player ownership. Are you monkeying around with WorkshopSetOwnedTriggerScript ?Apparently the problem was that I was coc'ing directly into the cell. I tried entering the game in a different cell and walking to the settlement so now it works. I just need to get the Min01 Script working now still getting these errors with my custom script: variable WorkshopParent is undefinedvariable WorkshopObjectives is undefinedvariable Alias_Workshop is undefinednone is not a known user-defined script typecannot cast a void to a workshopscript, types are incompatible Link to comment Share on other sites More sharing options...
MesaSolar Posted April 27, 2022 Author Share Posted April 27, 2022 EDIT: I added a LocRefType to the NPC's in the render window and that fixed the problem. Ok so i think i found a workaround by simply attaching the original Min01 quest script to mine an pointing the global variables to custom ones. Next I added a couple of Unique NPC's to the area that are needed in the quest and I got this warning: MASTERFILE: <CURRENT> LCTN 'APWWDLDMadTeaPartyLocation' (01006286) Ref 'APW_MarchHare_NPC' (0100A034) uses location but is not in the unloaded ref data.MASTERFILE: <CURRENT> LCTN 'APWWDLDMadTeaPartyLocation' (01006286) Unique NPC Ref 'APW_MarchHare_NPC' (0100A034) is not in the Unique NPC data.MASTERFILE: <CURRENT> LCTN 'APWWDLDMadTeaPartyLocation' (01006286) Ref 'APW_MadHatter_NPC' (01009FF6) uses location but is not in the unloaded ref data.MASTERFILE: <CURRENT> LCTN 'APWWDLDMadTeaPartyLocation' (01006286) Unique NPC Ref 'APW_MadHatter_NPC' (01009FF6) is not in the Unique NPC data.MASTERFILE: <CURRENT> LCTN 'APWWDLDMadTeaPartyLocation' (01006286) Warnings were encountered validating unloaded ref data for Location 'APWWDLDMadTeaPartyLocation' (01006286). Link to comment Share on other sites More sharing options...
Recommended Posts