Fallout 4

This is a tutorial about how to patch a custom weapon to work with FCaB ammunition.

Can be done either with FO4 Edit or with the Creation Kit if you applied the Creation Kit Fixes by perchik71 to it since it allows easy .esp mastering.  Instructions below are specific to FO4 Edit.

If you haven't done so already, download the Custom Weapon Template Patch I provide in the Miscellaneous section of the File Downloads either through a mod manager, or extracting the FCaB - Blank Patch.esp found inside to the Data folder of your Fallout 4 directory.


So begin by opening up FO4Edit, and you'll be presented with a list of your mods.  Right-click the list and click "Select None", then find the  the FCaB - Blank Patch.esp and the esp of the weapon you want to patch and enable the check-boxes next to both of them.  When you do this, any Masters that the esp relies on (such as Fallout4.esm) will also be checked.  Press OK and wait for it to load.  Once it's loaded, find and pull up the perk entry "FCaB_BlankName_EnergyEfficiency" by clicking the "+" beside FCaB - Blank Patch.esp. 

Here you will find it contains a perk, a "magic effect" to apply the perk, a "spell" to apply the effect, and a quest to apply the spell to the player. As is all that need to be done for a simple patch is some editing in the perk, and the rest is taken care of.

Before we continue, right-click on "FCaB - Blank Patch.esp" and click "Add Masters" and checkbox the weapon .esp.  This makes sure you can access the weapon's unique keywords to work with.

Back in the perk, this is where the magic happens.  Here you'll define the weapon keyword, what module (barrels/receivers,ect) keywords are present on the weapon, then define how many shots will come out of that combination.

Lets start with a simple objective, lets make the weapon work with FCaB ammunition correctly.  If you view the first effect, you'll find these key lines:


Data - Effects Data
|_ Entry Point
    |_ Entry Point | Mod Ammo Health Mult      (This Entry Point states it will Modify Ammo Health with a Multiplier)
    |_ Function    | Mult Value                             (We'll use the function "Mult" for Multiply. In older version of my mod, I've used Set Value, but it's best not to use those)

Condition(s)
Type         | Equal to
Compare | 1.0
Function  | WornHasKeyword
Keyword  | ma_LaserGun [KYWD:XXXXXXX] (This states that as a condition, the Perk Owner must be wearing (equipped) anything with the keyword "ma_LaserGun" for the effect to work)

Function Parameters
|_ EPFT - Type  | Float
|_ EPFD - Data
    |_ Float          | 0.30 (This is the value that is to be applied to the function)


Here, you can read that the Perk effect "Mod Ammo Health Mult" will set the value to 0.3 if the player equips a weapon with the keyword ma_LaserGun.

Slowly Double-click the Keyword, and find the weapon's Mod Association keyword. This is simply a unique keyword for the weapon that used to attach weapon mods with that should go along the lines of "ma_WeaponName" such as "ma_LaserGun" found above.  Modders may also choose to put an initial before it as well for organizational purposes such as "AAA_ma_LaserGun"

The float at the bottom (followed by 0.30) determines how many shots will be produced per cell.  As is, the gun will now shoot 30 times before the next cell will need reloading.  Formula is the base number is 100, and it will be multiplied by the number in the float.  So 100 x 0.3 = 30 shots.

Your simple objective is complete and the weapon is ready to fire 30 shots per cell.

======================================================================

Now we can go farther. We can make different barrels and/or receivers (or any mod part really) affect shots per cell, all we need to do is spell it out with conditions.

First figure out the keywords of the omods you want to reference.  If the modder chose to use vanilla keywords, here are some common omod keywords:


dn_HasBarrel_null = Very Short Barrels or No Barrel add-ons such as Pipe Pistol
dn_HasBarrel_Short = Shorter Barrels, typically Pistol Barrels
dn_HasBarrel_Long = Longer, typically Rifle, Barrels
dn_HasBarrelSpinning = Automatic Energy Barrels
dn_HasBarrelSuper = Powerful, typically Sniper, Barrels
dn_HasReceiver_Standard = typically the standard/basic receivers
dn_HasReceiver_MoreDamage01 = used for Boosted/Hardened receivers
dn_HasReceiver_MoreDamage02 = used for Maximized/Powerful receivers
dn_HasReceiver_MoreDamage03 = used for Overcharged/Advanced receivers


Otherwise if a modder used custom keywords, you'll need to look those up on the respective omod.  If the omod lacks any added keywords by default, you'll need to choose a keyword and add it to the omod so you can reference them in your patch.

Now I present two different ways to do this.  The first example defines a combination of omods and establish the modifier for it and this has to be insisted for each combination.  The second example basically gives the weapon a default shot capacity, then additional entries will add modifiers to that default if the keywords match. 

Second one is considerably easier as you don't need to use as many keywords to define what you want and thus less work, but this works by multiplying our default multiplier.  So if you have multiple modules that affect shot capacity (say receiver, barrel, and magazine), they are each multipling into each other instead of adding like with ammo capacity (receiver x0.8, ) so you may not get the shot capacity you were expecting for specific combinations, especially if you are trying to match the original ammo capacity for your weapon.  For this reason, First example is best if you want to exactly define the shot capacity for a combination of modules, but you need to make sure you cover each combination of modules involved.


========================================================================================
Advanced: Example #1

Let's say your weapon has a short and long barrel and we want them both to have different shot capacity.  We'll make the short barrel fire 30 shots, and the long barrel fire 24 shots per cell.

Simply Right-click the space to the right of "Perk Conditions" and click "Add". This will add a new condition.  Slowly double-click each entry to edit the conditions to match the below.


Type        | Equal to
Compare | 1.0
Function | WornHasKeyword
Keyword | dn_HasBarrel_Short [KYWD:00025017]


Now the Short barrel gun will shoot 30 shots per cell, so now we need to define what the long barrel will shoot.

So now we need to add a whole new entry for the long barrel.  Right-click the space to the right of "Effects" and click "Add".  Then slowly double-click to edit the effect to the following:


PRKE - Header
|_ Type       | Entry Point
|_ Priority   | 2 < (Not important, but good for organization as this is the order it appears in the editor)

Data - Effects Data
|_ Entry Point
    |_ Entry Point | Mod Ammo Health Mult
    |_ Function     | Mult Value

Function Parameters
|_ EPFT - Type   | Float
|_ EPFD - Data
    |_ Float           | 0.24


Now right-click beside "Perk Condition", "Add", and make edits to match the below:


Type         | Equal to
Compare  | 1.0
Function  | WornHasKeyword
Keyword  | ma_WeaponName [KYWD:XXXXXXX]

Type         | Equal to
Compare  | 1.0
Function  | WornHasKeyword
Keyword  | dn_HasBarrel_Long [KYWD:00025014]


There, now you can close out FO4Edit to save it, make sure the patch plug-in is active in your mod manager, and test it out yourself.

=======================================================================
Advanced: Example #2

Let's say your weapon has an Overcharged Capacitor that you want to reduce shot capacity.  We'll take the example from before where the short barrel weapon will fire 30 shots and the long barrel weapon fires 24 shots per cell.  We'll make the Overcharged Capacitor reduce the shot capacity by 20%, making the short barrel weapon fire 24 shots per cell and the long barrel weapon fire 19 shots.

Continuing from the example above, you've already defined the default shot capacity for your weapon.  So now we need to add a whole new entry for the Overcharged Capacitor.  Right-click the space to the right of "Effects" and click "Add".  Then slowly double-click to edit the effect to the following:

PRKE - Header
|_ Type       | Entry Point
|_ Priority   | 2 < (Not important, but good for organization as this is the order it appears in the editor)

Data - Effects Data
|_ Entry Point
    |_ Entry Point | Mod Ammo Health Mult
    |_ Function     | Mult Value

Function Parameters
|_ EPFT - Type   | Float
|_ EPFD - Data
    |_ Float           | 0.80


Now right-click beside "Perk Condition", "Add", and make edits to match the below:


Type         | Equal to
Compare  | 1.0
Function  | WornHasKeyword
Keyword  | ma_WeaponName [KYWD:XXXXXXX]

Type         | Equal to
Compare  | 1.0
Function  | WornHasKeyword
Keyword  | dn_HasReceiver_MoreDamage3 [KYWD:000163042]  (Typically usedfor the most powerful receiver module)


There, now when the short barrel weapon has the Overcharged Capacitors, it will multiply 0.30 with 0.80, giving us a final multiplier of 0.24 to the shot capacity, and thus giving us 24 shots per cell.

You can close out FO4Edit to save it, make sure the patch plug-in is active in your mod manager, and test it out yourself.
=================================================================================================
Tips and Notes

1. When you set the final shot capacity in the perk, ensure that it falls below or equal to the ammo capacity for the weapon.  If you want it higher than the weapon's ammo capacity, you will need to manually increase the ammo capacity of the weapon; either on the weapon entry itself or its omods.  If the ammo capacity is lower then the shot capacity, the weapon will shoot the number of times as the ammo capacity then you'll reload your partially-charged cell for a fresh one (or the same one if it's your only cell), cluttering the ammo inventory.

2. Because of the way FCaB is set up, it's generally not recommended to set the shot capacity over 100 (float>1.0).  You can do so but understand that ammunition health is set to 101 so you will need to adjust your multiplier accordingly.  If you want or need to set shot capacity to exactly 100, you can make 2 entries with the same conditions: First to multiply by 1.99, then another to multiply by 0.5.  This will give you the final result of 101 x 0.995 = 100.495 rounded down to 100 shots.

3. If you want to make custom ammo have shot capacity/health (like say Small Energy Cells), simply right-click onto the new ammo entry, "Copy as override into..." your patch, and edit the ammo's Health to 101 (if you plan on shots per cell to be under 100), 501 or 1001 (if you want the shots per cell to be over 100) and set your multiplying float from there.

4.  You can always open up one of my weapon patches in your editor for a variety of completed examples to examine.

If you have any questions, you're welcome to ask in the comments on the main page or PM me. (Using the comments below will not notify me, so I can't respond promptly)

Article information

Added on

Edited on

Written by

JackRob

8 comments

  1. Anakin1773
    Anakin1773
    • member
    • 3 kudos
    "Copy as overwrite into..." doesn't exist in xEdit 4.0.4. Did you mean: "Copy as Override (with overwriting) into..."?
    1. JackRob
      JackRob
      • supporter
      • 60 kudos
      Sorry this is late, but "Copy as override into" is likely what you need to use here.  Not sure what "with overwriting" means honestly and google searches have not proven useful.
  2. Outrora
    Outrora
    • supporter
    • 47 kudos
    I added this comment on the mod's page, I posted it here too to increase my chances of getting a reply =):

    [I can't set the ammo or LL or enchantments for only a few weapons. I get a: "warning, could not be resolved but is possibly hardcoded into the engine", or it simply points to a different thing with a similar formID, usually some cell.

    Do you know why? It's driving me mad. Most weapons work just fine.]

    Thanks.
  3. drabmajesty97
    drabmajesty97
    • premium
    • 1 kudos
    I have it so it uses the correct ammo and it does add the perk I think, but the problem is it treats it like a gun magazine still so it shows the amount of ammo I had (3k but shown as 999) has the right magazine amount but its still like a gun magazine. It's for the gauss eraser pistol. I did the part for the basic functionality I think and I added the barrel that it uses for the laser ammo.
  4. XCABAL
    XCABAL
    • supporter
    • 1 kudos
    Edit: Disregard
  5. MrWolfe
    MrWolfe
    • member
    • 2 kudos
    Trying to follow this, but right off the bat the instructions don't work.

    The very first instruction:
    So begin by opening up FO4Edit, and only have the FCaB - Blank Patch and the weapon you want to patch enabled in the checkbox menu that pulls up.

    ...can't be completed because FO4Edit doesn't allow you to uncheck the base and DLC files. I figured this was just an oversight and continued on until I got to this:
    Before we continue, right-click on "FCaB - Blank Patch.esp" and click "Add Master" and checkbox the weapon .esp.  This makes sure you can access the weapon's unique keywords to work with.

    Right-clicking on "FCaB - Blank Patch.esp" and clicking "Add Masters" (there is no "Add Master" option) does bring up a list of checkboxes, but the weapon .esp (Makeshiftshotgun.esp in this case) is not in the list. It only shows the DLCCoast.esm and DLCNukaWorld.esm. I assume there's something we have to do first to get FO4Edit to recognize the weapon mod as a master file, but those steps were not included so at this point I'm stuck.
    1. JackRob
      JackRob
      • supporter
      • 60 kudos
      Sorry for the late reply, I don't get any notifications from this comment section.

      For the first part, this is simply oversight.  As you check the two esp that you're going to work on in FO4Edit, it will automatically enable any masters for them (in this case: Fallout4.esm, and all the DLCs forgoing the Official Hi-Res Texture Pack), so it goes without saying, but I'll try to reword it to explain that better.

      For the second part, "Add Masters" is the correct action (I think one of the recent updates of FO4Edit might have added that "s", will correct), but it's strange if your weapon esp (in this case Makeshiftshotgun.esp) doesn't show up in the checklist.  At the moment, I'm not sure what causes this as I haven't encountered this before, unless you simply did not load the weapon esp into FO4Edit.  I will try a couple of ideas out and edit this comment if I figure it out.

      EDIT:  I think the most likely reason this happened is that "Makeshiftshotgun.esp" is lower than "FCaB - Blank Patch.esp" in your load order.  Try rearranging your load order in your mod manager to where "Makeshiftshogun.esp" is above "FCaB - Blank Patch.esp" and try again.
  6. JackRob
    JackRob
    • supporter
    • 60 kudos
    I will update this article to change all instances of "Set Value" to "Multiply Value" instead, as this is easier to work with and can reduce the number of conditions and entries since you don't need to list every combination of weapon modules as you would with "Set Value".  This change will also be reflected in the 1.5 Version of FCaB.