Académique Documents
Professionnel Documents
Culture Documents
------------------------------------------------------------
o How Rules work
A rule starts with a label, like "[Order]", and ends when a new rule
starts, or at the end of file.
Comments begin with ';'. When mlox reads rules, comments are first
stripped, and then blank lines are ignored.
mlox will recognize special characters in filenames used in the rule-base, and
expand them into files that exist in your load order.
First, there are 2 special metacharacters that are treated in the canonical
fashion: '?' and '*':
There is also a special construct: <VER> which matches something that looks
like a Version number in the filename. This will match the same version number
forms used in the [VER] predicate, refer to the documentation of that
predicate for more.
Examples:
[Note: expanding filenames in rules can be rather CPU intensive, so while they
are convenient, it is suggested that filename expansions be used sparingly.]
------------------------------------------------------------
o Ordering Rules
* The [Order] rule specifies the order of plugins. (In the following
example, plugin-1.esm comes before plugin-2.esp which comes before
plugin-N.esp, and so on). If two orderings conflict, the first one
encountered wins. Order conflicts are called "cycles", and an example
would be if we have one rule that puts aaa.esp before bbb.esp, and
another rule that puts bbb.esp before aaa.esp. Whenever we encounter a
rule that would cause a cycle, it is discarded.
[Order]
plugin-1.esm
plugin-2.esp
.
.
plugin-N.esp
For people that want to customize their load order, the [Order] rule is
probably all that is needed. Here is a simple example:
Let's say you want to make sure that mlox always puts plugin "Foo.esp" before
"Bar.esp". Just create a simple text file called "mlox_user.txt" in your mlox
directory (using Notepad or whatever) containing the following:
[Order]
Foo.esp
Bar.esp
From now on, when you press the mlox update button, mlox will make sure that
this is the order for those 2 plugins.
------------------------------------------------------------
oo The NearStart Rule
[NearStart]
plugin-1.esp
plugin-2.esp
.
.
plugin-N.esp
Normally there will be only one [NearStart] rule, for the main master
file, (Morrowind.esm). It is not a good idea to write lots of
[NearStart] rules. If you think you have to, we should talk. Use
[Order] rules to place plugins in relationship to each other.
------------------------------------------------------------
oo The NearEnd Rule
* The [NearEnd] rule specifies that one or more plugins should appear
as near as possible to the End of the load order.
[NearEnd]
plugin-1.esp
plugin-2.esp
.
.
plugin-N.esp
Note that "NearEnd" does not mean "put this plugin at the end of the
load order". Its meaning is closer to: move this plugin closer to the
end, where possible. For details on how NearEnd works, see the
document: "mlox_guts.txt"
------------------------------------------------------------
o Warning Rules
Note: Warnings are normally only given for "active" plugins (i.e., any
plugin listed in the [Game Files] section of Morrowind.ini). The set
of active plugins is often a subset of all plugins installed in your
data directory. If you wish to see warnings for all installed plugins,
use the "mlox.py -a" command.
------------------------------------------------------------
oo Messages
[CONFLICT]
Do not use
A.esp and B.esp together
A.esp
B.esp
------------------------------------------------------------
oo Boolean Expressions
This rule says to print the message "Whee!" if you have A.esp active
in your plugins list, along with any of B1.esp or B2.esp.
A.esp
This predicate states that A.esp, B.esp, and C.esp are all active in
your load order at the same time.
This means that A.esp, B.esp, and any of C.esp or D.esp are all active
in your load order at the same time.
[NOTE]
"Whee!"
[ALL A.esp [ANY B1.esp B2.esp]]
[NOTE "Whee!"]
[ALL A.esp
[ANY B1.esp B2.esp]]
[NOTE "Whee!"]
[ALL A.esp
[ANY B1.esp
B2.esp]]
----------------------------------------------------------------------
ooo The Desc predicate
It must all be on one line. The regex should be any normal Python
regular expression pattern:
http://docs.python.org/library/re.html#re-syntax
This predicate means plugin A.esp exists and the Description field of
the plugin header contains the regular expression /regex/. (If the
first slash is preceded by a bang, it means the description string
does not match the given regex). Here's an example:
[Note]
uses deprecated AddToLev* see: http://www.uesp.net/wiki/Tes3Mod:Leveled_Lists
[DESC /v. 1.1109/ Sris_Alchemy_BM.esp]
In this case, the note will only print out if the header of
Sris_Alchemy_BM.esp contains the pattern "v. 1.1109".
You can use a [DESC] predicate in any warning rule, just like any
other expression.
----------------------------------------------------------------------
ooo The Size predicate
The Size predicate is a special predicate that matches the filesize of the
plugin
where ### is the size of the file in bytes. (!### means that the filesize does
not match the given number).
[Note]
This file contains some GMSTs that need to be cleaned.
[SIZE 2476 moons_soulgems.esp]
In this case, the note will only print out if the size of moons_soulgems.esp
is 2476 bytes.
You can use a [SIZE] predicate in any warning rule, just like any other
expression.
----------------------------------------------------------------------
ooo The Ver predicate
The actual regular expression used for matching version numbers is:
(\d+(?:[_.-]?\d+)*[a-z]?)
The Ver predicate is a special predicate that first tries to match the
version number string stored in the plugin header, and if that fails
it tries to match the version number from the plugin filename. If a
version number is found, it can be used in a comparison
This predicate means plugin A.esp exists and the discovered version
number matches 1.0. The format does not have to match the original, as
both the given version number and the version number of the plugin are
converted to a canonical form before comparison. Here's an example:
[Note]
this is an old version, please upgrade
[VER < 1.2 foo.esp]
This is read: "print the Note if the version of the plugin is less
than 1.2". Note that you don't really need whitespace around the
comparison operator, but it is nice for readability.
You can use a [VER] predicate in any warning rule, just like any
other expression.
----------------------------------------------------------------------
oo The Note Rule
Alternate Syntax:
[Note]
optional multi-line comment
expr-1
expr-2
.
.
expr-N
(All the warning rules have a similar longer alternate syntax form as
shown here, which is omitted from now on for the brevity's sake).
The [Note] rule prints the given message when any of the following
expressions is true.
Here's how to print a message if any of A.esp, B.esp, C.esp are active:
[Note]
message
A.esp
B.esp
C.esp
[Note message]
[ALL A.esp [NOT X.esp]]
[ANY B.esp 7.esp]
[ALL C.esp elephant.esp potato.esp]
Note: from now on, we'll use the abbreviation <expr> to mean any
Boolean expression.
The [Note] rule is just a handy general rule that can be used for almost
any situation.
----------------------------------------------------------------------
oo The Requires Rule
[Requires]
"Assassins Armory - Arrows.esp" requires the Area Effect Arrows
plugin to be present
(Ref: "Assassin's Armory readme.doc")
Assassins Armory - Arrows.esp
[ANY AreaEffectArrows XB Edition.esp
AreaEffectArrows.esp]
The bit in the block message that starts with "(Ref:" is just a
Convention used to point you to the source of information where the
rule was taken from, it's often the readme for the mod, or a web page.
----------------------------------------------------------------------
oo The Conflict Rule
----------------------------------------------------------------------
oo The Patch Rule
It is sometimes the case that one of the original plugins has multiple
versions, in which case we could say:
[Patch message]
glue-patch.esp
[ALL original-X.esp
[ANY original-Y-MW-Only.esp
original-Y-TB+BM.esp]]
----------------------------------------------------------------------