Steps to create a Fallout 4 Workshop Parent registered resource producing settlement with optional player scrappable objects and regenerated precombines.


(1) WorkshopParent Registration

Whilst isolated workshops can be deployed without issue (as long as build areas do not overlap with existing workshop tagged Locations or build areas), they will not be able to manage assigned actors as settlers or produce resources. That is managed by the WorkshopParent Quest and associated scripts (WorkshopParentScript, WorkshopScript, WorkshopObjectScript, WorkshopNPCScript). The master WorkshopParentScript is complex, fragile and easily broken. The steps in this guide help you to understand what objects, keywords and registrations are needed to avoid problems. Learn more here:

SKK Workshop Utilities - Corrupt Workshop Lists

SKK Workshop Utilities - Workshop Keyword Test


(2) Broken Precombines

To maintain performance, individual scenery elements in the game world are pre-combined into aggregate graphics objects (like a piece of road + rusty car + tree + pile of leaves) which reduces compute and render load. Mods which break them apart for object scrapping breaks the precombine system for that whole game cell and can tank frames per second graphics rendering performance. Ouch, that OCD pile of leaves just cost you 30 fps.

Amusingly the frame rate can govern the speed of script execution, and settlements have a lot of objects with attached scripts. So in tidying up you are slowing down both graphics rendering and script execution. Double whammy for stability and user experience.  Learn more about this from the SKK Script Lag Latency Detector. The steps in this guide help you to configure objects in your settlement area to be player scrappable and regenerate those precombines for FPS and script performance.


(3) Locations.

Many workshop issues are caused by incorrectly configured location data, especially when trying to use an existing unique location record that already has a map marker.  This guide works 100% when creating/using a new location.  Trying to use an existing named location may or may not work depending on what is already happening in that location. Also note that there is no script function to dynamically add a vital keyword to a location record, specifically  Location.AddKeyword(LocTypeWorkshopSettlement) which triggers ResetWorkshop updates, which is why dynamically creating or moving registered workshop settlements is not practical). Conquest seems to work around this using a stash of 10 pre-made location records.


The article was written using Natick Warehouse Settlement by SKK as a template.


;------------------------------------------------------------------ 

(01) In the Creation Kit render window find the ideal location for your workshop settlement.

If it is already a named location it must not have LocTypeWorkshop or LocTypeWorkshopSettlement location keywords. Whilst it is POSSIBLE to reengineer existing registered locations, that needs expert understanding which is beyond the scope of this article.

If it is an un-named (wilderness/commonwealth) cell it must not be part of an existing Workshop build area touched by a WorkshopLinkedPrimitive triggerbox. This, like democracy, is non negotiable.


;------------------------------------------------------------------

(02) Create a new Layer (Menu: View/Layers) PREFIX_SettlementNameLayer

Make that layer active, lock all other layers so existing objects are not nudged creating dirty edits and possibly breaking precombines.


;------------------------------------------------------------------

(03) ObjectWindow > RenderWindow Add Xmarker Heading: PREFIX_LocationCenterMarker

LocationRefType LocationCenterMarker

This is used as a hub to link and find other markers, and as an actor AI package target for travel/sandbox.
 
;------------------------------------------------------------------

(04) ObjectWindow > RenderWindow Add Xmarker Heading: PREFIX_FastTravelMarker

Where you want to arrive on fast travel, this can be moved with the fast travel mat.
 
(04a) ObjectWindow > RenderWindow Add Mapmarker: PREFIX_MapMarker

EXCEPT if using an existing location that already has a map marker then use it. Do not try and add a second map marker to an existing location as the workshop registration scripts will pick the wrong one and cause problems without a custom marker fix or registration script.

Marker Data
Name: Settlement Name 
Type: Settlement
Can Travel To: Check
Visible on Map: Uncheck to hide for discovery on the map.

LinkRef no keyword to > PREFIX_FastTravelMarker 

Pro tip: If the player should be able to move the AI travel package and sandbox target with a fast travel mat, don't add a new PREFIX_FastTravelMarker, just link the PREFIX_MapMarker to > PREFIX_LocationCenterMarker. Then LocationCenterMarker becomes the fast travel target which can be moved with the fast travel mat.


;------------------------------------------------------------------
 
(05) ObjectWindow Create new Location PREFIX_SettlementNameLocation

EXCEPT if you want to use a location that already has a unique named location record then use it and update with this info. If that location already includes a workshop STOP. WALK AWAY. YOU WILL CORRUPT GAMES.

World Location Marker:  PREFIX_LocationCenterMarker

World Location Radius: 5000      ;default buildzone radius without WorkshopLinkedPrimitive.

Keyword: LocTypeWorkshop           ;VITAL for workshop locations to be found in conditional picks.   

Keyword: LocTypeWorkshopSettlement ;VITAL for ResetWorkshop() settler and resource management.
 
Keyword: LocTypeSettlement         ;not important, used by one quest location lookup.  

Keyword: LocTypeClearable          ;used WorkshopScript to grant ownership when all actors are killed.


;------------------------------------------------------------------
  
(06) ObjectWindow Create new Encounter Zone: PREFIX_SettlementNameZone

Level 0 - 0

Never resets <= IMPORTANT avoids cell reset clearing containers 

Workshop

Location: PREFIX_SettlementNameLocation 
 
;------------------------------------------------------------------

(06a) In CellView window select each Settlement cell in turn:

F2 to Rename:SettlementNameExtNN or SettlementNameIntNN

Right click edit [common data] set Location:  PREFIX_SettlementNameLocation

Right click edit [data] set name: Settlement Name (for interior cells)  

Right click edit [data] set Encounter Zone:  PREFIX_SettlementNameZone  (for interior cells) 

If you create workshop markers or assets in cells that are not included in the settlement location they may not be found by quest lookups. The "so what" is that settlement will not be picked for use as a radiant quest location. 


;------------------------------------------------------------------
 
(07) ObjectWindow > RenderWindow add COCMarkerHeading PREFIX_CoC

EXCEPT if using an existing location that already has a COC marker.

Where you want player to appear when consoling [ coc SettlementNameExtNN ]


;------------------------------------------------------------------ 

(08) ObjectWindow > RenderWindow Add Xmarker Heading: PREFIX_SpawnMarker

Where you want new settlers and other friendly recruits to spawn. 


;------------------------------------------------------------------

(08) ObjectWindow > RenderWindow Add WorkshopWorkbench PREFIX_WorkshopREF

LinkRef WorkshopLinkCenter to > PREFIX_LocationCenterMarker


;------------------------------------------------------------------

(09) ObjectWindow > RenderWindow add (typically underneath PREFIX_WorkshopREF) WorkshopResourceContainerSettlement   PREFIX_WorkshopContainer

LinkedRef WorkshopLinkContainer > PREFIX_WorkshopREF ;This is not actually used, probably a holdover from before the red Workshop Workbench was itself a container. The Workshop scripts do refer to it on exception paths so best have it.


;------------------------------------------------------------------

(10) ObjectWindow > RenderWindow add DefaultEmptyTrigger PREFIX_WorkshopBuildArea
LinkedRef WorkshopLinkedPrimitive TO PREFIX_WorkshopREF ; workshop build area

You can add multiple DefaultEmptyTrigger boxes linked back to the workshop with WorkshopLinkedPrimitive keyword for odd shaped build areas, but do not extend them past the Workshop location tagged cells to avoid ResetWorkshop resource issues. Do not extend the build area past 10,240 game units from the workshop (the default uGridsToLoad active area), else non persistent built objects and resources may be lost unloaded.


;------------------------------------------------------------------

(10a) For settler sandboxing you can use the PREFIX_WorkshopBuildArea trigger box, or to define a different area add another DefaultEmptyTrigger named PREFIX_WorkshopSandboxArea.

Do not extend the sandbox area past 10,240 game units from the workshop (the default uGridsToLoad active area), else non persistent settlers may be lost unloaded.

This will be linked in step (12)


;------------------------------------------------------------------
 
(11) ObjectWindow > RenderWindow add Xmarker Heading PREFIX_OutOfSightMarker00, 01, 02 ; One or more for attack and random event spawns. They MUST BE outside the build area and best screened out of sight, but in workshop encounter zone location tagged cells if possible so they don't reset and can be found by radiant quest location lookups.

Try to keep them within a 10,240 game unit radius of the workshop (the default uGridsToLoad active area), else actors may spawn unloaded and become stuck.

LocRefType LocationEdgeMarker ; For Workshop*Attack quests.  

LinkedRef  WorkshopLinkAttackMarker to PREFIX_LocationCenterMarker ; Used Workshop*Attack and WorkshopRadioBeaconRecruit spawns
  

;------------------------------------------------------------------
 
(12) Select PREFIX_WorkshopREF

LinkedRef WorkshopLinkSandbox   TO PREFIX_WorkshopSandboxArea (or PREFIX_WorkshopBuildArea)   ; settlers sandbox movement area.

LinkedRef WorkshopLinkContainer TO PREFIX_WorkshopContainer ; not actually used as the WorkshopWorkbench is a container.

LinkeRef WorkshopLinkSpawn      TO PREFIX_SpawnMarker       ; WorkshopParentScript initial settler, some attacks, some spawns.


;------------------------------------------------------------------ 

(13) ObjectWindow > RenderWindow add WorkshopSetOwnedTrigger infront of workshop to automatically grant player ownership. DO NOT be temped to configure [ OwnedByPlayer = True ] direct on the WorkshopScript, that skips a bunch of steps which will cause ongoing registration and resource issues in perpituity. R.T.F.M.

Linkedref no keyword TO PREFIX_WorkshopREF

An alternative is to use the default PREFIX_WorkshopREF WorkshopScript.EnableAutomaticPlayerOwnership = true to automatically grant workshop ownership when the LocTypeClearable location is cleared of all actors (both hostile and friendly).

;------------------------------------------------------------------

(14) ObjectWindow (WorldObjects/Static/Workshop) make a copy of Boston Airport WorkshopBorderAirport01 (or another appropriate sized asset), rename PREFIX_WorkshopBorder, drag into the RenderWindow.

LinkedRef WorkshopLinkedBuildAreaEdge TO PREFIX_WorkshopREF [ CHECK INITIALLY DISABLED ]


;------------------------------------------------------------------ 
 
(15) For any workshop resources static placed/added (Workbench, Beds, Water, Crops, Defense) that run WorkshopObjectScript:

LinkedRef WorkshopItemKeyword TO PREFIX_WorkshopREF


;------------------------------------------------------------------

(15a) Quality Control

Check the Location record PREFIX_SettlementNameLocation [Encounter Zone] has picked up PREFIX_SettlementNameZone from the member cells.

Check the Location record PREFIX_SettlementNameLocation [Location Ref Types] contains all the expected objects;

LocationCenterMarker
LocationEdgeMarker
MapMarkerRefType
WorkshopRefType

Check the location record PREFIX_SettlementNameLocation [Cells] tab contains all the cells that contain workshop objects and resources.


;------------------------------------------------------------------
  
(16) If you want your workshop to recruit settlers, manage resources and appear in the assign actor/provisioner lists it must be registered with WorkshopParentScript.

Whilst WorkshopParentScript will automatically detect all (LocTypeWorkshopSettlement + WorkshopKeyword) workshops at a new game start to self register, your mod added workshop may not be recognised in time to be included. To allow for that latency and for your mod to be installed anytime after a new game start, create your own registration.

There are now TWO options for this, either (A) the premium quality EZ SKK method with error checking or (B) the janky old prone to failure base game method. You choose you.

(16.1) PREMIUM QUALITY EZ SKK METHOD 

Spoiler:  
Show

(1) Download SKK_WURegisterNewWorkshopScript from SKK Workshop Utilities optional files section.
(2) Copy SKK_WURegisterNewWorkshopScript.PEX to ...\Fallout4\Data\Scripts.
(3) In your new workshop(s) mod create a new quest PREFIX_Quest
(4) [Quest Data] check [Start Game Enabled] and [Run Once]
(5) [Quest Stages] add Stage 10 ("I have started") 
(6) [Quest Stages] add Stage 20 ("I have completed successfuly") 
(7) [Quest Stages] add Stage 30 ("I have completed with errors") 
(8) [SCRIPTS] ADD SKK_WURegisterNewWorkshopScript
(9) [Autofill] the base game form properties. 
(10) Fill in the UserFills Common and then SINGLE or MULTIPLE properties section but not both.

Register any of your custom remote scripts for PREFIX_Quest.OnStageSet to react on stage 10 started, 20 success, 30 fail if you need "I am ready" integration.

Load your mod into a new game (that has never seen the mod before) and enjoy.

SKK_WURegisterNewWorkshopScript SUCCESS [workshopscript < (0E0072AF)>] [Location < (0E0072AD)>] ID 30
SKK_WURegisterNewWorkshopScript SUCCESS [workshopscript < (0E000F9F)>] [Location < (00165595)>] ID 31
SKK_WURegisterNewWorkshopScript SUCCESS [workshopscript < (0E003D47)>] [Location < (0E003D45)>] ID 32
SKK_WURegisterNewWorkshopScript SUCCESS [workshopscript < (0E008A29)>] [Location < (0E008A23)>] ID 33
SKK_WURegisterNewWorkshopScript SUCCESS [workshopscript < (0E005433)>] [Location < (0E00AF85)>] ID 34

Note if your new workshop mod is installed when a new game starts then WorkshopParent may/will find and register it automatically. This script detects that state and only updates the map marker and adds any selected inventory.



(16.2) Janky old prone to failure base game method

Spoiler:  
Show
 
ObjectWindow new Quest PREFIX_Quest

Start Game Enabled
Run Once
Priority 0 (Lower than WorkshopParent quest which is 30 so it doesn't try to run before it in a new game)
Create Stage 10 [check run on start]
Create Stage 20 [check run on stop]
 
Quest Aliases New Location Alias: Location (this is optional depending on the method you choose) 
Fill Type [Specific Location]: PREFIX_SettlementNameLocation
 
Quest Aliases New Ref Collection Alias: WorkshopsCollection

Option A Fill Type [Specific Forced reference]: Cell: SettlementNameExtNN  Ref: PREFIX_WorkshopREF 
This will force the workshop registration into WorkshopParentScript even if there are location lookup errors.

Option B Fill Type [Location Alias Reference] Location [Ref Type] WorkshopRefType
This will only submit the registration if the Workshop and Location information lines up.

Alias Inventory add WorkshopInitialResources_Settlement
 
Scripts Button
Add script WorkshopAddLocationsScript
Set WorkshopParent property > WorkshopParent
Set WorkshopsCollection property > PREFIX_Quest > WorkshopsCollection 
Add script DefaultQuestShutdownScript
Set StartTimerStage to 20


(16.1) MULTIPLE WORKSHOPS

If you are trying to register multiple workshops, to allow WorkshopParentScript to queue the requests either;

(a) Create a new keyword that is unique to this mod (e.g. SKK_RRWorkshopKeyword), add that keyword as a LinkedRef to each of the WorkshopREFs linking to say the map marker (why later). On alias WorkshopsCollection set [Max Initial Fill Count 0] [Find Matching Reference] Conditions [HasKeyword WorkshopKeyword == 1] [HasLinkedRef SKK_RRWorkshopKeyword == 1] to find your workshops and no others.  

(b) Create a separate registration quest for each workshop and assign them different priorities from 0 to 29 so they can be sequenced and do not run before WorkshopParentScript has finished initialising. This is not 100% reliable.

(c) Split them into separate ESP/ESL mods each with a forced reference registration quest. 


(16.2) MULTIPLE MAP MARKERS

If there are multiple map markers in the workshop location its random chance if the registration process will pick the right one for your workshop. Base game example: HangmansAlley.MyMapMarker gets connected to Flagon Tunnel map marker as it is closer than the actual Workshop map marker, and why the fast travel mat doesn't work D-OH ! Also 50% of the time Boston Airport registration picks the Prydwen map marker. If you have this problem you will need a seperate script to run after the WorkshopParentScript registration process to fix the map marker assignment (using option a LinkedRef above).

ObjectReference ThisMapMarker = Game.GetFormFromFile(0x0016ca1d, "Fallout4.esm") as ObjectReference ; Unnamed Object in FensRaiderCampExt
ObjectReference ThisWorkshop  = Game.GetFormFromFile(0x001f0711, "Fallout4.esm") as ObjectReference ; FensRaiderCampWorkshopRef
If ((ThisWorkshop as WorkshopScript).myMapMarker != None)
   (ThisWorkshop as WorkshopScript).myMapMarker.MoveToMyEditorLocation() ;reset incase it has already moved
EndIf
(ThisWorkshop as WorkshopScript).myMapMarker = ThisMapMarker
ThisFastTravelPoint = ThisMapMarker.GetLinkedRef()
ThisFastTravelPoint.MoveToMyEditorLocation()


(16.3) LOCATION OVERWRITE

If other mods lower in the load order overwrite the world location, your workshop registration will probably fail or be incomplete as the location lookup references will not be found. You will know if there is a problem from the workshop name reported in the PipBoy workshop list (Typically COMMONWEALTH or ...) or using Workshop Ownership Utilities diagnostics.

 
;------------------------------------------------------------------ 

(17) Intentional blank


;------------------------------------------------------------------ 

(18) Test this all works in a new game. A Vault 111 exit clean unmodified save game, or use SKK Fast Start New Game to get there in 2 minutes. Do not try to add a new workshop mod to a savegame multiple times, the WorkshopParent registrations may/probably/will be inconsistent. 

Use SKK Workshop Ownership Utilities to validate your workshop keywords and WorkshopParent registration in game. For a checklist of Workshop Keywords, read article SKK Workshop Utilities - Workshop Keyword Test.


;------------------------------------------------------------------ 

(19) Open your mod file ESP or ESL in xEdit and remove all of the dirty Cell or Worldspace edits you made by touching stuff without realising it. Betcha $10 you touched one or more MistLargeRoundDustyDim in an interior cell or nudged some markers around.
 

********* YOU CAN STOP HERE, OR 


;------------------------------------------------------------------ 

(20) If you want to break static items out of precombine so they are player scrappable and regenerate the precombines for performance:

ObjectWindow > RenderWindow drag a new WoodCrate_Empty (hide under the workshop for the base game "tediously select individual items to scrap" experience, or place visible for a one click "scrapall" style experience) name PREFIX_ScrapallHUB

Menu: View/Layers new PREFIX_ScrapallLayer (thanks to Trosski for this)
Make that layer active, lock all other layers.
Right click add any base game stuff that wants to be scrappable on that layer.

(-) minus key to group select.
In the batch window add LinkedRef for keyword WorkshopStackedItemParentKEYWORD referencing PREFIX_ScrapallHUB. This will exclude items from regenerated precombine so they can be scrapped if they have an associated scrap _co recipe.

Menu: World/PrecombineGeometry for each modified cell (B in the render window shows cell boundaries).
Menu: Visibility/Generate Precombined Visibility for each modified cell.  

If you have problems with stairs clipping or navmeshes not working:
Menu: View/Layers new PREFIX_DisableForPrecombineLayer (thanks to RedRocketTV for this)
Make that layer active, lock all other layers.
Right click add any base game stuff that needs to be excluded from precombine so it works (but is not scrappable) on that layer. 

(-) minus key to group select in the batch window set Starts Disabled [DO IT]

Menu: World/PrecombineGeometry for each modified cell (B in the render window shows cell boundaries).
Menu: Visibility/Generate Precombined Visibility for each modified cell.  
 
(-) minus key to group select in the batch window set Starts Disabled checkbox clear [DO IT]


;------------------------------------------------------------------

(21) Enjoy !

;------------------------------------------------------------------

This article has been transferred from its original publishing location.

If you have comments, best to use the SKK Mods Discord discord://discord.gg/tgKNT77DC8

by [email protected] April 2018

Article information

Added on

Edited on

Written by

SKKmods