Fallout 4

File information

Last updated

Original upload

Created by

Moonracer

Uploaded by

moonracer

Virus scan

Safe to use

Documentation

Readme

View as plain text

Fallout 4 Legendary System Tutorial
by Moonracer
2/6/2017

Okay, so I just spent all of my free time the last few weeks trying to reverse engineer the Fallout 4 legendary system in order to make it something I like. This took me a long time because I am not an expert modder and there is not a lot of documentation for the Creation Kit. I did learn quite a bit and I feel like sharing so I will attempt to go through everything I've learned. Hopefully this will make things easier for you if you decide to make a similar mod (or wish to edit mine, which you are more than welcome to).

I'm not going to include pictures or make a video of this tutorial because that is a waste of my time and yours (mostly mine). I will probably cover some very basic stuff as well so just be patient.



Part One:
Quests and Scripts:
When I first started this project I was afraid that I would need to edit scripts to do everything I wanted. Thankfully this was not the case. If you have tinkered with the creation kit enouh you've probably noticed quite a few Quests that reference a script and don't seem to do anything else. For example "LegendaryItemQuestScript" is referenced in "LegendaryItemQuest". Within the quest you can right click on the script and either edit the source (the script itself) or edit the properties. The LegendaryItemsQuestScript sets variable names and rules for those variables on how to determine what item to spawn and what legendary effects to give it. The quest notes the variable names and stores data for each.

LegendaryItemQuest stores several lists.
AmmoData will determine what ammo should be spawned. Interestingly, the unmoded quest did not have shotgun ammo listed, which meant if an NPC spawned with a legendary shotgun they wouldn't get ammo for it. This isn't perfect since if a weapon can spawn with a reciever that changes ammo type it might get the wrong ammo ( a 50 caliber sniper rifle doesn't spawn with 50 cal ammo).

LegendaryModRules checks for keywords an item has for each legendary mod, to decide if it can be installed on that item. There are FormList entries like "LegendaryModRule_allowedKeywords_ArmorBodyChest" that can have one or more keywords. You can create your own FormList and reference it in a LegendaryModRule for greater control of which items can and can't recieve specific legendary mods. For example, in my mod I added new armor Formlists and edited the existing ones to be more precise. That way I can decide if I want a mod to just fit on arms, legs, chest or any armor slot.

If you remove a LegendaryModRule for a specific legendary mod, that mod will no longer appear on legendary drops. If you create a new legendary mod you need to add a new LegendaryModRule referencing it for it to show up. More on that later.

Under the Quest tab there are several DLC related Legendary quests. These store the same kind of information that LegendaryItemQuest holds, only for the specific items and legendary mods of that DLC. The scripts themselves (not the quests) explain how that information is handled. For example, Nuka World items don't appear to spawn as legendaries until after you have visited that worldspace. A modder more clever than I could use this system to add a set of legendary effects later in the game (for a custom quest).



Part Two:
Adding items to spawn as legendary:
This can be done three ways that I know of. The first is to dierctly add items to the leveled list the LegendaryItemQuest calls on (LGND_PossibleLegendaryItemsBaseLists) to choose an item to spawn. Second you can edit one of the DLC Legendary quests that add their items to the legendary items leveled list and insert your own. Third you can create your own script to add items to the leveled list.

Make sure that the item you add to the Leveled list has an "ap_Legendary" in the "Attach Parent Slots" section of the item. I was going to add the Mr Handy Buzz Saw from Automitron to my mod but noticed it was lacking that slot and I didn't want to edit the weapon for compatability. The same goes for any custom weapons or armor you would like to add to legendary drops.


Part Three:
Making Custom Legendary Mods:
Legendary Mods work just like other weapon and armor mods in the game except they fit in the Legendary slot and can't be swapped in or out without a mod. A quick search for "legendary" in Items/Object Mod section of the CK will list all of the mods and you can get a good idea for what is possible. Note that because legendary mods function the same as normal mods you can create at a workbench, you can use all of the variables for either.

In legendary mod's object popup window you can give the mod a name like normal game items, but this doesn't determine how an item gets named with that mod. I suspect that would only be seen by a player if they use a mod that allows removing and swapping legendary mods. In the Property Modifiers sub window you will see a parameter like "pkKeywords ADD HasLegendary_Armor_LessDMGRobots" (for the mod with the ID "mod_Legendary_Armor_LessDMGRobots". This is a keyword used to reference that specific weapon mod.

If you go to Miscellaneous/Keyword and look up "HasLegendary_Armor_LessDMGRobots" then check its use info it will show that it is used in INNR (or Instance Naming Rules) dn_CommonArmor. Go to Instance Naming Rules under Miscellaneous and open dn_CommonArmor and in that list you will see that "Troubleshooter's" checks for keyword "HasLegendary_Armor_LessDMGRobots". And That is how the game adds that descriptor to an item that is moded (with a legendary or other mod). Unfortunately I still don't know much about instance naming rules to go into more detail. I don't know what the Index number attatched to each name is or how the game actually uses these INNR lists to created modified item names so I can't help much here. Directly modifying these lists is probably a bad idea for compatibility reasons since lots of objects refer to them. It is possible to inject your data into the list with scripts.


Part Four:
Additional Information:
Under Magic/Magic Effect open "abLegendaryCreatureItemEffect" and you will see the condition "HasKeyword EncTypeLegendary == 1" This magic effect checks to make sure the NPC in question has the keyword that labels it as legendary and if true, tells the game to spawn a legendary item. I realized that I could add additional conditions like "HasKeyword ActorTypeAnimal != 1" and it will not spawn legendary items on NPCs if they have that keyword, regardless of whether they are legendary. It is important to note that keywords on an NPC Race will carry over to specific NPCs of that type.

Understanding this opens up potentially creative uses for future mods.