-
Notifications
You must be signed in to change notification settings - Fork 4
Rules
Rules are stored in XML files called rule files. Multiple rule files may be associated with a plugin and multiple rules may be stored in a single rule file. The order in which rules are run depends on the plugin load order, file name and position in the rule file.
The tool will look for rule files using the following path and pattern:
{DataFolder}/Patcher/rules/{RuleSet}/{plugin.ext}/*.rules
By default, the tool will used the parent folder where its run from as as the Data Folder and rule set named default will be used as the rule set to run, but another data folder and rule set name may be specified via command line options. Note that only folders named after active plugins will be run.
Each rule may contain the following properties:
-
namerepresents the name of the rule. Giving rules unique names helps to identify a rule during troubleshooting. -
descriptionrepresents a long description of the rule which is not used by the tool in any way. -
frominforms the engine which kind of forms will be queried, e.g.GLOB,ARMO,ALCH. Whenfromproperty is not provided the rule will run only once, which is handy for creating new forms from scratch (not by making copies of existing forms). Note that whenFROMproperty is not provided propertieswhereandupdateproperties are ignored, andselectand eachinsertis performed exactly once. -
wherespecifies the criteria on which forms are queried, e.g.Source.HasKeyword("ArmorLight"). Whenwhereproperty is not provided the rule will run on all forms of type specified by thefromproperty. -
selectmakes no actual change and can be used for debugging or to tag a referenced form for further processing. -
updateoverrides an existing form or edits the form if it has been already overridden during an update operation of a previous rule. -
insertcreates a new form either based on an existing form or entirely form scratch. The kind of the new form has to be specified as well. A rule may contain any number ofinsertproperties.
The value of where, select, update and insert is an actual C# code that is compiled into methods.
The following graph shows every possible way a rule can be processed. The path depends on which properties are defined for the rule:

© 2015 Unforbidable Works