Adding and Editing Enclave Equipment

 

Introduction

The equipment used by most Enclave characters is driven by a complex system due to their loadouts changing as the player progresses along the questline. This system is called the Equipment Control System (or ECS).

The ECS system has been designed at its core to be modular, and make it very easy to add new equipment to it. If you intend to make a mod that changes an Enclave generic character’s equipment, it is vital you do so via the ECS system or else you’ll break their equipment’s progression.

If you’re not interested in learning how the system works - then please grab the template plugin and skip ahead to Adding new equipment.

America Rising 2 - Loadout Template Plugin

How it works

ECS Leveled Lists

Every character that is driven by the ECS system has one or more specialised Leveled List prefixed with AR_LLI_ECS. All ECS Leveled Lists are empty, as they are emptied and have new equipment injected into them at runtime by the ECS Controller. Each Leveled List exists in a pair. A standard ECS list and a Conditional list. For example:

  • AR_LLI_ECS_Weapons_SemiAuto_Upgraded

  • AR_LLI_ECS_Weapons_SemiAuto_Upgraded_CONDITIONAL

A Conditional list will only spawn in its items if it “should” - that is to say, if Enclave soldiers are currently using starter SemiAuto weapons then the Conditional list will not spawn any of its Upgraded SemiAuto weapons.

Standard lists will always spawn their items - even if they haven’t been unlocked yet. Conditional lists contain their Standard list, conditioned with a ChanceNone global variable that is driven by the ECS Controller.

ECS Keywords

Each type of equipment has an ECS Keyword associated with it - that allows the ECS system to understand who should be using certain types of equipment. These keywords are placed in Loadout Formlists that hold all the relevant equipment. The full list of ECS Keywords is as follows:

  • AR_ECS_Outfits_EnclaveOfficer

  • AR_ECS_Outfits_EnclaveScientist

  • AR_ECS_Outfits_EnclaveSoldier_AtBase

  • AR_ECS_Outfits_EnclaveSoldier_Standard

  • AR_ECS_Outfits_EnclaveSoldier_UnderArmor

  • AR_ECS_Outfits_EnclaveTechnician

  • AR_ECS_PowerArmor_EnclaveSoldier

  • AR_ECS_Weapons_Auto

  • AR_ECS_Weapons_BigGun

  • AR_ECS_Weapons_Grenade

  • AR_ECS_Weapons_Launcher

  • AR_ECS_Weapons_Pistol

  • AR_ECS_Weapons_SemiAuto

The following requires America Rising 2 Version 1.1.0 or newer:

  • AR_ECS_Weapons_Melee

ECS Controller

The Equipment Control System Controller is what drives all the ECS Leveled Lists. It contains all the ECS Lists and their Identifying Keywords, holds every piece of equipment Enclave personnel use in arrays, tracks each lists' Upgraded/Starter variant and handles transferring the correct equipment from its internal arrays to their respective ECS Lists.

Modders should not directly edit the ECS Controller - and should instead interface with it via Loadout Quests.

Loadout Quests

Loadout Quests handle injecting all equipment formlists into the Equipment Control System. America Rising 2’s default equipment is injected via the AR_EnclaveEquipmentDefaultLoadouts quest which starts up on first load.

These Loadout Quests are very simple and make use of one of two scripts:

  • AR_EnclaveECSInjectionSimpleScript

  • AR_EnclaveECSInjectionAdvancedScript

The scripts handle interfacing with the ECS Controller. The Simple script is adequate for most usages - and is also used by the official America Rising 2 equipment patches. The Advaned script gives slightly more granular control.

The ECS Actor Script and Abilities

All characters that make use of ECS Equipment have the AR_ECS_ActorScript script attached to their actor form. This script applies a matching ECS Ability for their actor type that handles checking whether any of their equipment has since been updated - and updates their inventory if necessary.

To minimize script overhead, once all of an actor’s inventory has been upgraded, the ECS Ability is removed from the actor so they stop running any additional script.

Adding new equipment

Template Plugin

A simple template plugin has been provided on the America Rising 2 - Patches and Resources Nexus Mods page that handles most of the basic setup. I recommend you download that - as this guide will assume you are using it.

Preparing the plugin

Naming the plugin

Once you’ve downloaded the template plugin (AmericaRising2-SimpleLoadoutTemplatePlugin.esp) the first thing you should do is rename it to something that reflects what your mod is adding. For the purposes of this guide, we’ll be making a patch that replaces Enclave Soldiers' Automatic weapons with Junk Jets - so we’ll name the plugin EnclaveSoldierJunkjets.esp.

Naming the forms

Open up your plugin in your editor of choice - the Creation Kit or FO4Edit. I’m more familiar with the Creation Kit so this guide will assume that is the tool you are using.

Once the plugin has loaded, there are three forms you’ll want to rename like you did with your plugin:

  • AmericaRising2_SimpleLoadoutTemplateQuest (A Quest form)

  • AmericaRising2_SimpleLoadoutStarterList (A Formlist form)

  • AmericaRising2_SimpleLoadoutUpgradedList (A Formlist form)

Rename each of them to match your plugin - in our case:

  • EnclaveSoldierJunkjetsLoadoutQuest

  • EnclaveSoldierJunkjetsLoadoutStarterList

  • EnclaveSoldierJunkjetsLoadoutUpgradedList

The renamed forms in EnclaveSoldierJunkjets.esp

Populating data

The Quest

Aside from renaming the loadout quest - you do not have to make any further changes to it. The quest has the AR_EnclaveECSInjectionSimpleScript script attached to it, which handles injecting the contents of both Formlists into the ECS System. Renaming the Formlists won’t break the link to the script, so that change is safe.

The Formlists

Formlists drive the ECS system. Each type of equipment - be it types of weapons (Automatic, Big Guns) or clothing (Officer clothing, Soldier underarmor, Soldier power armor) - must be in its own formlist, along with the relevant ECS Keyword that tells the ECS system where the equipment in the Formlist should go.

Looking at our two current Formlists:

  • EnclaveSoldierJunkjetsLoadoutStarterList

  • EnclaveSoldierJunkjetsLoadoutUpgradedList

The Starter list should contain all Formlists with equipment that should be used before the equipment in question is upgraded (typically after Armed and Dangerous)

The Upgraded list should contain all Formlists with equipment that should be used after the equipment in question is upgraded (typically after Armed and Dangerous)

In our example, we want to change our upgraded Enclave Soldier Automatic weapons to Junk Jets - so we can leave EnclaveSoldierJunkjetsLoadoutStarterList empty. The ECS system will simply ignore empty Formlists.

 

So to do this, we need to:

  1. Create a new Formlist named something appropriate - like EnclaveSoldierJunkjetLoadout

  2. Open your formlist - and add the relevant ECS Keyword to the top of your formlist. In this case, we want AR_ECS_Weapons_Auto, as this will instruct the ECS Controller that this formlist contains items that should be added to Enclave automatic weapons lists

  3. Now, add whatever equipment you’d like to the Formlist. Remember - everything in this Formlist will be added to the Enclave Automatic Weapons leveled lists. In our case we want to make soldiers use the Junk Jet, so we’ll add the Junkjet weapon to it

  4. Click “OK” to close your new Formlist, and add it to the Formlist you renamed earlier - EnclaveSoldierJunkjetsLoadoutUpgradedList

  5. Save your changes - and you’re almost done!

Replacing default America Rising 2 equipment

If you follow the above steps, your equipment addon is good to go - but there is one more thing you could do if you wanted.

If, rather than add to America Rising 2’s default equipment you wanted to replace it, you can do so very easily. This is driven by Global Variables.

Every equipment type has a pair of Global Variables - all prefixed AR_ECS_AllowDefaultLoadouts; one for Starter equipment and one for Upgraded equipment. Their default value is 1.

As the name suggests - if you want to allow the ECS System to use default loadouts for that type of equipment in addition to your equipment, do not touch the Global Variables.

If, however, you do not want to allow the ECS System to use default loadouts and only use equipment addons - change the value of the Global in question to 0.

For our example plugin, we want every Enclave soldier that uses an upgraded Automatic weapon to have a Junk Jet only - so we will change the value of AR_ECS_AllowDefaultLoadouts_Upgraded_Weapons_Auto to 0. This means they won’t ever use any of the Enclave Plasma auto weapons or Enclave AE-9A1 weapons.

 

Conclusion

That’s everything you need to know about the Equipment Control System - it can take a little while to get the hang of, but once you get used to it you can start making equipment addons that takes advantage of the equipment upgrade system very quickly - and it means you will never have to worry about mod conflicts/merges/etc when adding lots of new equipment to your Enclave NPCs!

Below is the example plugin we’ve just made.