Part 0: What is RTFP?
It's a SFSE/ASI plugin that enables runtime record patching.
-It's esm-less, meaning you don't need to worry about 255 plugin limit and dependencies.
-It's fast, it can patch 300,000 records in 0.5 seconds (yes this crazy mod added 100k weapon mods)
-It's smart, meaning a patch will be skipped if the plugin to patch is not loaded
-It's on-demand, meaning you can include your RTFP patch in your mod file and have it lay dormant until the user install RTFP

Please read the guides from RTFP. You'll need to read at lease Part 1 and 2 to understand some concepts in this article.
Also, lines started with a # will not be processed, use them as comments!



Part 1: Preps
0. Download the patch template under misc file section. You'll be working with "Data\SFSE\plugins\RealTimeFormPatcher\_WFF_patch_template.txt" from now on.
1. Figure out the plugin name of the mod you want to patch ("YourPluginName.esm")
2. Figure out if all recipes from this mod for industrial workbench (or other workbenches, when they are supported in the future) can be ruled under one filter category. You can use SFEdit to load the plugin and check all COBJ records with "BNAM - Workbench Keyword" set to "WorkbenchIndustrialKeyword [KYWD:000AA209]".
-If they all fit into the same category, you can skip to Part 3.


Part 2: Adding selected recipes
There are several lines in the patch template not started with a #
minver=118|priority=-120

-Don't touch it for now.
[Constructible]
-This means we are patching recipes. Don't touch it.

YourPluginName.esm~123ABC|wrkbench_kwd(WorkbenchFilterFramework.esm~4)
Assuming the recipe COBJ in "YourPluginName.esm" has form id xx123ABC, and you want to change it into 4th category of this framework.
If the recipe is xx000DEF in "MyPluginName.esm", write like this:
MyPluginName.esm~DEF|wrkbench_kwd(WorkbenchFilterFramework.esm~4)
Use a tilde ~ to separate plugin name and form id, and leading zeros can be skipped.

To specify a filtered category, look at this list:
# 1=Components and resources
# 2=Melee
# 3=Ranged
# 4=Throwable
# 5=Ammo
# 6=Armor
# 7=Apparel
# 8=Accessory
# 9=Mod config items
# A=Misc, uncategorized, catch-all

For example, if you want to change the recipe to Melee category (2), write like this:
YourPluginName.esm~123ABC|wrkbench_kwd(WorkbenchFilterFramework.esm~2)
Copy and paste this line until you assigned all recipes you want to a category. Don't forget to change form id.
You can leave one category behind; there's a batch process method to save you from copy-pasting.

YourPluginName.esm~123ABC|wrkbench_kwd(ModThatAddsFilters.esm~F)
-Delete this line if you are not working with a custom filter from another mod. More on this in anotherr article.


Part 3: Batch adding recipes
There are some more lines in the patch template not started with a semicolon ; 
*plugin_incl(YourPluginName.esm)+has_wrkbench_kwd(Starfield.esm~AA209)|wrkbench_kwd(WorkbenchFilterFramework.esm~6)
-This means

for all recipes
...that are from YourPluginName.esm
...that have workbench keyword Starfield.esm~AA209(WorkbenchIndustrialKeyword)
, assign them to 6th category(Armor)

Keep in mind that patch processing are in line order; if you have assigned a recipe to a category in a previous line, that recipe will have have the new keyword upon processing this line, thus excluded. This is why you can leave one and exactly one category for batch processing.

If you want to patch most, but selected recipes to a category:
*plugin_incl(AnotherPlugin.esm)+has_wrkbench_kwd(Starfield.esm~AA209)+formid_excl(AnotherPlugin.esm~123,AnotherPlugin.esm~456)|wrkbench_kwd(WorkbenchFilterFramework.esm~5)
-This means
for all recipes
...that are from AnotherPlugin.esm
...that have workbench keyword Starfield.esm~AA209(WorkbenchIndustrialKeyword)
...that is not AnotherPlugin.esm~123 or AnotherPlugin.esm~456
, assign them to 5th category(Ammo)

You can use comma to separate multiple form ids in "formid_excl()".


Part 4: Wrap up
1. Remove all unused example lines from the file.
2. Rename the file to something unique. Keeping the filename as is is technically ok, but I guarantee someone will have the same idea as you did, creating "Unresolved conflicts" popup in some unlucky user's mod manager lol. I suggest the naming convention:
WFF_[Mod|Patch|AuthorBundle]_[ModName|AuthorName].txt
You can of course add more to the name if the mod name is too generic.
3. Pack the patch file as a mod, or submit to WFF Patch Central repository. Keep the folder structure (Data\SFSE\plugins\RealTimeFormPatcher\).
If you are creating a filter patch for your own mod, you can just bundle them in your mod file, the patch will be activated only when the end user has WFF installed.

Appendix: First line parameters
minver=118|priority=-120
-the patch will not be processed if RTFP version is lower than 1.18 (user will receive a popup in main menu after 5s)
--DO NOT change it under 118, it's the lowest you can get without encountering the plugin_incl() evaluation bug!
-the patch priority is -120.
127 (highest, processed first)
...
0 (default)
...
-110 (custom filter category default, ignore it for now)
...
-120 (WFF pach default)
...
-127 (WFF vanilla recipe patch)
-128 (lowest, processed last, WFF catch-all)
If you are making a patch for other's patch, or are making a collection that requires overriding of existing patches, adjust priority towards -127.

Article information

Added on

Edited on

Written by

ExoWarlock313

2 comments

  1. Moradinsoulforger
    Moradinsoulforger
    • member
    • 3 kudos
    This looks like there should be multiple WFF_ files, one (or more?!?) for each Author. I've been trying to get these filters to work for me for hours with limited success. Unfortunately, it appears that some items continue to show up in every category. I seemed to be having more luck building my own all-inclusive WFF than I had with WFF_AuthorBundle_TheOGTennessee and other bundles.

    I'm going to put this on hold for now,  VACATION TIME.
    1. ExoWarlock313
      ExoWarlock313
      • member
      • 30 kudos
      If recipes are showing across multiple categories, the patch is not changing the workbench keywords for the corresponding COBJ, check spelling, formid etc.
  翻译: