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.
Tip |
---|
America Rising 2 - Loadout Template Plugin |
View file | ||
---|---|---|
|
Table of Contents
Table of Contents | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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
Info |
---|
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)
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.
So to do this, we need to: