Integrating Other Mods - jackeys/Power-Armor-to-the-People GitHub Wiki
A core goal of Power Armor to the People is to make its systems as compatible with other mods as possible, since bringing together other power armor mods coherently is central to what Power Armor to the People is trying to accomplish. This page outlines how to integrate with various aspects of Power Armor to the People, either as an external mod author or when adding another patch to Power Armor to the People.
FO4Edit is typically the best tool to use for integrating other mods since it allows you to view all of the overrides and conflicts between mods.
Faction Overhauls and NPC Changes
Power Armor to the People changes the templates used by many NPCs. If another mod overhauls a faction significantly, there may be a conflict in the NPC records due to changes in templates.
How Power Armor to the People Handles Templates
To make the spawn rate of power armored enemies configurable in MCM, NPC templates provided by Power Armor to the People follow a special pattern. Each template is an LVLN (Leveled Actor) that uses the Calculate All flag. The first entry, at level 0, is a leveled actor from Power Armor to the People with a name like PATTP_LCharRaiderPowerArmor_ChanceNone_GATED
. The second entry, at level 1, is the template that should be chosen if Power Armor to the People's configurable spawn rate determines that this enemy will NOT wear power armor (e.g. LCharRaider
).
Here is an example:
This template will then be used as an Inventory, Spell List, and Base Data template in NPC records where LCharRaider
was previously used to make those NPCs eligible to wear power armor.
For more information of how this system is used within Power Armor to the People, see the Configuration System.
Applying the Template
An NPC that is touched by only one mod
If you are making an NPC that is only touched by one plugin (e.g. there are no other mods overriding it) eligible for power armor, you just need to make the LVLN (Leveled Actor) discussed above to replace the template currently being used. For example, since the LVLN shown above chooses LCharRaider
if the power armored variant isn't chosen, we can replace the templates for an NPC that previously used LCharRaider
as a template:
The following diagram illustrates the relationship between the templates:
An NPC where a single override changes the templates
If you are trying to patch an NPC where a single mod on top of Power Armor to the People changes the templates, you can follow the same guidance above for the template added by the override. If the template only applies to one of the relevant template types (Inventory, Base Data, or Spell List), make sure that all three of these use the same template in your patch.
For example, here we see that CorpusPraesidium.esp changes templates that Power Armor to the People changed:
In this situation, we can create an LVLN with the Calculate All flag, PATTP_LCharSynthBossPowerArmor_ChanceNone_GATED
at level 0 for deciding if we will give the NPC synth power armor, and LCharSynthBoss02
at level 1 to use the template from the conflicting mod if the NPC doesn't get power armor.
Then, we can use that template to replace the templates for Inventory, Base Data, and Spell List in our patch for the original NPC record.
The following diagram illustrates the relationship between the templates:
An NPC where multiple overrides change the templates
In a more complex scenario where more than one other mod changes the templates, the same general rules apply, but an additional LVLN is needed to provide all of the possibilities added by other mods instead of directly referencing one of their templates.
For example, here we see a conflict where both CorpusPraesidium.esp and ImprovedInstitute.esp change templates that Power Armor to the People changed:
First, we want to make a new LVLN that does NOT use the Calculate All flag that contains the two new templates, imp_LCharSynthBoss
and LCharSynthBoss02
. This will be used to choose between the two if the NPC does not get power armor.
Then, we use this in a new LVLN with the Calculate All flag that has PATTP_LCharSynthBossPowerArmor_ChanceNone_GATED
at level 0 for deciding if we will give the NPC synth power armor, and our new LVLN at level 1.
Finally, we can use this as the template in the NPC record.
The following diagram illustrates the relationship between the templates:
Other Considerations
If you are adding an Inventory template to an NPC that did not have one before, it is often a good idea to make a copy of the original NPC to preserve its inventory and use it as the level 1 entry in the Calculate All LVLN so that the original inventory is used if the NPC is not power armored. As always, make sure the Inventory, Base Data, and Spell List point to the same template. The new copy that is now being used as an Inventory template should also use an NPC, not an LVLN, for its templates.
Adding Legendary Effects
Making Effects Available or Unavailable to Power Armor
By default, Power Armor to the People allows all legendary effects that can apply to any type of armor (LegendaryModRule_AllowedKeywords_ObjectTypeArmor
) or to only the chest (LegendaryModRule_AllowedKeywords_ArmorBodyPartChest
). If your legendary rule is using one of these for its AllowedKeywords
, it can be used for power armor in conjunction with Power Armor to the People. If you don't want it to apply to power armor, be sure to include ArmorTypePower
in your DisallowedKeywords
form list.
Power Armor to the People does not automatically allow legendary effects for legs, since these include reducing fall damage in the base game. If you have an effect that should be able to apply to power armor legs, you will need to create a new form list to use for AllowedKeywords
that includes ArmorTypeLeg
, dn_PowerArmor_LeftLeg
, and dn_PowerArmor_RightLeg
.
Likewise, if you have a new form list for AllowedKeywords
altogether, to provide your effect for helmets or arms or something else, you will need to provide an appropriate keyword that is present on power armor for it to be eligible. The dn_PowerArmor_
keywords for arms, legs, helmet, and chest are a great way to ensure it will work for all power armor sets, and if the player's game does not have any power armor available in the base legendary item lists, it won't effect them.
Adding Naming Rules
Added in Power Armor to the People 2.3.0
Power Armor to the People adds legendary naming rules to all of the power armor sets it supports, as well as a system for merging naming changes to all of those from an external mod. This heavily simplifies cascading naming changes to all of these power armor sets.
To make your naming changes show up across all of the power armor sets supported by Power Armor to the People, you need to do the following:
- Create Instance Naming Rules for the external mod with the legendary naming rules in Ruleset #0
- Merge your Instance Naming Rules contain the additions to
PATTP_dn_PowerArmor_Additions_External
(FormID B71) - Start the quest
PATTP_TriggerLegendaryNamingRulesMerge
(FormID B6B)
That's it. The systems within Power Armor to the People will make sure that these changes now get merged into the naming rules for every set of supported power armor. Note that this does not include the core game and DLC instance naming rules (i.e. dn_PowerArmor
), as many sorting mods make changes to these that may not be reflected in patches for the power armor mods. It is recommended that external mods directly merge naming rules to the core game and DLC Instance Naming Rules, since these may be different naming rules.
Example Usage
Using this approach also allows for naming rules to be merged solely by script, so no specific patch is needed. Here is an example Quest (which should run on start-up) that merges the naming rules if Power Armor to the People is present and looks for it each time the game loads if not:
Scriptname MergeNamingRulesIntoPAttP extends Quest const
InstanceNamingRules Property RulesToMerge Auto Const Mandatory
{The instance naming rules that should be merged into every power armor mod's naming rules}
Event OnQuestInit()
; Try to merge the naming rules now, but if that doesn't work, we will check for Power Armor to the People when the player loads the game
if !MergeNamingRulesForPAttP()
debug.trace(self + " could not find Power Armor to the People - registering for game load event until we can")
RegisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame")
endIf
EndFunction
bool Function MergeNamingRulesForPAttP()
; Get the naming rules we need to merge into and the quest we need to start without needing Power Armor to the People as a master
InstanceNamingRules PAttPNamingRules = Game.GetFormFromFile(0x00000B71, "Power Armor to the People.esp") as InstanceNamingRules
Quest PAttPTriggerMergeQuest = Game.GetFormFromFile(0x00000B6B, "Power Armor to the People.esp") as Quest
; If we found both of these, Power Armor to the People is loaded and a high enough version to support merging naming rules
if PAttPNamingRules && PAttPTriggerMergeQuest
debug.trace(self + " injecting armor naming rules into Power Armor to the People")
PAttPNamingRules.MergeWith(RulesToMerge)
PAttPTriggerMergeQuest.Start()
return true
endIf
return false
EndFunction
Event Actor.OnPlayerLoadGame(Actor akSender)
if MergeNamingRulesForPAttP()
debug.trace(self + " unregistering for game load event")
UnregisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame")
endIf
EndEvent
Supporting Sorting Mods
Sorting mods usually move the legendary naming ruleset to a different spot besides Ruleset #0 (e.g. R88 Simple Sorter will move them to Ruleset #1 after running the patcher). It is important to note that every power armor set will get the same naming rules merged in, so the user must make sure that all of them, as well as the mod adding naming rules, have appropriate sorting mod patches so the rulesets are the same number across all of them. Failure to do so will result in legendary names showing up in unexpected places.
Power Armor to the People only has official support for R88 Simple Sorter, and this only applies to the core and DLC Instance Naming Rules as far as matching the formatting of the R88 INNRs. Supporting this from an external mod only requires that the naming rules being merged in have moved the legendary names to Ruleset #1. Unofficial patches may exist for other sorting mods, such as VIS-G, so just make sure users are clear on how to use the external mod's sorting patches if multiple are available.
However, since sorting patches may not exist for all of the power armor sets that Power Armor to the People supports and naming rules merged using this method only apply to the power armor mods, a user does have the option of only using the sorting mod for the core and DLC sets in their game. This requires support from the external mod or patch, however, since it will need to merge a different set of naming rules into Power Armor to the People and the core/DLC rulesets.