Please read the patch creation guide before proceeding

Part 0: Is custom filter category really needed?

Ask this question before you start.
Good use cases:
-You have a lot of recipes, say crafting of all misc items, that will spam any existing categories
-You have many recipes not suited for any 10 categories in this framework, say you added recipes for IKEA furniture kits that can be assembled on site
-You have many similar recipes that must be distinguished via category, say you added star wars armor crafting for both imperial and rebels
-You already have a standalone workbench and all recipes attached to it, say you patched your mod for New Workbench Essential Framework
-You are making a collection
Rebuttal:
-Unless you are actively developing submods for the mod, this filter is unlikely to be reused ever again
-If your recipes are unique enough to qualify for a standalone workbench, maybe it needs a standalone workbench
-Every new filter category added is an extra button press when cycling filters for end users. Menu selection is here, so this point is not as critical.
If you can't find your mod fitting in any of the good cases, or feel the drawback outweights the goods, stick to the 10 filters in the framework.



Part 1: Preps
0. Download the new filer example mod under misc file section. You'll be working with the txt files in "Data\SFSE\plugins\RealTimeFormPatcher\" from now on. You can also load the MyMod.esm into SFEdit for cross referencing.
1. Figure out if you already have a suitable keyword for the filter category. (MyMod.esm~123)
-If you already have all recipes exclusively linked to a workbench (via COBJ Workbench Keyword, not via condition hacks), use that keyword.
-If you are porting a "New Workbench Essential Framework" patch that uses the condition hack, just ditch the patch, it'll be actually easier to follow the steps here and start from the original mod.
-If you are just creating a new filter for your industrial workbench recipes, add a keyword in SFEdit.
2. Add a Message to the esm with "Full name" field filled in. It will be used to replace primary activation prompt on workbenches, so use phrases like "Craft MyMod Items". (MyMod.esm~456)
-If your mod does not have a Message section, right-click on the esm in SFEdit, Add->More->More->More->MESG - Messages



Part 2: Adding new filters
There are two cestions in the new filter template:
[FormList]
# Add your filter keyword
WorkbenchFilterFramework.esm~801|add(MyMod.esm~123)
# Add your filter name
WorkbenchFilterFramework.esm~802|add(MyMod.esm~456)
This scetion adds your filter to some form lists so it can be recognized by WFF script.
-WorkbenchFilterFramework.esm~801 is where you add the keyword
-WorkbenchFilterFramework.esm~802 is where you add the message
If you are adding multiple new filters, be sure to add both keywords and messages in order! If you are not sure, split into multiple files.

[Message]
# Add your filter name as a menu option (will replace filter cycling in the future, so don't skip this)
# Don't forget to change the label surrounded by quotes!
WorkbenchFilterFramework.esm~8FF|add_but("Craft MyMod items":~) 
This section is for futureproofing now compulsory. This line is to add the filter to the option list. Currently RTFP only accepts quoted texts here.


Part 3: Adding recipes
*If you already have all recipes exclusively linked to a workbench (via COBJ Workbench Keyword, not via condition hacks), you can skip this entirely
After adding your filters, you can assign your recipes to that category:

[Constructible]
*plugin_incl(MyMod.esm)+has_wrkbench_kwd(Starfield.esm~AA209)|wrkbench_kwd(MyMod.esm~123)
This assigns all industrial workbench recipes in the mod to the new filter.
Refer to the other guide for more details, just remember to change the keyword in wrkbench_kwd() to your ones.

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
WFF_AddFilter_[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. 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 and the new filter will be activated only when the end user has WFF installed.

Article information

Added on

Edited on

Written by

ExoWarlock313

0 comments

  翻译: