By default, McClarence Outfitters supports extracting and adding Legendary effects from and to most items.
New Legendary effects added by mods must have support added to McClarence.
Fortunately, the systems that run it were designed to be injected into so that patches can be made in a dynamic way that can avoid needing to be updated every time McClarence updates!
This guide will walk through how to make patches so that McClarence Outfitters can extract and install Legendary Effects from other mods.
This tutorial will change with the 1.0.8 patch of McClarence Outfitters, any patches made with this version of the tutorial will need to be updated to incorporate the changes.
If you aren't interested in the technical details, and just want to get to making the patch, feel free to skip ahead to the Basic Patch or Dynamic Patch sections below to get to creating the records.
Legendary items are the same as regular armor/weapons except with some number of Object Mods applied to certain "slots", which are represented by Attach Points. An Item can have only one Object Mod targeting each Attach Point.
Legendary effects are represented by Object Mods that target one of these Attach Points. There are three Legendary Attach Points available to items: ap_Legendary_rank_1, ap_Legendary_rank_2, ap_Legendary_rank_3.
Since each Legendary effect targets a particular Attach Point, and an item can't have more than one Object Mod in an Attach Point, this is why you generally never see certain combinations of Legendary effects in the base game.
In order to break this pattern, McClarence Outfitters need a new pair of duplicates of each Legendary mod that target the other two attach points.
The below tutorials will walk through building these copies as well as other records necessary to tie all of the information together and register it with McClarence.
The simplest patch type involves making McClarence Outfitters and the mod with the new Legendary effect(s) you want to support both requirements for your patch.
If you would like to make a more dynamic patch that only requires McClarence Outfitters, and dynamically fetches records from the other mods, head to the Dynamic Patch section.
This section assumes the Legendary is handled in a typical way. If you find these steps can't be followed, due to the target Legendary lacking key elements, skip ahead to the Handling Tricky Items for ideas on how to handle these types of items.
You will also need the Name and Description, you can come later to Copy/Paste it or you can do so now and Paste it in a text editor or some other document.
Give each of the duplicates a unique editor ID (you can do this by right-clicking the record and choose Rename), we recommend a naming scheme like:
<YourModPrefix>_OMOD_mod_Legndary_<ItemType>_<AttachPointNumber>_<LegendaryName>
For example, if you are setting up support for a Legendary gun effect called BigBadaBoom and it's record in step 4 targets ap_Legendary_rank_2, the names could be:
myMcoPatch_OMOD_mod_Legendary_RangedWeapon_1_BigBadaBoom
myMcoPatch_OMOD_mod_Legendary_RangedWeapon_3_BigBadaBoom
Notice how we didn't create one with 2, because the original Legendary object mod uses that attach point.
Give the keywords a unique Editor ID, we recommend a naming scheme like:
<YourModPrefix>_KYWD_HasLegendary_<ItemType>_<AttachPointNumber>_<LegendaryName>
For example, if you are setting up support for a Legendary gun effect called BigBadaBoom and it's record in step 4 targets ap_Legendary_rank_2, the names could be:
myMcoPatch_KYWD_HasLegendary_RangedWeapon_1_BigBadaBoom
myMcoPatch_KYWD_HasLegendary_RangedWeapon_3_BigBadaBoom
Just like the Object Mods, notice we skipped 2, because the original Legendary object mod uses that attach point.
Then add a new Property Modifier by right-clicking in that section and selecting New, on the right-half of that form change the Target to pkKeywords, and select the corresponding Keyword from the Form dropdown that matches the Editor ID number.
Note that we aren't replacing the existing pkKeywords entry, we are adding a second. This gives McClarence an efficient way to detect which attach point a legendary is using.
Go to Items > MiscItem in the Object Window and right-click in the right half of the Object Window and select New. Give the item a unique ID, we recommend a naming scheme like:
<YourModPrefix>_MISC_DescriptionHolder_<LegendaryName>
For example: myMcoPatch_MISC_DescriptionHolder_BigBadaBoom
Then uncheck Playable, as we don't want these to ever end up in the player's inventory, and finally click OK to save the item.
Create another new MiscItem and give it a unique ID, we recommend a naming scheme like:
<YourModPrefix>_MISC_Association_<ItemType>_<LegendaryName>
For example: myMcoPatch_MISC_Association_RangedWeapon_BigBadaBoom
Fill in the name of the Legendary effect as the Name of the MiscItem.
Right-click in the Keywords section and add the McClarence keyword that matches the slot the base legendary in step 4 is for. There is one keyword for each: kgcLgnd_KYWD_LegendaryTier1, kgcLgnd_KYWD_LegendaryTier2, kgcLgnd_KYWD_LegendaryTier3.
In the example we've been using, we'd add the Tier2 keyword.
Then uncheck Playable, as we don't want these to ever end up in the player's inventory, and finally click OK to save the item.
Open the record you just created in step 10. The Scripts section should now be lit up so that scripts can be added, click Add and then add the script kgcLgnd:Form:AssociationKeywordOMOD.
If you can't find this script, you may have to launch the Tool Archive2.exe from your Starfield/Tools directory and open kinggathcreations_legendary - main.ba2 and extract the script to your Data folder, and then open and close the Creation Kit.
For example, in the example we've been using in this tutorial, you'd select myMcoPatch_KYWD_HasLegendary_RangedWeapon_1_BigBadaBoom for the first entry, and myMcoPatch_KYWD_HasLegendary_RangedWeapon_3_BigBadaBoom for the third entry, and leave the second entry as None.
In the example we've been using in this tutorial, you'd select myMcoPatch_OMOD_mod_Legendary_RangedWeapon_1_BigBadaBoom for the first entry, and myMcoPatch_OMOD_mod_Legendary_RangedWeapon_3_BigBadaBoom for the third entry, and plugin the original BigBadaBoom mod into the second entry.
The remaining properties aren't used for this type of patch, but are used for either the Dynamic Patch type, or Handling Tricky Items.
Click OK to close the properties, then click OK on the MiscItem to save it.
If this is your first Legendary for this patch, you'll want to proceed to the Registering with McClarence section to set up the base registration system. Otherwise, you can simply update the Registration system you made previously to point it to the new records you made, just like you did the first time at the end of that tutorial section.
Now that you have some Legendary data set up, you'll need to tell McClarence Outfitters about it.
In a future update, McClarence will receive a template quest you can duplicate, to avoid having to do some of these steps.
For the ID, enter <YourModPrefix>_FLST_NewArmorLegendaryKeywords. Then click OK to save that list.
<YourModPrefix>_FLST_NewWeaponLegendaryKeywords
<YourModPrefix>_FLST_MyMeleeMiscs
<YourModPrefix>_FLST_MyRangedMiscs
<YourModPrefix>_FLST_MySpacesuitMiscs
<YourModPrefix>_FLST_MyHelmetMiscs
<YourModPrefix>_FLST_MyPackMiscs
You should now have 7 different Formlists.
Give the quest a unique ID, and make sure "Start Game Enabled" is checked in.
Click OK to save the quest, then search up your new quest and re-open it.
Go to the scripts tab and click Add, in the Add script prompt, double-click [New Script]. This will open the Add New Script dialog.
For Name, give your script a unique name.
For Namespace, enter something that represents your mod, this is effectively a folder and your new script will end up in that folder to keep things organize.
Then click OK. You will then be presented with the properties menu, click OK to this as well to close it.
This will bring up a text editor with one line in it already. Leave that line in place, and then add a new line below it, next you'll copy paste the following below that line:
Formlist Property NewArmorLegendaryKeywordsList Auto Const
Formlist Property NewWeaponLegendaryKeywordsList Auto Const
Formlist Property MyMeleeMiscsList Auto Const
Formlist Property MyRangedMiscsList Auto Const
Formlist Property MySpacesuitMiscsList Auto Const
Formlist Property MyHelmetMiscsList Auto Const
Formlist Property MyPackMiscsList Auto Const
Struct ExternalFile
int ID
string File
EndStruct
ExternalFile[] Property NewArmorLegendaryKeywordIDs Auto Const
{ For loading Armor legendary keywords dynamically from non-parented plugins }
ExternalFile[] Property NewWeaponLegendaryKeywordIDs Auto Const
{ For loading Weapon legendary keywords dynamically from non-parented plugins }
Bool Property bInitialInjectionComplete = false Auto Hidden
Event Actor.OnPlayerLoadGame(Actor akSender)
HandleInjections()
EndEvent
Event OnQuestStarted()
if( ! HandleInjections())
RegisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame")
endif
EndEvent
String sMcClarencePlugin = "kinggathcreations_legendary.esm"
Bool Function HandleInjections()
if(Game.IsPluginInstalled(sMcClarencePlugin))
Formlist ArmorLegendaryKeywordsFormlist = Game.GetFormFromFile(0x4A1, sMcClarencePlugin) as Formlist
Formlist WeaponLegendaryKeywordsFormlist = Game.GetFormFromFile(0x4AB, sMcClarencePlugin) as Formlist
Formlist AllMiscsFormlist = Game.GetFormFromFile(0x49F, sMcClarencePlugin) as Formlist
Formlist SpacesuitMiscsFormlist = Game.GetFormFromFile(0x4B9, sMcClarencePlugin) as Formlist
Formlist HelmetMiscsFormlist = Game.GetFormFromFile(0x4A2, sMcClarencePlugin) as Formlist
Formlist PackMiscsFormlist = Game.GetFormFromFile(0x4A7, sMcClarencePlugin) as Formlist
Formlist MeleeMiscsFormlist = Game.GetFormFromFile(0x4A0, sMcClarencePlugin) as Formlist
Formlist RangedMiscsFormlist = Game.GetFormFromFile(0x4AC, sMcClarencePlugin) as Formlist
if(NewArmorLegendaryKeywordsList != None)
InjectToList(NewArmorLegendaryKeywordsList, ArmorLegendaryKeywordsFormlist)
endif
if(NewArmorLegendaryKeywordIDs && NewArmorLegendaryKeywordIDs.Length > 0)
int i = NewArmorLegendaryKeywordIDs.Length
while(i > 0)
i -= 1
Keyword thisKeyword = Game.GetFormFromFile(NewArmorLegendaryKeywordIDs[i].ID, NewArmorLegendaryKeywordIDs[i].File) as Keyword
if(thisKeyword != None)
NewArmorLegendaryKeywordsList.AddForm(thisKeyword)
endif
endWhile
endif
if(NewWeaponLegendaryKeywordsList != None)
InjectToList(NewWeaponLegendaryKeywordsList, WeaponLegendaryKeywordsFormlist)
endif
if(NewWeaponLegendaryKeywordIDs && NewWeaponLegendaryKeywordIDs.Length > 0)
int i = NewWeaponLegendaryKeywordIDs.Length
while(i > 0)
i -= 1
Keyword thisKeyword = Game.GetFormFromFile(NewWeaponLegendaryKeywordIDs[i].ID, NewWeaponLegendaryKeywordIDs[i].File) as Keyword
if(thisKeyword != None)
NewWeaponLegendaryKeywordsList.AddForm(thisKeyword)
endif
endWhile
endif
if(MyMeleeMiscsList != None)
InjectToList(MyMeleeMiscsList, AllMiscsFormlist)
InjectToList(MyMeleeMiscsList, MeleeMiscsFormlist)
endif
if(MyRangedMiscsList != None)
InjectToList(MyRangedMiscsList, AllMiscsFormlist)
InjectToList(MyRangedMiscsList, RangedMiscsFormlist)
endif
if(MySpacesuitMiscsList != None)
InjectToList(MySpacesuitMiscsList, AllMiscsFormlist)
InjectToList(MySpacesuitMiscsList, SpacesuitMiscsFormlist)
endif
if(MyHelmetMiscsList != None)
InjectToList(MyHelmetMiscsList, AllMiscsFormlist)
InjectToList(MyHelmetMiscsList, HelmetMiscsFormlist)
endif
if(MyPackMiscsList != None)
InjectToList(MyPackMiscsList, AllMiscsFormlist)
InjectToList(MyPackMiscsList, PackMiscsFormlist)
endif
endif
bInitialInjectionComplete = true
return bInitialInjectionComplete
EndFunction
Function InjectToList(Formlist aFromList, Formlist aToList)
if(aFromList == None || aToList == None)
return
endif
int i = 0
while(i < aFromList.GetSize())
Form thisForm = aFromList.GetAt(i)
if(thisForm != None)
aToList.AddForm(thisForm)
endif
i += 1
endWhile
EndFunction
Click File > Save to compile and save the script.
When you package your patch, you will need to create a Main.ba2 file and package this script with it.
Fill in each of the Formlist properties with the corresponding formlist you created in step 1.
If you are coming here off of the Dynamic Patch step, you will also fill out the NewArmorLegendaryKeywordIDs and NewWeaponLegendaryKeywordIDs with the decimal form ID and plugin name of the unique keywords that represent each new Legendary effect you are adding patch support for.
Now click OK to save the properties, and OK again on the quest to close the quest form.
Now you're going to add items to the formlists you created in Step 1 by opening them up, then leave them open and use an Object window to find the record you need to add and dragging those items into the large white space of the formlist.
To make things easier, you can open a second Object Window by right-clicking in the right side of an Object Window on a blank are and choosing "Create New Object Window". This way you can have one window for the formlists, and another for finding the items to add to them.
Below will describe which items go in which lists:
<YourModPrefix>_FLST_NewArmorLegendaryKeywords: Add the Keywords that represent the new Legendaries that target Armor.
<YourModPrefix>_FLST_NewWeaponLegendaryKeywords: Add the Keywords that represent the new Legendaries that target Weapons.
<YourModPrefix>_FLST_MyMeleeMiscs: Add the MiscItems with the AssociationKeywordOMOD script that target Melee Weapons.
<YourModPrefix>_FLST_MyRangedMiscs: Add the MiscItems with the AssociationKeywordOMOD script that target Ranged Weapons.
<YourModPrefix>_FLST_MySpacesuitMiscsList: Add the MiscItems with the AssociationKeywordOMOD script that target Spacesuits.
<YourModPrefix>_FLST_MySpacesuitMiscsList: Add the MiscItems with the AssociationKeywordOMOD script that target Spacesuits.
<YourModPrefix>_FLST_MyHelmetMiscsList: Add the MiscItems with the AssociationKeywordOMOD script that target Helmets.
<YourModPrefix>_FLST_MyPackMiscsList: Add the MiscItems with the AssociationKeywordOMOD script that target Packs.
If you are working with a legendary that can target multiple item types, put the corresponding items in all applicable lists.
Head over to Jason or Buster and try to extract a Legendary with the new effect. Then once you've confirmed you can extract the new effect, check the wall terminal to confirm that the new Legendary shows up as an entry, lastly try and have them install it into a different item.
Each time you load the game, your patch script will automatically register any additional Legendaries you add support for!
TODO
TODO