mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
655 lines
38 KiB
HTML
655 lines
38 KiB
HTML
<!DOCTYPE html>
|
||
<meta charset="utf-8">
|
||
<title>LOOT Metadata Syntax</title>
|
||
<style>
|
||
/* This styling is from the report's typography.css file. The font paths
|
||
have been edited. */
|
||
/* Font definitions */
|
||
@font-face {
|
||
font-family: 'Roboto';
|
||
font-style: normal;
|
||
font-weight: 300;
|
||
src: url('../resources/report/fonts/Roboto-Light.ttf');
|
||
}
|
||
@font-face {
|
||
font-family: 'Roboto';
|
||
font-style: italic;
|
||
font-weight: 300;
|
||
src: url('../resources/report/fonts/Roboto-LightItalic.ttf');
|
||
}
|
||
@font-face {
|
||
font-family: 'Roboto';
|
||
font-style: normal;
|
||
font-weight: 400;
|
||
src: url('../resources/report/fonts/Roboto-Regular.ttf');
|
||
}
|
||
@font-face {
|
||
font-family: 'Roboto';
|
||
font-style: italic;
|
||
font-weight: 400;
|
||
src: url('../resources/report/fonts/Roboto-Italic.ttf');
|
||
}
|
||
@font-face {
|
||
font-family: 'Roboto';
|
||
font-style: normal;
|
||
font-weight: 500;
|
||
src: url('../resources/report/fonts/Roboto-Medium.ttf');
|
||
}
|
||
@font-face {
|
||
font-family: 'Roboto';
|
||
font-style: italic;
|
||
font-weight: 500;
|
||
src: url('../resources/report/fonts/Roboto-MediumItalic.ttf');
|
||
}
|
||
@font-face {
|
||
font-family: 'Roboto';
|
||
font-style: normal;
|
||
font-weight: 700;
|
||
src: url('../resources/report/fonts/Roboto-Bold.ttf');
|
||
}
|
||
@font-face {
|
||
font-family: 'Roboto';
|
||
font-style: italic;
|
||
font-weight: 700;
|
||
src: url('../resources/report/fonts/Roboto-BoldItalic.ttf');
|
||
}
|
||
|
||
/* Typography */
|
||
html {
|
||
font:11pt/1.429 Roboto, sans-serif;
|
||
color: rgba(0, 0, 0, 0.87);
|
||
font-weight: 400;
|
||
text-rendering: optimizeLegibility;
|
||
}
|
||
.display2, h1 {
|
||
font-weight: 400;
|
||
font-size: 3.214rem;
|
||
color: rgba(0, 0, 0, 0.54);
|
||
line-height: 1.067;
|
||
}
|
||
.headline, h2 {
|
||
font-weight: 400;
|
||
font-size: 1.714rem;
|
||
line-height: 1.333;
|
||
}
|
||
.title, h3 {
|
||
font-weight: 500;
|
||
font-size: 1.429rem;
|
||
/*letter-spacing: 0.005em;*/
|
||
}
|
||
.subhead, h4 {
|
||
font-weight: 400;
|
||
font-size: 1.143rem;
|
||
line-height: 1.75;
|
||
/* Alternate line height: */
|
||
/* line-height: 1.5; */
|
||
/*letter-spacing: 0.01em;*/
|
||
}
|
||
.button {
|
||
font-weight: 500;
|
||
font-size: 1rem;
|
||
text-transform: uppercase;
|
||
/*letter-spacing: 0.01em;*/
|
||
}
|
||
|
||
/* This styling is from the report's style.css file. */
|
||
a {
|
||
color: #2196F3;
|
||
text-decoration: none;
|
||
}
|
||
a:hover {
|
||
text-decoration: underline;
|
||
}
|
||
/* Tables */
|
||
table {
|
||
border-collapse: collapse;
|
||
background-color: #E8EAF6;
|
||
}
|
||
table td, table th {
|
||
vertical-align: top;
|
||
text-align: left;
|
||
padding: 8px 16px;
|
||
}
|
||
table th {
|
||
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
|
||
}
|
||
|
||
|
||
/* The styling below is specific to the readmes. */
|
||
h1, ol ol, ul ul, table {
|
||
margin: 0.5em 0;
|
||
}
|
||
h2, h3 {
|
||
margin-top: 2em;
|
||
margin-bottom: 0;
|
||
}
|
||
h4, ol, ul, p {
|
||
margin-top: 1em;
|
||
margin-bottom: 0;
|
||
}
|
||
ol ol {
|
||
list-style:lower-alpha;
|
||
}
|
||
pre > code, blockquote {
|
||
border: 1px solid rgba(0, 0, 0, 0.12);
|
||
border-radius: 2px;
|
||
padding: 16px;
|
||
margin: 16px;
|
||
display: table;
|
||
}
|
||
pre > code {
|
||
overflow-x: auto;
|
||
}
|
||
blockquote {
|
||
background: #eee;
|
||
}
|
||
code {
|
||
display: inline-block;
|
||
padding: 0 4px;
|
||
background: #eee;
|
||
}
|
||
a[href^=http]::after {
|
||
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 24 24" height="10px" width="10px" preserveAspectRatio="xMidYMid meet" fit="" style="pointer-events: none; display: block; color: #2196F3; fill: currentcolor; position: relative; top: -2px;"><g><path d="M9 5v2h6.59l-11.59 11.59 1.41 1.41 11.59-11.59v6.59h2v-10z"></path></g></svg>');
|
||
}
|
||
abbr {
|
||
cursor: help;
|
||
border-bottom: 1px dotted rgba(0, 0, 0, 0.12);
|
||
}
|
||
var {
|
||
color: #303F9F;
|
||
}
|
||
|
||
.clipper {
|
||
overflow: hidden;
|
||
}
|
||
</style>
|
||
<!-- LOOT
|
||
|
||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and Fallout: New Vegas.
|
||
|
||
Copyright (C) 2012–2015 WrinklyNinja
|
||
|
||
This file is part of LOOT.
|
||
|
||
LOOT is free software: you can redistribute
|
||
it and/or modify it under the terms of the GNU General Public License
|
||
as published by the Free Software Foundation, either version 3 of
|
||
the License, or (at your option) any later version.
|
||
|
||
LOOT is distributed in the hope that it will
|
||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
GNU General Public License for more details.
|
||
|
||
You should have received a copy of the GNU General Public License
|
||
along with LOOT. If not, see
|
||
<http://www.gnu.org/licenses/>.
|
||
-->
|
||
|
||
<h1>LOOT Metadata Syntax</h1>
|
||
|
||
<h2>Contents</h2>
|
||
<ol>
|
||
<li><a href="#intro">Introduction</a>
|
||
<li><a href="#filestruct">Metadata File Contents</a>
|
||
<li><a href="#structs">Data Structures</a>
|
||
<ol>
|
||
<li><a href="#structs-tag">Tag Data Structure</a>
|
||
<li><a href="#structs-file">File Data Structure</a>
|
||
<li><a href="#structs-message">Message Data Structure</a>
|
||
<li><a href="#structs-location">Location Data Structure</a>
|
||
<li><a href="#structs-dirty">Dirty Info Data Structure</a>
|
||
<li><a href="#structs-plugin">Plugin Data Structure</a>
|
||
</ol>
|
||
<li><a href="#cond">Condition Strings</a>
|
||
<ol>
|
||
<li><a href="#cond-function">Functions</a>
|
||
<li><a href="#cond-operator">The Negator & Junctors</a>
|
||
<li><a href="#cond-order">Order Of Evaluation</a>
|
||
</ol>
|
||
<li><a href="#lang">Language Codes</a>
|
||
<li><a href="#support">Version History</a>
|
||
<li><a href="#license">License</a>
|
||
</ol>
|
||
|
||
<h2 id="intro">Introduction</h2>
|
||
<p>The metadata syntax is what LOOT's masterlists and userlists are written in. If you know YAML, good news: the syntax is essentially just YAML 1.2. If you don't know YAML, then its <a href="https://en.wikipedia.org/wiki/YAML">Wikipedia page</a> is a good introduction. All you really need to know is:
|
||
<ul>
|
||
<li>How lists and associative arrays (key-value maps) are written.
|
||
<li>That whitespace is important, and that only normal spaces (ie. no non-breaking spaces or tabs) count as such.
|
||
<li>That data entries that are siblings must be indented by the same amount, and child data nodes must be indented further than their parents (see the example later in this document if you don't understand).
|
||
<li>That YAML files must be written in a Unicode encoding.
|
||
<li>That each key in a key-value map must only appear once per map object.
|
||
</ul>
|
||
<p>An important point that is more specific to how LOOT uses YAML:
|
||
<ul>
|
||
<li>Strings are case-sensitive, apart from file paths, regular expressions and checksums.
|
||
</ul>
|
||
<p>Some properties of file paths as used by LOOT:
|
||
<ul>
|
||
<li>They are evaluated as paths relative to the game's Data folder.
|
||
<li>They cannot reference a path outside of the game's folder structure, ie. they cannot contain the substring <code>../../</code>.
|
||
<li>Regular expression file paths must be written in the <a href="http://www.cplusplus.com/reference/regex/ECMAScript/">EMCAScript</a> syntax.
|
||
<li>Only the filename of a regex file path may contain non-literal regex syntax, ie. if the filename part of the regex file path is removed, the remainder must be an exact folder path (though with the regex syntax special characters escaped). For example, given the regex file path <code>Meshes\\Resources(1|2)\\(upperclass)?table.nif</code>, LOOT will look for a file named <code>table.nif</code> or <code>upperclasstable.nif</code> in the <code>Meshes\Resources(1|2)</code> folder, rather than looking in the <code>Meshes\Resources1</code> and <code>Meshes\Resources2</code> folders.
|
||
</ul>
|
||
<p>In this document, where a value's type is given as <code><var>X</var> list</code>, this is equivalent to a YAML sequence of values which are of the data type <var>X</var>. Where a value's type is given as <code><var>X</var> set</code>, this is equivalent to a YAML sequence of <strong>unique</strong> values which are of the data type <var>X</var>. Uniqueness is determined using the equality criteria for that data type. All the non-standard data types that LOOT's metadata syntax uses have their equality criteria defined later in this document.
|
||
|
||
<h2 id="filestruct">Metadata File Contents</h2>
|
||
<p>The root of a metadata file is a key-value map. LOOT will recognise the following keys, none of which are required:
|
||
<table>
|
||
<thead><tr><th>Key Name<th>Value Type<th>Notes
|
||
<tbody>
|
||
<tr><td><code>globals</code><td>message list<td>A list of message data structures for messages that are displayed independently of any plugin.
|
||
<tr><td><code>plugins</code><td>plugin list <i>and</i> plugin set<td>The plugin data structures that hold all the plugin metadata within the file. It is a mixture of a list and a set because <strong>no non-regex plugin value may be equal to any other non-regex plugin value</strong>, but there may be any number of equal regex plugin values, and non-regex plugin values may be equal to regex plugin values.
|
||
<p>If multiple plugin values match a single plugin, their metadata is merged in the order the values are listed, and as defined <a href="#structs-plugin-merge">later in this document</a>.
|
||
</table>
|
||
<p>Other keys may also be present, but are not processed by LOOT. The message and plugin data structures are detailed in the next section.
|
||
<p>An example metadata file:
|
||
<pre><code>globals:
|
||
- type: say
|
||
content: 'You are using the latest version of LOOT.'
|
||
condition: 'version("LOOT", "0.5.0.0", ==)'
|
||
plugins:
|
||
- name: 'Armamentarium.esm'
|
||
tag:
|
||
- Relev
|
||
- name: 'ArmamentariumFran.esm'
|
||
tag:
|
||
- Relev
|
||
- name: 'Beautiful People 2ch-Ed.esm'
|
||
tag:
|
||
- Eyes
|
||
- Graphics
|
||
- Hair
|
||
- R.Relations
|
||
</code></pre>
|
||
|
||
|
||
<h2 id="structs">Data Structures</h2>
|
||
<p>LOOT expects metadata to be laid out using a certain set of data structures, described in this section.
|
||
|
||
<h3 id="structs-tag">Tag Data Structure</h3>
|
||
<p>LOOT metadata files can contain suggestions for the addition or removal of Bash Tags, and this is the structure used for them. It has two forms: a key-value map and a scalar string.
|
||
|
||
<h4>Map Form</h4>
|
||
<p>All values in the map are strings.</p>
|
||
<table>
|
||
<thead><tr><th>Key Name<th>Required<th>Notes
|
||
<tbody>
|
||
<tr><td><code>name</code><td>✓<td>A Bash Tag, preceded by a minus sign if it is suggested for removal.
|
||
<tr><td><code>condition</code><td>✗<td>A condition string that is evaluated to determine whether this Bash Tag should be suggested: if it evaluates to true, the Tag is suggested, otherwise it is ignored. See <a href="#cond">Condition Strings</a> for details.
|
||
</table>
|
||
|
||
<h4>Scalar Form</h4>
|
||
<pre><code><var>tag</var></code></pre>
|
||
<p>where <code><var>tag</var></code> is equivalent to the value of the <code>name</code> key in the map form.
|
||
|
||
<h4>Equality</h4>
|
||
<p>Two tag data structures are equal if the lowercased values of their <code>name</code> keys are identical.
|
||
|
||
<h4>Examples</h4>
|
||
<pre><code>Relations</code></pre>
|
||
<pre><code>name: -Relations
|
||
condition: 'file("Mart''s Monster Mod for OOO.esm") or file("FCOM_Convergence.esm")'
|
||
</code></pre>
|
||
|
||
<h3 id="structs-file">File Data Structure</h3>
|
||
<p>Not to be confused with the structure of the metadata file itself, this structure can be used to hold file paths. It has two forms: a key-value map and a scalar string.
|
||
|
||
<h4>Map Form</h4>
|
||
<p>All values in the map are strings.</p>
|
||
<table>
|
||
<thead><tr><th>Key Name<th>Required<th>Notes
|
||
<tbody>
|
||
<tr><td><code>name</code><td>✓<td>An exact (ie. not regex) file path or name.
|
||
<tr><td><code>display</code><td>✗<td>A substitute string to be displayed instead of the file path in any generated messages, eg. the name of the mod the file belongs to.
|
||
<tr><td><code>condition</code><td>✗<td>A condition string that is evaluated to determine whether this file data should be used: if it evaluates to true, the data is used, otherwise it is ignored. See <a href="#cond">Condition Strings</a> for details.
|
||
</table>
|
||
|
||
<h4>Scalar Form</h4>
|
||
<pre><code><var>filepath</var></code></pre>
|
||
<p>where <code><var>filepath</var></code> is equivalent to the value of the <code>name</code> key in the map form.
|
||
|
||
<h4>Equality</h4>
|
||
<p>Two file data structures are equal if the lowercased values of their <code>name</code> keys are identical.
|
||
|
||
<h4>Examples</h4>
|
||
<pre><code>'../obse_loader.exe'</code></pre>
|
||
<pre><code>name: '../obse_loader.exe'
|
||
condition: 'version("../obse_loader.exe", "0.0.18.0", >=)'
|
||
display: 'OBSE v18+'
|
||
</code></pre>
|
||
|
||
<h3 id="structs-message">Message Data Structure</h3>
|
||
<p>Messages are given as key-value maps.
|
||
<table>
|
||
<thead><tr><th>Key Name<th>Value Type<th>Required<th>Notes
|
||
<tbody>
|
||
<tr><td><code>type</code><td>string<td>✓<td>The type string can be one of three keywords, see the table below for their semantics.
|
||
<tr><td><code>content</code><td>string <i>or</i> localised content list<td>✓<td>Either simply a string, or a list of localised content data structures. If the latter, one of the structures must be for English.
|
||
<tr><td><code>condition</code><td>string<td>✗<td>A condition string that is evaluated to determine whether the message should be displayed: if it evaluates to true, the message is displayed, otherwise it is not. See <a href="#cond">Condition Strings</a> for details.
|
||
<tr><td><code>subs</code><td>string list<td>✗<td>A list of strings to be substituted into the message content string. The content string must use numbered specifiers (<code>%1%</code>, <code>%2%</code>, etc.), where the numbers correspond to the position of the substitution string in this list to use, to denote where these strings are to be substituted.
|
||
</table>
|
||
<p>LOOT supports formatting of messages using <a href="https://help.github.com/articles/github-flavored-markdown">GitHub Flavored Markdown</a>. Support is provided by the <a href="https://github.com/chjj/marked">Marked</a> library (v0.3). Strings that get substituted into messages, such as file display names and dirty info utility strings, also support the same formatting options.
|
||
<p>LOOT handles messages and languages as follows:
|
||
<ol>
|
||
<li>If a message's <code>content</code> value is a string, the message will use the string as its content if displayed.
|
||
<li>If a message's <code>content</code> value is a list of localised content structures, then the first structure with a language that matches LOOT's current language will be used as the message's content if displayed. If there are no matches, then the first structure in English will be used.
|
||
</ol>
|
||
|
||
<h4>Message Types</h4>
|
||
<table>
|
||
<thead><tr><th>Keyword<th>Description
|
||
<tbody>
|
||
<tr><td><code>say</code><td>A generic message, useful for miscellaneous notes.
|
||
<tr><td><code>warn</code><td>A warning message, describing a non-critical issue with the user's mods (eg. dirty mods).
|
||
<tr><td><code>error</code><td>An error message, decribing a critical installation issue (eg. missing masters, corrupt plugins).
|
||
</table>
|
||
|
||
<h4>Localised Content Data Structure</h4>
|
||
<p>The localised content data structure is a key-value map, with all values being strings:
|
||
<table>
|
||
<thead><tr><th>Key Name<th>Required<th>Notes
|
||
<tbody>
|
||
<tr><td><code>str</code><td>✓<td>The actual message content string.
|
||
<tr><td><code>lang</code><td>✓<td>The language that <code>str</code> is written in, given as a POSIX language code. The languages LOOT supports are given in <a href="#lang">Language Codes</a>.
|
||
</table>
|
||
|
||
<h4>Equality</h4>
|
||
<p>The equality of two message data structures is determined by comparing the values of their <code>content</code> keys. As the values of the keys can be different types, a comparison value is selected for each message using the following logic:
|
||
<ul>
|
||
<li>If a value's type is a localised content list, then the English content string in that list is selected as the comparison value.
|
||
<li>If a value's type is a string, then that string is selected as the comparison value.
|
||
</ul>
|
||
<p>The two message data structures are then equal if their lowercased comparison values are identical.
|
||
|
||
<h4>Examples<br><small>(translations by Google)</small></h4>
|
||
<pre><code>type: say
|
||
condition: 'file("foo.esp")'
|
||
content:
|
||
- lang: en
|
||
str: 'An example link: <http://www.example.com>'
|
||
- lang: ru
|
||
str: 'Это пример ссылки: <http://www.example.com>'
|
||
</code></pre>
|
||
would be displayed as
|
||
<blockquote>
|
||
отмечать: Это пример ссылки: <a href="http://www.example.com">http://www.example.com</a>
|
||
</blockquote>
|
||
if the current language was Russian and <code>foo.esp</code> was installed, while
|
||
<pre><code>type: say
|
||
content: 'An alternative [example link](http://www.example.com), with no translations.'
|
||
</code></pre>
|
||
would be displayed as
|
||
<blockquote>
|
||
отмечать: An alternative <a href="http://www.example.com">example link</a>, with no translations.
|
||
</blockquote>
|
||
In English,
|
||
<pre><code>type: say
|
||
content: 'A newer version of %1% [is available](%2%).
|
||
subs:
|
||
- 'this plugin'
|
||
- 'http://www.example.com'
|
||
</code></pre>
|
||
would be displayed as
|
||
<blockquote>
|
||
Note: A newer version of this plugin <a href="http://www.example.com">is available</a>.
|
||
</blockquote>
|
||
|
||
|
||
<h3 id="structs-location">Location Data Structure</h3>
|
||
<p>This data structure is used to hold information on where a plugin is hosted online. It has two forms: a key-value map and a scalar string.
|
||
|
||
<h4>Map Form</h4>
|
||
<p>All values in the map are strings.</p>
|
||
<table>
|
||
<thead><tr><th>Key Name<th>Required<th>Notes
|
||
<tbody>
|
||
<tr><td><code>link</code><td>✓<td>A URL at which the plugin is found.
|
||
<tr><td><code>name</code><td>✗<td>A descriptive name for the URL, which may be used as hyperlink text.
|
||
</table>
|
||
|
||
<h4>Scalar Form</h4>
|
||
<pre><code><var>URL</var></code></pre>
|
||
<p>where <code><var>URL</var></code> is equivalent to the value of the <code>link</code> key in the map form.
|
||
|
||
<h4>Equality</h4>
|
||
<p>Two location data structures are equal if the lowercased values of their <code>link</code> keys are identical.
|
||
|
||
<h4>Examples</h4>
|
||
<pre><code>'http://skyrim.nexusmods.com/mods/19/'</code></pre>
|
||
<pre><code>link: 'https://steamcommunity.com/sharedfiles/filedetails/?id=419668499'
|
||
name: 'Unofficial Skyrim Patch on Steam Workshop'
|
||
</code></pre>
|
||
|
||
<h3 id="structs-dirty">Dirty Info Data Structure</h3>
|
||
<p>This structure holds information on which versions of a plugin are dirty, and how many identical-to-master records, deleted records and deleted navmeshes (if applicable) it contains. Dirty info is given as a key-value map.
|
||
<table>
|
||
<thead><tr><th>Key Name<th>Value Type<th>Required<th>Notes
|
||
<tbody>
|
||
<tr><td><code>crc</code><td>hexadecimal integer<td>✓<td>The CRC checksum of the dirty plugin, before cleaning. LOOT displays the CRCs of installed plugins in its report. The 8-character CRC should be preceded by <code>0x</code> so that it is correctly interpreted.
|
||
<tr><td><code>util</code><td>string<td>✓<td>The utility that should be used to clean the plugin.
|
||
<tr><td><code>itm</code><td>integer<td>✗<td>The number of identical-to-master records reported for the dirty plugin. If the number is unknown, this field should not be supplied. If the number is known and zero, this field should be supplied.
|
||
<tr><td><code>udr</code><td>integer<td>✗<td>The number of undeleted records reported for the dirty plugin. If the number is unknown, this field should not be supplied. If the number is known and zero, this field should be supplied.
|
||
<tr><td><code>nav</code><td>integer<td>✗<td>The number of deleted navmeshes reported for the dirty plugin. If the number is unknown, this field should not be supplied. If the number is known and zero, this field should be supplied.
|
||
</table>
|
||
|
||
<h4>Equality</h4>
|
||
<p>Two location data structures are equal if the values of their <code>crc</code> keys are identical.
|
||
|
||
<h4>Examples</h4>
|
||
<pre><code>crc: 0x3DF62ABC
|
||
util: '[TES5Edit](http://www.creationkit.com/TES5Edit_Cleaning_Guide_-_TES5Edit)'
|
||
itm: 4
|
||
udr: 160
|
||
nav: 0
|
||
</code></pre>
|
||
|
||
|
||
<h3 id="structs-plugin">Plugin Data Structure</h3>
|
||
<p>This is the structure that brings all the others together, and forms the main component of a metadata file. It is a key-value map.
|
||
<table>
|
||
<thead><tr><th>Key Name<th>Value Type<th>Required<th>Notes
|
||
<tbody>
|
||
<tr><td><code>name</code><td>string<td>✓<td>Can be an exact plugin filename or a regular expression plugin filename. If the filename contains any of the characters <code>:\*?|</code>, the string will be treated as a regular expression, otherwise it will be treated as an exact filename. For example, <code>Example\.esm</code> will be treated as a regular expression, as it contains a <code>\</code> character.
|
||
<tr><td><code>enabled</code><td>boolean<td>✗<td>Enables or disables use of the plugin object. Used for user rules, but no reason to use it in the masterlist. If unspecified, defaults to <code>true</code>.
|
||
<tr><td><code>priority</code><td>integer<td>✗<td>Modifies plugin position relative to others that change one or more of the same records, but which are otherwise unrelated (ie. neither plugin lists the other as a master, requirement, or in its <code>after</code> list). Plugins that don't change any of the same records are not compared, unless:
|
||
<ul>
|
||
<li>One of the plugins is an empty plugin, containing only a header record.
|
||
<li>One of the plugins has a priority greater than or equal to 1,000,000. In this case, only the modulo (ie. remainder when divided) with 1,000,000 is used when comparing plugin priority values – the rest is only used to signify that the plugin should be compared against all others.
|
||
</ul>
|
||
<p>For example, <code>priority: 153000352</code> and <code>priority: 352</code> have equal values when compared, but a plugin with the first priority will be compared against all others, while a (non-empty) plugin with the second priority will be compared against only those it conflicts with.
|
||
<p>A plugin with a higher priority value will load after a plugin with a lower priority value. The value can be anything in the range <code>-2000000000</code> to <code>2000000000</code>, and if unspecified defaults to <code>0</code>.
|
||
<tr><td><code>after</code><td>file set<td>✗<td>An unordered set of plugins that this plugin must load after, but which are not dependencies. Used for resolving specific compatibility issues and by user rules for specifying custom plugin positions.
|
||
<tr><td><code>req</code><td>file set<td>✗<td>An unordered set of files that this plugin requires to be present. This plugin will load after any plugins listed. If any of these files are missing, an error message will be displayed. Intended for use specifying implicit dependencies, as LOOT will detect a plugin's explicit masters itself.
|
||
<tr><td><code>inc</code><td>file set<td>✗<td>An unordered set of files that this plugin is incompatible with. If any of these files are present, an error message will be displayed.
|
||
<tr><td><code>msg</code><td>message list<td>✗<td>The messages attached to this plugin. The messages will be displayed in the order that they are listed.
|
||
<tr><td><code>tag</code><td>tag set<td>✗<td>An unordered set of Bash Tags suggested for this plugin. If a Bash Tag is suggested for both addition and removal, the latter will override the former when the list is evaluated.
|
||
<tr><td><code>url</code><td>location set<td>✗<td>An unordered set of locations for this plugin. If the same version can be found at multiple locations, only one location should be recorded. This metadata is not currently used by LOOT.
|
||
<tr><td><code>dirty</code><td>dirty info set<td>✗<td>An unordered set of dirty info structures for this plugin. Plugin entries with regular expression filenames <strong>must not</strong> contain dirty info.
|
||
</table>
|
||
|
||
<h4>Equality</h4>
|
||
<p>The equality of two plugin data structures is determined by comparing the values of their <code>name</code> keys.
|
||
<ul>
|
||
<li>If neither or both values are regular expressions, then the plugin data structures are equal if the lowercased values are identical.
|
||
<li>If one value is a regular expression, then the plugin data structures are equal if the other value is an exact match for it.
|
||
</ul>
|
||
|
||
<h4 id="structs-plugin-merge">Merging Behaviour</h4>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Key Name<th>Merge Behaviour (merging B into A)
|
||
<tbody>
|
||
<tr><td><code>name</code><td>Not merged.
|
||
<tr><td><code>enabled</code><td>Replaced by B's value.
|
||
<tr><td><code>priority</code><td>Replaced by B's value, unless that value is <code>0</code> and it was not explicitly set.
|
||
<tr><td><code>after</code><td>Merged. If B's file set contains an item that is equal to one already present in A's file set, B's item is discarded.
|
||
<tr><td><code>req</code><td>Merged. If B's file set contains an item that is equal to one already present in A's file set, B's item is discarded.
|
||
<tr><td><code>inc</code><td>Merged. If B's file set contains an item that is equal to one already present in A's file set, B's item is discarded.
|
||
<tr><td><code>msg</code><td>Merged. If B's message list contains an item that is equal to one already present in A's message list, B's item is discarded.
|
||
<tr><td><code>tag</code><td>Merged.If B's tag set contains an item that is equal to one already present in A's tag set, B's item is discarded.
|
||
<tr><td><code>url</code><td>Merged. If B's location set contains an item that is equal to one already present in A's location set, B's item is discarded.
|
||
<tr><td><code>dirty</code><td>Merged.If B's dirty info set contains an item that is equal to one already present in A's dirty info set, B's item is discarded.
|
||
</table>
|
||
|
||
<h4>Examples</h4>
|
||
<pre><code>name: 'Oscuro''s_Oblivion_Overhaul.esm'
|
||
req:
|
||
- 'Oblivion.esm' # Don't do this, Oblivion.esm is a master of Oscuro's_Oblivion_Overhaul.esm, so LOOT already knows it's required.
|
||
- name: 'example.esp'
|
||
display: '[Example Mod](http://www.example.com)'
|
||
condition: 'version("Oscuro''s_Oblivion_Overhaul.esm", "15.0", ==)'
|
||
tag:
|
||
- Actors.Spells
|
||
- Graphics
|
||
- Invent
|
||
- Relations
|
||
- Scripts
|
||
- Stats
|
||
- name: -Relations
|
||
condition: 'file("Mart''s Monster Mod for OOO.esm") or file("FCOM_Convergence.esm")'
|
||
msg:
|
||
- type: say
|
||
content: 'Do not clean. "Dirty" edits are intentional and required for the mod to function.'
|
||
</code></pre>
|
||
|
||
<h2 id="cond">Condition Strings</h2>
|
||
<p>Condition strings can be used to ensure that data is only acted on by LOOT under certain circumstances. They are very similar to boolean conditional expressions in programming languages such as Python, though more limited. Their <a href="https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form">EBNF</a> grammar is:
|
||
<pre><code>[ negator ], function, { junctor, [ negator ], function } ;</code></pre>
|
||
<p>The <code>[ negator ], function</code> grammar is referred to as a condition, and two conditions joined by an operator, ie. <code>condition, operator, condition</code> is referred to as a compound condition.
|
||
<p>LOOT caches the results of condition evaluations, so performance is not really an issue. A regular expression check will still take longer than a file check though, so use the former only when appropriate to do so.
|
||
|
||
<h3 id="cond-function">Functions</h3>
|
||
<p>There are several conditions that can be tested for using the functions detailed in the table below.
|
||
<table>
|
||
<thead><tr><th>Function<th>Syntax<th>Description
|
||
<tbody>
|
||
<tr><td>File<td><code>file("<var>filepath</var>")</code><td>Returns true if <var>filepath</var> is installed, false otherwise.
|
||
<tr><td>File<td><code>regex("<var>regex</var>")</code><td>Returns true if a file matching <var>regex</var> is found, false otherwise.
|
||
<tr><td>Many<td><code>many("<var>regex</var>")</code><td>Returns true if more than one file matching <var>regex</var> is found, and false otherwise.
|
||
<tr><td>Checksum<td><code>checksum("<var>filepath</var>", <var>checksum</var>)</code><td>Returns true if the calculated checksum of <var>filepath</var> matches <var>checksum</var>, false otherwise. If <var>filepath</var> does not exist, returns false.
|
||
<tr><td>Version<td><code>version("<var>filepath</var>", "<var>version</var>", <var>comparator</var>)</code><td>Returns true if the boolean expression <code>(actual version of <var>filepath</var>) <var>comparator version</var></code> holds true, false otherwise. If <var>filepath</var> does not exist and <var>comparator</var> is <code>==</code>, <code>></code> or <code>>=</code>, returns false. If <var>filepath</var> does not exist and <var>comparator</var> is <code>!=</code>, <code><</code> or <code><=</code>, returns true. The comparison is not a straightforward per-character comparison, but instead uses the precedence rules defined by <a href="http://semver.org/">Semantic Versioning</a>, extended to allow leading zeroes, an arbitrary number of release version numbers, case-insensitivity and a wider range of separator characters.
|
||
<tr><td>Plugin Active Status<td><code>active("<var>filepath</var>")</code><td>Returns true if <var>filepath</var> is a <code>.esp</code> or <code>.esm</code> file that is both installed and active, false otherwise.
|
||
</table>
|
||
|
||
<p>The different types of variable used in the above functions are described in more detail below.
|
||
<table>
|
||
<thead><tr><th>Variable Type<th>Description
|
||
<tbody>
|
||
<tr><td><code>filepath</code><td>A Windows file path, or <code>LOOT</code>, which references the LOOT executable being run.
|
||
<tr><td><code>regex</code><td>A regular expression string to match file paths to.
|
||
<tr><td><code>checksum</code><td>A string of hexadecimal digits representing an unsigned integer that is the data checksum of a file. LOOT displays the checksums of plugins in its user interface after running.
|
||
<tr><td><code>version</code><td>A string of characters representing the version of a plugin or executable. LOOT displays the versions of plugins in its user interface after running.
|
||
<tr><td><code>comparator</code><td>A comparison operator, ie. one of <code>==</code>, <code>!=</code>, <code><</code>, <code>></code>, <code><=</code> or <code>>=</code>, meaning "is equal to", "is not equal to", "is less than", "is greater than", "is less than or equal to" and "is greater than or equal to" respectively.
|
||
</table>
|
||
|
||
<h3 id="cond-operator">The Negator & Junctors</h3>
|
||
<p>The negator, or logical negation operator, inverts the value of the function that follows it. Its inclusion is optional, and its syntax is simply:
|
||
<pre><code>not</code></pre>
|
||
<p>Below is a truth table for the negator.
|
||
<table>
|
||
<thead><tr><th>Value of <code><var>function</var></code><th>Value of <code>not <var>function</var></code>
|
||
<tbody>
|
||
<tr><td>false<td>true
|
||
<tr><td>true<td>false
|
||
</table>
|
||
|
||
<p>There are two supported junctors, the logical conjunction (logical <q>and</q> operator) and the logical disjunction (logical <q>or</q> operator), that operate on the expressions to their left and right.
|
||
<table>
|
||
<thead><tr><th>Junctor<th>Syntax<th>Description
|
||
<tbody>
|
||
<tr><td>Logical Conjunction<td><code>and</code><td>Both conditions must evaluate to true for the compound condition to evaluate to true. If not, the compound condition evaluates to false.
|
||
<tr><td>Logical Disjunction<td><code>or</code><td>One condition or both conditions must evaluate to true for the compound condition to evaluate to true. If neither condition is true, then the compound condition evaluates to false.
|
||
</table>
|
||
<p>The following is a truth table for the junctors:
|
||
<table>
|
||
<thead><tr><th>Value of <code><var>condition1</var></code><th>Value of <code><var>condition2</var></code><th>Value of <code><var>condition1</var> and <var>condition2</var></code><th>Value of <code><var>condition1</var> or <var>condition2</var></code>
|
||
<tbody>
|
||
<tr><td>true<td>true<td>true<td>true
|
||
<tr><td>true<td>false<td>false<td>true
|
||
<tr><td>false<td>true<td>false<td>true
|
||
<tr><td>false<td>false<td>false<td>false
|
||
</table>
|
||
|
||
<h3 id="cond-order">Order Of Evaluation</h3>
|
||
<p>When a condition string is evaluated, its constituent parts are evaluated according to the standard precedence rules of operator logic, ie.
|
||
<ol>
|
||
<li>Function
|
||
<li>Negator
|
||
<li>Logical <q>and</q>
|
||
<li>Logical <q>or</q>
|
||
</ol>
|
||
<p>Below is a table that lists some combinations of conditions, showing for each the order of evaluation by explicit bracketing. To make it easier to read, the <code><var>negator</var> <var>function</var></code> pair is shortened to <code><var>C</var></code> after the first example.
|
||
<table>
|
||
<thead><tr><th>String Structure<th>Evaluated As
|
||
<tbody>
|
||
<tr><td><code><var>negator</var> <var>function</var></code><td><code>( <var>negator</var> ( <var>function</var> ) )</code>
|
||
<tr><td><code><var>C</var> and <var>C</var></code><td><code>( <var>C</var> and <var>C</var> )</code>
|
||
<tr><td><code><var>C</var> or <var>C</var></code><td><code>( <var>C</var> or <var>C</var> )</code>
|
||
<tr><td><code><var>C</var> and <var>C</var> and <var>C</var></code><td><code>( ( <var>C</var> and <var>C</var> ) and <var>C</var> )</code>
|
||
<tr><td><code><var>C</var> or <var>C</var> or <var>C</var></code><td><code>( ( <var>C</var> or <var>C</var> ) or <var>C</var> )</code>
|
||
<tr><td><code><var>C</var> and <var>C</var> or <var>C</var></code><td><code>( ( <var>C</var> and <var>C</var> ) or <var>C</var> )</code>
|
||
<tr><td><code><var>C</var> or <var>C</var> and <var>C</var></code><td><code>( <var>C</var> or ( <var>C</var> and <var>C</var> ) )</code>
|
||
<tr><td><code><var>C</var> and <var>C</var> and <var>C</var> and <var>C</var></code><td><code>( ( ( <var>C</var> and <var>C</var> ) and <var>C</var> ) and <var>C</var> )</code>
|
||
<tr><td><code><var>C</var> and <var>C</var> and <var>C</var> or <var>C</var></code><td><code>( ( ( <var>C</var> and <var>C</var> ) and <var>C</var> ) or <var>C</var> )</code>
|
||
<tr><td><code><var>C</var> and <var>C</var> or <var>C</var> and <var>C</var></code><td><code>( ( <var>C</var> and <var>C</var> ) or ( <var>C</var> and <var>C</var> ) )</code>
|
||
<tr><td><code><var>C</var> and <var>C</var> or <var>C</var> or <var>C</var></code><td><code>( ( ( <var>C</var> and <var>C</var> ) or <var>C</var> ) or <var>C</var>)</code>
|
||
<tr><td><code><var>C</var> or <var>C</var> or <var>C</var> or <var>C</var></code><td><code>( ( ( <var>C</var> or <var>C</var> ) or <var>C</var> ) or <var>C</var> )</code>
|
||
<tr><td><code><var>C</var> or <var>C</var> or <var>C</var> and <var>C</var></code><td><code>( ( <var>C</var> or <var>C</var> ) or ( <var>C</var> and <var>C</var> ) )</code>
|
||
<tr><td><code><var>C</var> or <var>C</var> and <var>C</var> or <var>C</var></code><td><code>( ( <var>C</var> or ( <var>C</var> and <var>C</var> ) ) or <var>C</var> )</code>
|
||
<tr><td><code><var>C</var> or <var>C</var> and <var>C</var> and <var>C</var></code><td><code>( <var>C</var> or ( ( <var>C</var> and <var>C</var> ) and <var>C</var> ) )</code>
|
||
</table>
|
||
<p>You can also explicitly enclose any condition in brackets to override the evaluation order, eg. <code><var>C</var> and ( <var>C</var> or <var>C</var> )</code> is evaluated as <code><var>C</var> and ( <var>C</var> or <var>C</var> )</code>, in contrast to the unbracketed string above.
|
||
|
||
<h2 id="lang">Language Codes</h2>
|
||
<p>LOOT supports the following languages and language codes:
|
||
<table>
|
||
<thead><tr><th>Language<th>POSIX Code
|
||
<tbody>
|
||
<tr><td>Brazilian Portuguese<td>pt_BR
|
||
<tr><td>Chinese<td>zh_CN
|
||
<tr><td>Danish<td>da
|
||
<tr><td>English<td>en
|
||
<tr><td>Finnish<td>fi
|
||
<tr><td>French<td>fr
|
||
<tr><td>German<td>de
|
||
<tr><td>Korean<td>ko
|
||
<tr><td>Polish<td>pl
|
||
<tr><td>Russian<td>ru
|
||
<tr><td>Spanish<td>es
|
||
</table>
|
||
|
||
<h2 id="support">Version History</h2>
|
||
|
||
<p>Each version of LOOT has a corresponding version of the metadata format, and its version history is given below.
|
||
|
||
<h3>0.8</h3>
|
||
<ul>
|
||
<li>Removed support for the <code>ver</code> key in location data structures.</li>
|
||
<li>Added support for the <code>name</code> key in location data structures.</li>
|
||
<li>Added support for the <code>many("<var>regex</var>")</code> condition function.</li>
|
||
<li>Changed detection of regular expression plugin entries. Previously, a plugin entry was treated as having a regular expression filename if the filename ended with <code>\.esp</code> or <code>\.esp</code>. Now, a plugin entry is treated as having a regular expression filename if the filename contains one or more of <code>:\*?|</code>.</li>
|
||
<li>The plugin data structure definition in this document was fixed so that it correctly gives the values of the <code>after</code>, <code>req</code>, <code>inc</code>, <code>tag</code>, <code>url</code> and <code>dirty</code> keys as sets, not lists.
|
||
<li>This document now defines the equality criteria for all of the metadata syntax's non-standard data structures.
|
||
<li>The algorithm used for version comparison has been changed to give better results for a wider variety of version strings.
|
||
</ul>
|
||
|
||
<h3>0.7</h3>
|
||
<ul>
|
||
<li>Changed support for Markdown formatting in messages. Previously, only URL hyperlinking was supported, and only for <code>file:</code>, <code>http:</code> and <code>https:</code> URLs using the <code>[label](url)</code> or <code><url></code> syntaxes. Now, the <a href="https://github.com/chjj/marked">Marked</a> library (v0.3) is used to provide support for most of GitHub Flavored Markdown, minus the GitHub-specific features (like @mentions, issue/repo linking and emoji).</li>
|
||
<li>Added support for message string substitution keys, i.e. <code>sub</code>, in message data structures.</li>
|
||
<li>Added support for YAML merge keys, i.e. <code><<</code>.</li>
|
||
</ul>
|
||
|
||
<h3>0.6</h3>
|
||
<p><i>No changes.</i></p>
|
||
|
||
<h3>0.5</h3>
|
||
<p><i>Initial release.</i></p>
|
||
|
||
<h2 id="license">License</h2>
|
||
<p>This document is part of the LOOT documentation.<br>
|
||
Copyright (C) 2012—2015 WrinklyNinja<br>
|
||
See the file <q>LOOT ReadMe.html</q> for copying conditions.
|