LOOT

Introduction

LOOT is a plugin load order optimiser for TES IV: Oblivion, TES V: Skyrim, TES V: Skyrim Special Edition, Fallout 3, Fallout: New Vegas and Fallout 4. It is designed to assist mod users in avoiding detrimental conflicts, by automatically calculating a load order that satisfies all plugin dependencies and maximises each plugin’s impact on the user’s game.

LOOT also provides some load order error checking, including checks for requirements, incompatibilities and cyclic dependencies. In addition, it provides a large number of plugin-specific usage notes, bug warnings and Bash Tag suggestions for Wrye Bash.

While LOOT is able to calculate correct load order positions for the vast majority of plugins using only their content, it cannot do so for all plugins. As such, LOOT provides a mechanism for supplying additional plugin metadata so that it may sort them correctly. An online masterlist is provided to supply metadata for many plugins that need it, while users can make their own metadata additions, which are saved in their userlist.

LOOT is intended to make using mods easier, and mod users should still possess a working knowledge of mod load ordering. See Introduction To Load Orders for an overview.

Installation & Uninstallation

LOOT requires Windows 7 or later.

LOOT can be installed either using its automated installer or manually. If you are using the installer, just run it and follow the wizard steps. If installing manually, extract the downloaded archive to a location of your choice, then download and install the MSVC 2015 x86 redistributable if you don’t already have it installed.

If LOOT was installed using the installer, then use the uninstaller linked to in the Start Menu to uninstall LOOT. If LOOT was installed manually:

  1. Delete the files you extracted from the location you chose.
  2. Delete the LOOT folder in your local application data folder, which can be accessed by entering %LOCALAPPDATA% into Windows’ File Explorer.

Initialisation

When LOOT is run, it will attempt to detect which of the supported games are installed. If a default game has been set, LOOT will run for it, otherwise it will run for the same game as it last ran for. If the relevant game cannot be detected, or if there is no record of the last game LOOT ran for, it will run for the first detected game.

LOOT’s initialisation can be customised using command line parameters:

--game=<game folder name>:
Set the game to run for. If the supplied game folder name is valid, the default and last game values are ignored. The default folder names are Oblivion, Skyrim, Fallout3, FalloutNV and Fallout4.
--loot-data-path=<path>:
Set the path to use for LOOT’s application data storage. If this is an empty string or not specified, defaults to %LOCALAPPDATA%\LOOT on Windows and (in order of decreasing preference) $XDG_CONFIG_HOME/LOOT, $HOME/.config/LOOT or the current path on Linux.

If LOOT cannot detect any supported game installs, it will immediately open the Settings dialog. There you can edit LOOT’s settings to provide a path to a supported game, after which you can select it from the game menu.

Once a game has been set, LOOT will scan its plugins and load the game’s masterlist, if one is present. The plugins and any metadata they have are then listed in their current load order.

If LOOT detects that it is the first time you have run that version of LOOT, it will display a “First-Time Tips” dialog, which provides some information about the user interface that may not be immediately obvious.

The Main Interface

_images/main.png

The Header Bar

The header bar provides access to LOOT’s main features. Most of these features get disabled while the metadata editor is open, so if you’re trying to use an option that is faded out, first close the editor.

Game Menu

LOOT’s active game can be changed by clicking on it in the header bar, and selecting another game from the menu that is displayed. Games that have no install detected have their menu items disabled.

Masterlist Update & Sorting

The masterlist update process updates the active game’s masterlist to the latest revision at the location given by the game’s masterlist repository settings. If the latest revision contains errors, LOOT will roll back to the latest revision that works.

By default, sorting first updates the masterlist. LOOT then calculates a load order for your plugins, using their internal data and any metadata they may have. If a cyclic interaction is detected (eg. A depends on B depends on A), then sorting will fail.

Once LOOT has calculated a load order, it is compared with the current load order. If the current and calculated load orders are identical, LOOT will inform the user that no changes were made via a pop-up ‘toast’ notification. If the calculated load order contains changes, the plugin cards are sorted into that order and the masterlist update and sorting buttons are replaced with APPLY and CANCEL buttons, which apply and discard the calculated load order respectively. Changing games is disabled until the calculated load order is applied or discarded.

LOOT is able to sort plugins ghosted by Wrye Bash, and can extract Bash Tags and version numbers from plugin descriptions. Provided that they have the Filter Bash Tag present in their description, LOOT can recognise filter patches and so avoid displaying unnecessary error messages for any of their masters that may be missing.

Any errors encountered during sorting or masterlist update will be displayed on the “General Information” card.

Load Order Backups

Before a sorted load order is applied, LOOT saves a backup of the current load order as a loadorder.bak.0 text file in LOOT’s data folder for the current game. Up to three load order backups are retained: loadorder.bak.0 is the backup from the most recent load order change, loadorder.bak.1 is the second-most recent backup, and loadorder.bak.2 is the third-most recent backup.

Plugin Cards & Sidebar Items

Each plugin is displayed on its own “card”, which displays all the information LOOT has for that plugin, and provides access to plugin-specific functionality, including editing its metadata. Each plugin also has an item in the sidebar’s PLUGINS tab. The sidebar item contains the plugin’s name and icons for plugins that load archives or have user metadata. It also displays the plugin’s in-game load order index if the plugin is active. Clicking on a plugin’s sidebar item will jump to its card, while double-clicking will jump to its card and open it in the metadata editor.

The plugin card’s header holds the following information, some of which is only displayed if applicable:

  • The “Active Plugin” icon.
  • The plugin name.
  • The plugin’s version number, extracted from its description field.
  • The plugin’s CRC, which can be used to uniquely identify it. CRCs are only displayed after they have been calculated during conflict filtering or sorting, except the the CRC of the game’s main master file, which is never displayed.
  • The “Master File” icon.
  • The “Empty Plugin” icon.
  • The “Loads Archive” icon.
  • The “Verified clean” icon.
  • The “Has User Metadata” icon.
  • The plugin menu button, which provides access to metadata-related features for the plugin. These are explained in later sections.

Bash Tag suggestions and messages are displayed below the plugin card’s header.

If LOOT suggests any Bash Tags to be added, they will be displayed in green text, while any Bash Tags to be removed will be displayed in red text. For completeness, the list of Bash Tags to add will include any Bash Tags that are already specified in the plugin’s description field. Users generally don’t need to do anything with this information, as if they’re using Wrye Bash it will automatically apply LOOT’s suggestions, and if they’re not using Wrye Bash then this information doesn’t apply.

LOOT’s plugin messages are a valuable resource, acting as a means of providing users with information that they might otherwise not obtain. It is important for a stable, healthy game that you act on any messages that require action. If you think a message suggests an unnecessary action, report it to an official LOOT thread. If you encounter a message that is non-conditional, ie. it suggests an action but is still displayed on subsequent runs of LOOT after the action has been carried out, also report it to an official LOOT thread, so that it can be made conditional.

Filters

Clicking the FILTERS tab in the sidebar will replace the sidebar’s plugin list with a list of filter toggles that can be applied to hide various combinations of plugins and other content. The available filter toggles are:

Hide version numbers
Hides the version numbers displayed in blue next to those plugins that provide them.
Hide CRCs
Hides the CRCs displayed in orange next to those plugins that provide them.
Hide Bash Tags
Hides all Bash Tag suggestions.
Hide notes
Hides all plugin messages that have the Note: prefix, or the equivalent text for the language selected in LOOT’s settings.
Hide ‘Do not clean’ messages
Hides all messages that contain the text Do not clean, or the equivalent text for the language selected in LOOT’s settings.
Hide all plugin messages
Hides all plugin messages.
Hide inactive plugins
Hides all plugins that are inactive.
Hide messageless plugins
Hides all plugins that have no visible messages.

The filter toggles have their states saved on quitting LOOT, and they are restored when LOOT is next launched. There are also two other filters in the sidebar tab:

Show only conflicting plugins for…
This hides any plugins that don’t have the filter input value present in any of the text on their cards.
Show only plugins with cards that contain…
This filters the plugin cards displayed so that only plugins which conflict with this plugin will be visible. If this plugin loads an archive, other plugins that load archives which may contain conflicting resources are also displayed. Sorting with the conflict filter active will first deactivate it.

Editing Plugin Metadata

LOOT uses metadata to supply plugins with messages and Bash Tag suggestions, and to help it sort plugins that it can’t otherwise sort correctly. Users can add to their plugins’ metadata through the metadata editor panel, and plugins with user metadata are indicated with a “Has User Metadata” icon.

The editor panel is accessed by clicking the “Edit Metadata” item in a plugin’s menu, or by double-clicking a plugin name in the sidebar. Only one plugin’s metadata can be edited at a time. While the editor panel is open, the plugin sidebar also displays any non-zero plugin priorities, to aid setting new priority values. The editor can be resized by grabbing the top of the editor’s header and dragging it up or down.

The editor’s header displays the name of the plugin being edited, “Save Metadata” and “Cancel” buttons, and a row of tabs. The MAIN tab’s page contains the following inputs:

  • The “Enable Edits” toggle must be on for LOOT to use any user-added metadata, otherwise it will be ignored.
  • The “Global Priority” input sets the plugin’s global priority value, which is used to modify plugin position relative to all other plugins. Plugins with higher priority values load after plugins with lower priority values. Plugins have a default global priority of 0.
  • The “Priority Value” input sets the plugin’s local priority value, which is used to modify plugin position relative to other plugins that conflict, load archives or are empty. Plugins with higher priority values load after plugins with lower priority values. Plugins have a default local priority of 0.

The other tab pages contain metadata tables, which are detailed below. New rows can be added, and existing user-added rows can be removed, though rows containing metadata from the masterlist cannot. The LOAD AFTER, REQUIREMENTS and INCOMPATIBILITIES tables can have rows added by dragging and dropping plugins from the sidebar into the table area.

LOAD AFTER

This is a list of plugins which, if present, the current plugin must load after, but which are not required. This metadata can be used for resolving specific compatibility issues. Each entry has three fields:

  • The filename is the path, relative to the game’s Data folder, of the file to be checked for. This field is required. It gives the filenames of installed plugins as autocomplete suggestions.
  • The display name is optional, and if specified will be used instead of the filename in any error messages that are displayed if a problem is encountered relating to the file.
  • The condition is the optional condition string that is used to determine if the file should be checked for. If left blank, the file will always be checked for. Condition strings are a relatively advanced part of LOOT’s functionality, and their syntax is covered in the Metadata Syntax documentation.
REQUIREMENTS

This is a list of files that are required by the current plugin for it to function correctly. The current plugin will be loaded after any plugins listed. LOOT will also display an error message if any of the listed files are missing. Any file, not just plugins, can be listed here, and each entry has the same three fields as for the load after table.

Note that listing a plugin’s masters as requirements is unnecessary, as LOOT already checks them.

INCOMPATIBILITIES
This is a list of files that are incompatible with the plugin. LOOT will display an error message if any of the listed files are found. Any file, not just plugins, can be listed here, and each entry has the same three fields as for the load after table.
MESSAGES

A list of messages that are to be displayed for the plugin in LOOT’s report. These have no bearing on a plugin’s position in the load order. Each message has four fields:

  • The type is fairly self-explanatory, and is used to provide messages of varying severity with appropriate emphasis in LOOT’s report.
  • The content is the actual message text.
  • The condition is, like for the corresponding file field, used to determine if the message should be displayed. If left blank, the message is displayed.
  • The language is the language LOOT runs in that the message will be displayed for. This field has no effect for user-added messages, as they cannot contain multiple localisations, and LOOT will always display messages that have only one localisation, even if it doesn’t match the current language.

If a message’s condition determines that it should not be displayed, then it will not be displayed, no matter the language. However, if a message’s condition determines that it should be displayed, but the language is specified and doesn’t match the language LOOT is running in, the message will not be displayed.

BASH TAGS

A list of Bash Tags. These are used by Wrye Bash when generating a Bashed Patch, and are detailed in Wrye Bash’s readme. LOOT’s metadata includes Bash Tag addition and removal suggestions, and any Bash Tags that came with the plugin are also displayed.

As LOOT can suggest Bash Tags be added or removed, it is possible for the same Tag to appear twice, being suggested for addition and removal. In such cases, removal overrides addition.

Each Bash Tag has three fields:

  • The state determines whether the Tag is to be suggested for addition or removal.
  • The name is the actual Bash Tag name. The field gives autocomplete suggestions for Bash Tags supported by the current game.
  • The condition decides if the Tag is to be suggested or not. It functions as for files and messages.

If a plugin’s masters are missing, an error message will be displayed for it. Filter patches are special mods designed for use with a Bashed Patch that do not require all their masters to be present, and so any plugin with the Filter tag applied and missing masters will not cause any errors to be displayed.

DIRTY PLUGIN INFO

A list of dirty plugin CRCs and related information. Each row has five fields:

  • The CRC of the dirty plugin.
  • The ITM Count for the dirty plugin.
  • The number of Deleted References that the dirty plugin contains.
  • The number of Deleted Navmeshes that the dirty plugin contains.
  • The name of the Cleaning Utility to use to clean the dirty plugin.

LOOT uses the information supplied to construct a warning message for the plugin if it matches any of the given CRCs.

CLEAN PLUGIN INFO

A list of clean plugin CRCs and the utility they were verified clean by. Each row has two fields:

  • The CRC of the clean plugin.
  • The name of the Cleaning Utility to use to verify that the plugin is clean.

LOOT uses the information supplied to display an icon on the plugin’s card if it matches any of the given CRCs.

LOCATIONS

A list of URLs that the mod to which the plugin belongs can be found at. This metadata is not currently used by LOOT, but it may be useful to record it. Each location has two fields:

  • The URL at which the plugin’s parent mod can be found.
  • The Name you wish to give the URL.

Editing Settings

_images/settings.png

LOOT’s settings may be accessed through the main menu.

General Settings

Default Game
If set to something other than Autodetect, this overrides game autodetection. If the game specified is not detected, LOOT falls back to autodetection.
Language
Controls the language LOOT uses. Any plugin messages that do not have translations in the selected language will be displayed in English, if available, or in their available language otherwise.
Enable Debug Logging
If enabled, writes debug output to %LOCALAPPDATA%\LOOT\LOOTDebugLog.txt. Debug logging can have a noticeable impact on performance, so it is off by default.
Update masterlist before sorting
If checked, LOOT will update its masterlist, should an update be available, before sorting plugins.

Game Settings

LOOT’s game-specific settings can be customised in the games table. New game profiles can be added, making it easy to use LOOT across multiple copies of a game, including total conversion mods. LOOT ships with settings for the “Nehrim - At Fate’s Edge” total conversion mod as an example. Game profiles can also be deleted, though the active game cannot have its profile deleted, and LOOT will recreate the profiles for the base games it supports (Oblivion, Skyrim, Fallout 3, Fallout: New Vegas, Fallout 4) when it is next run.

Name
The name of the game, or another identifying text, that is displayed in menus and the LOOT’s title bar.
Base Game Type

Every game LOOT runs for must use the plugin file format and load order system of one of the following games:

  • TES IV: Oblivion
  • TES V: Skyrim
  • Fallout 3
  • Fallout: New Vegas
  • Fallout 4
LOOT Folder Name
The sub-folder which LOOT uses to store the game’s files in. Each game must be given a unique sub-folder.
Master File
The game’s main master file. This is checked for when detecting if the game is installed.
Masterlist Repository URL

The URL of the repository that LOOT uses to update its local copy of the masterlist. If left empty, masterlist updating will be skipped.

Masterlist repositories are Git repositories that are configured to allow unauthenticated read access and contain a masterlist file named masterlist.yaml in their root directory. The LOOT team maintains a set of official repositories for the games that LOOT supports by default.

Masterlist Repository Branch
The branch of the masterlist repository that LOOT should get masterlist updates from.
Install Path
The path to the game’s folder, in which the Data folder lies. Either this or a registry key must be supplied.
Install Path Registry Key
The registry key, in HKEY_LOCAL_MACHINE, that contains the install path of the game. This is used to obtain the install path if LOOT has no previous record of the game’s install path, or LOOT’s stored install path is invalid. Either this or an install path must be supplied.

Themes

LOOT’s user interface has CSS theming support. A dark theme is provided with LOOT: to use it, rename dark-theme.css in the resources/ui/css folder to theme.css. A working knowledge of CSS is required to create new themes, though the provided dark theme CSS file is commented to provide some assistance.

Contributing & Support

LOOT is very much a community project, and contributions from its users are very welcome, whether they be metadata, translations, code or anything else. The best way to contribute is to make changes yourself at GitHub! It’s the fastest way to get changes you want applied, and you’ll get your name automatically immortalised in our credits.

If you encounter an issue with LOOT, check the Frequently Asked Questions page in case a solution is available there. Otherwise, general discussion and support takes place in LOOT’s official forum thread, which is linked to on LOOT’s homepage.

If you want to submit metadata, the easiest way to do so is to add the metadata to your own LOOT install, then use the Copy Metadata feature to easily get it in a form that you can then edit into a masterlist on GitHub or post in the official forum threads.

Information on dirty plugins is very welcome, but for such information to be useful we require at least the filename and the CRC of the dirty plugin. The CRC may be calculated using Wrye Bash or 7-Zip, with other sources being unverified as correct. In the case of 7-Zip, the “CRC checksum for data” is the one required. Any other information, such as the ITM record and deleted reference counts, is very welcome.

Credits

LOOT is developed on GitHub, and a full list of GitHub contributors may be found here.

LOOT’s masterlists were largely converted from BOSS‘s masterlists, and so credit is due to the very large number of sources and people who have contributed to them.

In addition, the following are credited with application-related support:

  • Original icon: jonwd7
  • Translations:
    • Brazilian Portuguese: Kassane
    • Chinese: bluesky404
    • Danish: Freso
    • Finnish: 3ventic
    • French: Kaos
    • German: lpradel
    • Korean: SteamB23
    • Polish: Łukasz Niemczyk
    • Russian: Tokc.D.K.
    • Spanish: Sharlikran
    • Swedish: Mikael Hiort af Ornäs
  • Beta testing: Too many to list, thank you all!

LOOT is written in C/C++, HTML5, CSS3 and JavaScript, and uses the Boost, Jed, Jed Gettext Parser, libespm, libgit2, libloadorder, Marked, pseudosem, Polymer and yaml-cpp libraries, and the Chromium Embedded Framework.

Version History

Only application history is recorded here. A full history of masterlist changes may be viewed by browsing the GitHub repositories.

0.10.3 - 2017-01-08

Added

  • LOOT now creates a backup of the existing load order when applying a sorted load order. The backup is stored in LOOT’s folder for the current game, and up to the three most recent backups are retained.

Changed

  • If no game is detected when LOOT is launched and a valid game path or Registry key pointing to a game path is added in the Settings dialog, LOOT will select that game and refresh its content when the new settings are applied.
  • Most exception-derived errors now display a generic error message, as exception messages are no longer translatable. Only metadata syntax exceptions still have their message displayed in the UI.
  • Improved robustness of error handling when calculating file CRCs.
  • Improved consistency of error logging.
  • Errors and warnings are now always logged, even when debug logging is disabled.
  • The First Time Tips and About dialogs are now fully translatable, with the exception of the legal text in the About dialog.
  • Updated Russian translation.

Fixed

  • A crash on startup if none of the supported games were detected.
  • A crash when applying settings when none of the supported games are detected.
  • Buttons and menu items for performing game-specific operations are now disabled while none of the supported games are detected.
  • Initialisation error messages were formatted incorrectly.
  • An error message reading Cannot read property 'textContent' of undefined could be displayed on startup due to UI elements initialising later than expected.
  • The texts of the first plugin card and sidebar item were not being translated.
  • LOOT now logs being unable to find a game’s registry entry as [info], not [error].
  • If an error was encountered while loading a userlist, constructing the error message produced a boost::too_many_args error that obscured the original error.
  • The installer now checks for v14.0.24215 of the MSVC Redistributable, it was previously checking for v14.0.24212, which some users found insufficient.

0.10.2 - 2016-12-03

Added

  • Support for specifying the path to use for LOOT’s local data storage, via the --loot-data-path parameter.

Changed

  • The metadata editor now displays an error message when the user inputs invalid priority values, in addition to the input’s existing red underline styling for invalid values, and instead of validating the values when trying to save the metadata.
  • LOOT’s icon now scales better for high-DPI displays.
  • LOOT’s UI is now built as many loose files instead of one large HTML file, to aid debugging and development.
  • Updated Chinese translation.
  • Updated Chromium Embedded Framework to 3.2840.1517.gd7afec5.
  • Updated libgit2 to 0.24.3.
  • Updated Polymer to 1.7.0, and also updated various Polymer elements.

Fixed

  • A crash could occur if some plugins that are hardcoded to always load were missing. Fixed by updating to libloadorder v9.5.4.
  • Plugin cleaning metadata with no info value generated a warning message with no text.
  • The LOOT update checker will no longer display an empty error dialog if the update check is unable to connect to the GitHub API (eg. if offline).
  • Redate Plugins was accidentally disabled for Skyrim SE in v0.10.1, and had no effect for Skyrim SE in v0.10.0.
  • Having more than ~ 100 plugins installed could make the sidebar’s plugin list appear on top of dialogs.
  • More UI text has been made available for translation.
  • Tweak some text formatting to include more context for translators.
  • Dirty plugin warning messages now distinguish between singular and plural forms for their ITM, deleted reference and deleted navmesh counts, to allow the construction of more grammatically-correct messages in English and other languages.
  • The UI text for the metadata editor was always displayed in English even when LOOT was set to use another language, despite translations being available.
  • It was possible to open the metadata editor during sorting by double-clicking a plugin in the sidebar.
  • Removed a duplicate section in the documentation for editing metadata.

0.10.1 - 2016-11-12

Changed

  • When saving a load order for Fallout 4 or Skyrim SE, the official plugins (including DLC plugins) are no longer written to plugins.txt to match game behaviour and improve interoperability with other modding utilities.
  • LOOT now uses Skyrim Special Edition as the folder name for storing its Skyrim SE data, to mirror the game’s own folder naming and improve interoperability with other modding utilities, and automatically renames any SkyrimSE folder created by LOOT v0.10.0.
  • Updated Russian translation.
  • Updated Chinese translation.

Fixed

  • When saving a load order for Fallout 4 or Skyrim SE, the positions of official plugins (including DLC plugins) in plugins.txt are now ignored if they are present and a hardcoded order used instead. Note that there is a bug in Skyrim SE v1.2.39 that causes the DLC plugins to be loaded in timestamp order: this behaviour is ignored.
  • If the LOOT installer installed the MSVC redistributable, the latter would silently force a restart, leading to possible data loss.
  • It was possible to open the metadata editor between sorting and applying/cancelling a sorted load order, which would then cause an error when trying to close the editor. The editor is now correctly disabled during the sort process.

0.10.0 - 2016-11-06

Added

  • Support for TES V: Skyrim Special Edition.
  • Swedish translation by Mikael Hiort af Ornäs (Lakrits).
  • More robust update checker, so now LOOT will notify users of an update without needing a masterlist to be present or for it to be updated for the new release, and will also detect when the user is using a non-release build with the same version number.

Changed

  • LOOT now supports v0.10 of the metadata syntax. This breaks compatibility with existing syntax, which may cause existing user metadata to fail to load. See the syntax version history for the details.
  • The Global Priority toggle button in the metadata editor has been replaced with an input field to reflect the change in syntax for global priorities.
  • Added a “Clean Plugin Info” tab to the metadata editor, for editing metadata that identifies a plugin as being clean.
  • Added a “Verified clean” icon to plugin cards that is displayed for plugins that are identified as clean.
  • All operations triggered from the UI are now processed asynchronously, which may have a minor positive effect on perceived performance.
  • Error messages displayed in dialog boxes no longer include an error code.
  • Rewrote the documentation, which is now hosted online at Read The Docs.
  • Updated Simplified Chinese translation.
  • Updated Russian translation.
  • Updated German translation.
  • Updated Danish translation.
  • Updated CEF to 3.2840.1511.gb345083 and libgit2 to 0.24.2.

Fixed

  • Cached plugin CRCs causing checksum conditions to always evaluate to false.
  • Data being loaded twice when launching LOOT.
  • Updating the masterlist when the user’s TEMP and TMP environmental variables point to a different drive than the one LOOT is installed on.
  • Incorrect error message display when there was an issue during initialisation.
  • Sidebar plugin load order indices not updating when sorting changed plugin positions.
  • The “Has User Metadata” icon not displaying when priority metadata was changed.

0.9.2 - 2016-08-03

Added

  • Theming support and the dark theme have been reimplemented and reintroduced.
  • Plugin filename and Bash Tag name fields will now autocomplete in the metadata editor.
  • The in-game load order indices of active plugins are now displayed in the sidebar.

Changed

  • Most URLs now use HTTPS.
  • The Danish and French translations have been updated.
  • The CEF (3.2743.1442.ge29124d), libespm (2.5.5), Polymer (1.6.0) and Pseudosem (1.1.0) dependencies have been updated to the versions given in brackets.

Fixed

  • Error when applying filters on startup.
  • Hidden plugin and message counters not updating correctly after sorting.
  • An error occurring when the user’s temporary files directory didn’t exist and updating the masterlist tried to create a directory there.
  • The installer failing if LOOT was previously installed on a drive that no longer exists. The installer now always gives the option to change the default install path it selects.
  • Startup errors being reported incorrectly and causing additional errors that prevented the user from being informed of the original issue.
  • The metadata editor’s CRC input field being too short to fully display its validation error message.
  • Errors when reading some Oblivion plugins during sorting, including the official DLC.
  • Some cases where LOOT would fail to start.
  • The conflict filter not including the Unofficial Skyrim Legendary Edition Patch’s plugin (and any other plugin that overrides a very large number of records) in results.
  • The “not sorted” message reappearing if the load order was sorted twice in one session and cancelled the second time.
  • Version numbers where a digit was immediately followed by a letter not being detected.

0.9.1 - 2016-06-23

Added

  • Support for Fallout 4’s Contraptions Workshop DLC, and the upcoming Vault-Tec Workshop and Nuka-World DLC. Support for the latter two is based on their probable but unconfirmed plugin names, which may be subject to change.

Changed

  • The content refresh menu item is now disabled during sorting.
  • The conflicts filter toggle buttons have been removed from the plugin card menus, and the filter re-implemented as a dropdown menu of plugin names in the Filters sidebar tab.
  • Enabling the conflicts filter now scrolls to the target plugin, which is no longer highlighted with a blue border.
  • The layout of the Filters sidebar tab has been improved.
  • The CEF (3.2704.1427.g95055fe), and libloadorder (9.4.0) dependencies have been updated to the versions given in brackets.
  • Some code has been refactored to improve its quality.

Removed

  • Support for Windows Vista.

Fixed

  • User dirty metadata being read-only in the metadata editor.
  • LOOT incorrectly reading a tag with no name from plugin descriptions containing {{BASH:}}.

0.9.0 - 2016-05-21

Added

  • Support for Fallout 4.
  • A warning message is displayed in the General Information card if the user has not sorted their load order in the current LOOT session.
  • An error message is displayed in the General Information card when a cyclic interaction sorting error is encountered, and remains there until sorting is next attempted.

Changed

  • Improve sorting performance by only reading the header when loading game’s main master file.
  • References to “BSAs” have been replaced with the more generic “Archives” as Fallout 4’s BSA equivalents use a different file extension.
  • The sorting process now recognises when the sorted load order is identical to the existing load order and informs the user, avoiding unnecessary filesystem interaction.
  • The metadata editor has been reimplemented as a single resizeable panel displayed below the plugin card list instead of a separate editor for each plugin card.
  • Editable table styling has been improved to more closely align to the Material Design guidelines.
  • Minor UI changes have been made to scrollbar and focus outline styling to improve accessibility.
  • UI interaction performance has been improved, especially when scrolling the plugin card list.
  • The PayPal donation link now points to the PayPal.Me service, which has a more polished UX and lower fees.
  • LOOT’s settings file handling has been reimplemented, fixing crashes due to invalid settings values and allowing missing settings to use their default values.
  • Plugin version string extraction has been reimplemented, improving its accuracy and maintainability.
  • Plugin CRC, file and version condition evaluation has been optimised to use cached data where it exists, avoiding unnecessary filesystem interaction.
  • The French and Danish translations have been updated.
  • The installer now only creates one shortcut for LOOT in the Start menu, following Microsoft guidelines.
  • A lot of code has been refactored and improved to increase its quality.
  • The Boost (1.60), CEF (3.2623.1401.gb90a3be), libespm (2.5.2), libgit2 (0.24.1), libloadorder (9.3.0) and Polymer (1.4) dependencies have been updated to the versions given in brackets.

Removed

  • The Flattr donation link.
  • The experimental theming support, as its implementation was incompatible with Polymer 1.2’s styling mechanisms.

Fixed

  • Redate Plugins attempted to redate plugins that were missing, causing an error.
  • LOOT would not launch when run by a user with a non-ASCII local application data path.
  • Sorting processed priority value inheritance throughout the load order incorrectly, leading to some plugins being positioned incorrectly.
  • The conflict filter displayed only the target plugin when enabled for the first time in a session.
  • The behaviour of the search functionality was inconsistent.
  • Duplicate messages could be displayed under certain circumstances.
  • Opening the metadata editor for one plugin displayed the metadata for another plugin under certain circumstances.
  • Changing the current game quickly could leave the UI unresponsive.
  • Applying a filter then scrolling the plugin card list would display some cards with no content.
  • Plugin cards would disappearing when jumping to a plugin card near the bottom of the load order using the sidebar.
  • Clicking on a disabled element in a dropdown menu would cause the menu to close.
  • The UI font size was too large, due to a misunderstanding of the Material Design guidelines.
  • Attempting to build native Linux and 64-bit executables produced errors. Such builds are unsupported and no official builds are planned.

0.8.1 - 2015-09-27

Added

  • Checks for safe file paths when parsing conditions.

Changed

  • Updated Chinese translation.
  • Updated Boost (1.59.0), libgit2 (0.23.2) and CEF (branch 2454) dependencies.

Fixed

  • Crash when loading plugins due to lack of thread safety.
  • The masterlist updater and validator not checking for valid condition and regex syntax.
  • The masterlist updater not working correctly for Windows Vista users.

0.8.0 - 2015-07-22

Added

  • Support for loading custom user interface themes, and added a dark theme.

Changed

  • Improved detail of metadata syntax error messages.
  • Improved plugin loading performance for computers with weaker multithreading capabilities (eg. non-hyperthreaded dual-core or single-core CPUs).
  • LOOT no longer displays validity warnings for inactive plugins.
  • LOOT now displays a more user-friendly error when a syntax error is encountered in an updated masterlist.
  • Metadata syntax support changes, see the metadata syntax document for details.
  • LOOT’s installer now uses Inno Setup instead of NSIS.
  • LOOT’s installer now uninstalls previous versions of LOOT silently, preserving user data, instead of displaying the uninstaller UI.
  • Updated German and Russian translations.
  • Updated libgit2 to v0.23.0.

Fixed

  • “Cannot read property ‘push’ of undefined” errors when sorting.
  • Many miscellaneous bugs, including initialisation crashes and incorrect metadata input/output handling.
  • Metadata editors not clearing unsaved edits when editing is cancelled.
  • LOOT silently discarding some non-unique metadata: an error message will now be displayed when loading or attempting to apply such metadata.
  • Userlist parsing errors being saved as general messages in the userlist.
  • LOOT’s version comparison behaviour for a wide variety of version string formats. This involved removing LOOT’s usage of the Alphanum code library.

0.7.1 - 2015-06-22

Added

  • Content search, accessible from an icon button in the header bar, and using the Ctrl-F keyboard shortcut.
  • “Copy Load Order” feature to main menu.

Changed

  • LOOT now uses versioned masterlists, so that new features can be used without breaking LOOT for users who haven’t yet updated.
  • Moved content filter into Filters sidebar tab. The Ctrl-F keyboard shortcut no longer focusses the content filter.
  • Checkbox-toggled filters now have their last state restored on launch.
  • Darkened background behind cards to increase contrast.
  • Updated French translation.

Fixed

  • LOOT UI opening in default browser on launch.
  • “No existing load order position” errors when sorting.
  • Message filters being ignored by plugin cards after navigating the list.
  • Output of Bash Tag removal suggestions in userlists.
  • Display of masterlist revisions where they were wrongly interpreted as numbers.

0.7.0 - 2015-05-20

Added

  • Danish and Korean translations.
  • If LOOT can’t detect any installed games, it now launches to the settings dialog, where the game settings can be edited to allow a game to be detected.
  • A “Copy Content” item in the main menu, to copy the plugin list and all information it contains to the clipboard as YAML-formatted text.
  • A “Refresh Content” item in the main menu, which re-scans plugin headers and updates LOOT’s content.
  • LOOT is now built with High DPI display support.
  • Masterlist updates can now be performed independently of sorting.
  • A “First-Time Tips” dialog will be displayed on the first run of any particular version of LOOT.
  • Attempting to close LOOT with an unapplied sorted load order or an open plugin editor will trigger a confirmation dialog.
  • Support for GitHub Flavored Markdown in messages, minus features specific to the GitHub site, such as @mentions and emoji.
  • Support for message content substitution metadata syntax in the masterlist.
  • Display of LOOT’s build revision has been added to the “About” dialog.
  • Plugin location metadata can now be added through the user interface.
  • A content filter, which hides plugins that don’t have the filter text present in their filenames, versions, CRCs, Bash Tags or messages.

Changed

  • New single-window HTML5-based interface and a new icon, based on Google’s Material Design.
    • LOOT now parses the masterlist and plugin headers on startup, and the resulting content is displayed with the plugins in their current load order.
    • Each plugin now has its own editor, and multiple editors can be opened at once.
    • Drag ‘n’ drop of plugins from the sidebar into metadata editor tables no longer requires the conflicts filter to be enabled.
    • CRCs are calculated during conflict filtering or sorting, so are notdisplayed until either process has been performed.
    • The “View Debug Log” menu item has been replaced with a “Open Debug Log Location” menu item to make it easier to share the file itself.
    • Debug logging control has been simplified to enable/disable, replacing the “Debug Verbosity” setting with an “Enable Debug Logging” toggle.
    • Changes to game settings now take immediate effect.
    • Masterlist updating now exits earlier if the masterlist is already up-to-date.
    • Masterlist revisions are now displayed using the shortest unique substring that is at least 7 characters long.
    • Making edits to plugin metadata before applying a calculated load order no longer causes LOOT to recalculate the load order. Instead, the displayed load order is applied, and the metadata edits will be applied the next time sorting is performed.
    • All references to “UDRs” have been replaced by the more technically-correct “Deleted References” term.
    • The “Hide inactive plugin messages” filter has been replaced by a “Hide inactive plugins” filter.
    • Copied metadata is now wrapped in BBCode [spoiler][code]...[/code][/spoiler] tags for easier pasting into forum posts.
    • The Summary and General Messages cards have been combined into a General Information card.
  • Sorting performance improvements.
  • Updated Boost (1.58.0), libgit2 (0.22.2) and libloadorder dependencies.

Removed

  • Messages with multiple language strings can no longer be created through the user interface. User-added multiple-language messages will be converted to single-language strings if their plugin’s editor is opened then closed using the “OK” button.
  • The “Copy Name” menu item has been removed, as plugin names can now be selected and copied using Ctrl-C.
  • As LOOT no longer generates reports, it doesn’t save them either.

Fixed

  • The settings.yaml included with the installer was very old.
  • Inactive incompatibilities were displayed as error messages. They are now displayed as warnings.
  • Masterlist entries that matched the same plugin were not being merged. Now one exact match and any number of regex matches will be merged.
  • Masterlist updating failed when a fast-forward merge was not possible (eg. when remote has been rebased, or a different repository is used). Such cases are now handled by deleting the local repository and re-cloning the remote.
  • Masterlist updating failed when the path to LOOT’s folder included a junction link.
  • Masterlists would not ‘update’ to older revisions. This can be useful for testing, so now they can do so.
  • Crashes when trying to read corrupt plugins and after masterlist update completion.
  • LOOT would crash when trying to detect a game installed to a location in which the user does not have read permissions, now such games are treated as not being installed.
  • Plugins with non-ASCII description text would cause codecvt to wstring errors.
  • LOOT would accept any file with a .esp or .esm extension as a plugin. It now checks more thoroughly, by attempting to parse such files’ headers.
  • LOOT would only detect Skyrim plugins as loading BSAs. Plugins for the other games that also load BSAs are now correctly detected as such.
  • Depending on the plugins involved, sorting could produce a different load order every time it was run. Sorting now produces unchanging load orders, using existing load order position where there is no reason to move a plugin.

0.6.1 - 2014-12-22

Added

  • German translation.
  • The Large Address Aware flag to the LOOT executable.

Changed

  • Updated Boost (1.57.0), wxWidgets (3.0.2) and libloadorder (6.0.3) dependencies.
  • The game menu is now updated when the settings window is exited with the “OK” button.
  • Updated Russian translation.
  • Updated Brazilian Portuguese translation.

Fixed

  • Default Nehrim registry entry path.
  • Messages in the wrong language being selected.
  • LOOT windows opening off-screen if the screen area had been changed since last run.
  • Read-only .git folders preventing repository deletion.
  • Unnecessary plugins in cyclic dependency error messages.
  • Bash Tag suggestions displaying incorrectly.
  • The current game can no longer be deleted from the settings window.
  • Plugin metadata being lost when the settings window was exited with the “OK” button, leading to possible condition evaluation issues.
  • A blank report bug when running on systems which don’t have Internet Explorer 11 installed.
  • Reports appearing empty of all content when no global messages are to be displayed.

Security

  • Updated libgit2 to 0.21.3, which includes a fix for a critical security vulnerability.

0.6.0 - 2014-07-05

Added

  • Display of masterlist revision date in reports.
  • Report filter for inactive plugin messages.
  • The number of dirty plugins, active plugins and plugins in total to the report summary.
  • A find dialog to the report viewer, initiated using the Ctrl-F keyboard shortcut.
  • LOOT’s windows now remember their last position and size.
  • Command line parameter for selecting the game LOOT should run for.
  • Finnish translation.

Changed

  • Unified and improved the metadata editors launched during and outside of sorting.
    • The metadata editor now resizes more appropriately.
    • The mid-sorting instance hides the requirement, incompatibility, Bash Tags, dirty info and message lists.
    • Both instances now have a conflict filter, priority display in their plugin list and drag ‘n’ drop from the plugin list into whatever metadata lists are visible.
    • The mid-sorting instance also hides the load after entry edit button, and the button to add new entries (so drag ‘n’ drop is the only available method of adding entries).
    • The metadata editor now displays plugins with user edits using a tick beside their name, rather than bolding their name text.
    • Plugins that have been edited in the current instance have their list entry text bolded.
    • Checkboxes have been added to set whether or not a priority value is “global”. The UI also now displays the priority value used in comparisons (ie. with the millions and higher digits omitted).
    • A right-click menu command for clearing all user-added metadata for all plugins has been added to the metadata editor.
  • Missing master/requirement and incompatibility errors are downgraded to warnings if the plugin in question is inactive.
  • Masterlist update errors have been made more user-friendly.
  • If an error is encountered during masterlist update, LOOT will now silently delete the repository folder and attempt the update again. If it fails again, it will then report an error.
  • Masterlist update now handles repository interaction a lot more like Git itself does, so should be less error-prone.
  • Cyclic dependency error messages now detail the full cycle.
  • LOOT’s report now uses a static HTML file and generates a javascript file that is dynamically loaded to contain the report data. This removes the PugiXML build dependency.
  • Debug log message priorities adjusted so that medium verbosity includes more useful data.
  • Updated dependencies: libgit2 (v0.21.0), wxWidgets (v3.0.1), libloadorder (latest), libespm (latest).

Removed

  • Support for Windows XP.
  • Support for loading BOSS masterlists using the API. This was a leftover from when LOOT was BOSSv3 and backwards compatibility was an issue.
  • The ability to open reports in an external browser. This was necessitated by the changes to report generation.
  • The MSVC 2013 redistributable requirement.
  • The “None Specified” language option is no longer available: English is the new default.

Fixed

  • The uninstaller not removing the Git repositories used to update the masterlists.
  • Miscellaneous crashes due to uncaught exceptions.
  • Plugin priorities are now temporarily “inherited” during sorting so that a plugin with a low priority that is made via metadata to load after a plugin with a high priority doesn’t cause other plugins with lower priorities to be positioned incorrectly.
  • The default language is now correctly set to English.
  • Defaults for the online masterlist repository used for Nehrim.
  • Endless sorting loop that occurred if some user metadata was disabled.

0.5.0 - 2014-03-31

  • Initial release.

Introduction

LOOT is a utility that helps users avoid serious conflicts between their mods by setting their plugins in an optimal load order. It also provides tens of thousands of plugin-specific messages, including usage notes, requirements, incompatibilities, bug warnings and installation mistake notifications, and thousands of Bash Tag suggestions.

This metadata that LOOT supplies is stored in its masterlist, which is maintained by the LOOT team using information provided by mod authors and users. Users can also add to and modify the metadata used by LOOT through the use of userlist files. The LOOT API provides a way for third-party developers to access this metadata for use in their own programs.

Miscellaneous Details

String Encoding

  • All output strings are encoded in UTF-8.
  • Input strings are expected to be encoded in UTF-8.
  • File paths are case-sensitive if and only if the underlying file system is case-sensitive.
  • WriteMinimalList() writes a metadata list encoded in UTF-8.

Errors

All errors encountered are thrown as exceptions that inherit from std::exception.

Metadata Files

LOOT stores plugin metadata in YAML files. It distinguishes between masterlist and userlist files: each game has a single masterlist, which is a public, curated metadata store, and each LOOT user has a private userlist, which can contain metadata added by the user. The two files use the same syntax, but metadata in the userlist extends or replaces metadata sourced from the masterlist.

LOOT’s plugin metadata can be conditional, eg. a plugin may require a patch only if another plugin is also present. The API’s LoadLists() method parses metadata files into memory, but does not evaluate these conditions, so the loaded metadata may contain metadata that is invalid for the installed game that the loot::DatabaseInterface object being operated on was created for.

The EvalLists() must be called to evaluate any conditions in the loaded metadata. In doing so it discards any metadata with a condition that evaluates to false, but the pre-evaluation metadata is cached internally so that re-evaluation does not require the lists to be reloaded.

Caching

All unevaluated metadata is cached between calls to LoadLists(). Evaluated metadata is cached between calls to EvalLists(). Metadata conditions and their results are cached between calls to EvalLists(), so that every call to EvalLists() re-evaluates all conditions, but conditions that are used more than once in the loaded metadata are only evaluated once.

Plugin content is cached between calls to SortPlugins(), though no other API function makes use of it.

Performance

Loading metadata lists is a relatively costly operation, as is updating the masterlist (which involves loading it). Evaluating the loaded metadata lists is not very costly relative to loading them, though is performance depends on the type and number of conditions used in the loaded metadata, and all the conditions involve filesystem access.

Sorting plugins is expensive, as it involves loading all the FormIDs for all the plugins, apart from the game’s main master file, which is skipped as an optimisation (it doesn’t depend on anything else and is much bigger than any other plugin, so is unnecessary and slow to load).

Getting plugin metadata once loaded is cheap, as is getting a masterlist’s revision.

LOOT’s Sorting Algorithm

LOOT’s sorting algorithm consists of four stages:

Load plugin data

In this first stage, the plugins to be sorted are parsed and their FormIDs stored. Parsing is multithreaded by dividing the plugins into buckets with roughly equal total file sizes, and loading each bucket’s plugins in a separate thread. The number of buckets created is equal to the number of concurrent threads that are hardware-supported (e.g. a dual-core CPU without hyperthreading may report that it supports two threads).

When parsing plugins, all subrecords are skipped over for efficiency, apart from the subrecords of the TES4 header record.

Create plugin graph vertices

Once loaded, a directed graph is created and the plugins are added to it in lexicographical order as vertices. Any metadata a plugin has in the masterlist and userlist are then merged into its vertex’s data store, and any metadata conditions evaluated.

Create plugin graph edges

In this section, the terms vertex and plugin are used interchangeably, and the iteration order ‘for each plugin’ is the order in which the vertices were added to the graph.

For each plugin:

  1. If the plugin is a master file, add edges going to all non-master files. If the plugin is a non-master file, add edges coming from all master files.
  2. Add edges coming from all the plugin’s masters. Missing masters have no edges added.
  3. Add edges coming from all the plugin’s requirements. Missing requirements have no edges added.
  4. Add edges coming from all the plugin’s load after files that are installed plugins.

At this point, all explicit interdependencies have been graphed. Plugin priority metadata values must now be propagated down the dependency trees to ensure that priority edges are added correctly later in the process. To do this:

  1. Create a list of all vertices with a global or non-global priority value greater than zero.
  2. Sort the list in order of decreasing priority value.
  3. For each vertex, perform a depth-first search, setting priorities at each vertex visited until equal or larger values are encountered.

Now that the priorities have been propagated, the priority edges can be added. For each plugin, if it has a global priority value of zero, overrides no records and loads no archive, skip it, otherwise iterate over all other plugins and:

  • If the other plugin’s global and non-global priority values equal the plugin’s own values, or if both plugins have a global priority of zero and have no FormIDs in common, skip the other plugin.

  • Otherwise, add an edge from the plugin with lower global priority to the plugin with higher global priority, if that edge does not cause a cycle. A cycle is caused if a circular dependency is introduced, for example for two vertices A and B, A -> B -> A is a cycle.

    If the global priorities are equal, compare the non-global priorities instead.

Plugin overlap edges are then added. Two plugins overlap if they contain the same FormID, i.e. if they both edit the same record or if one edits a record the other plugin adds.

For each plugin, skip it if it overrides no records, otherwise iterate over all other plugins.

  • If the plugin and other plugin override the same number of records, or do not overlap, skip the other plugin.
  • Otherwise, add an edge from the plugin which overrides more records to the plugin that overrides fewer records, unless that edge would cause a cycle.

Finally, tie-break edges are added to ensure that sorting is consistent. For each plugin, iterate over all other plugins and add an edge between each pair of plugins in the direction given by the tie-break comparison function, unless that edge would cause a cycle.

The tie-break comparison function compares current plugin load order positions, falling back to plugin names.

  • If both plugins have positions in the current load order, the function preserves their existing relative order.
  • If one plugin has a position and the other does not, the edge added goes from the plugin with a position to the plugin without a position.
  • If neither plugin has a load order position, a case-insensitive lexicographical comparison of their filenames without file extensions is used to decide their order.

Topologically sort the plugin graph

Note that edges for explicit interdependencies are the only edges allowed to create cycles: this is because the first step of this stage is to check the plugin graph for cycles, and throw an error if any are encountered, so that metadata (or indeed plugin data) that cause them can be corrected.

Once the graph is confirmed to be cycle-free, a topological sort is performed on the graph, outputting a list of plugins in their newly-sorted load order.

API Reference

Enumerations

enum loot::GameType

Codes used to create database handles for specific games.

Values:

tes4

The Elder Scrolls IV: Oblivion

tes5

The Elder Scrolls V: Skyrim

fo3

Fallout 3

fonv

Fallout: New Vegas

fo4

Fallout 4

tes5se

The Elder Scrolls V: Skyrim Special Edition

enum loot::LanguageCode

Codes used to specify the preferred language for messages when evaluating masterlists and userlists.

If a message is not available in the preferred language, its English string will be used. Note that messages with only one language string are assumed to be written in English, but this cannot be guaranteed (any violations should be reported as bugs so that they can be fixed).

Values:

english
spanish
russian
french
chinese
polish
brazilian_portuguese
finnish
german
danish
korean
swedish
enum loot::MessageType

Codes used to indicate the type of a message.

Values:

say

A notification message that is of no significant severity.

warn

A warning message, used to indicate that an issue may be present that the user may wish to act on.

error

An error message, used to indicate that an issue that requires user action is present.

enum loot::PluginCleanliness

Codes used to indicate the cleanliness of a plugin according to the information contained within the loaded masterlist/userlist.

Values:

clean

Indicates that the plugin is clean.

dirty

Indicates that the plugin is dirty.

do_not_clean

Indicates that the plugin contains dirty edits, but that they are part of the plugin’s intended functionality and should not be removed.

unknown

Indicates that no data is available on whether the plugin is dirty or not.

Public-Field Data Structures

struct loot::MasterlistInfo

A structure that holds data about a masterlist’s source control revision.

Public Members

std::string revision_id

The revision hash for the masterlist. If the masterlist doesn’t exist, or there is no Git repository at its location, this will be empty.

std::string revision_date

A pointer to a string containing the ISO 8601 formatted revision date, ie. YYYY-MM-DD. If the masterlist doesn’t exist, or there is no Git repository at its location, this will be empty.

bool is_modified

true if the masterlist has been edited since the outputted revision, or false if it is at exactly the revision given.

struct loot::SimpleMessage

A structure that holds the type of a message and the message string itself.

Public Members

MessageType type

The type of the message.

LanguageCode language

The language the message string is written in.

std::string text

The message string, which may be formatted using GitHub Flavored Markdown.

struct loot::PluginTags

A structure that holds data about the Bash Tag suggestions made by LOOT for a plugin.

Public Members

std::set<std::string> added

A set of Bash Tag names suggested for addition to the specified plugin. Empty if no Bash Tag additions are suggested.

std::set<std::string> removed

A set of Bash Tag names suggested for removal from the specified plugin. Empty if no Bash Tag removals are suggested.

bool userlist_modified

true if the Bash Tag suggestions were modified by data in the userlist, false otherwise.

Functions

bool loot::IsCompatible(const unsigned int major, const unsigned int minor, const unsigned int patch)

Checks for API compatibility.

Checks whether the loaded API is compatible with the given version of the API, abstracting API stability policy away from clients. The version numbering used is major.minor.patch.

Return
True if the API versions are compatible, false otherwise.
Parameters
  • major: The major version number to check.
  • minor: The minor version number to check.
  • patch: The patch version number to check.

std::shared_ptr<DatabaseInterface> loot::CreateDatabase(const GameType game, const std::string &game_path = "", const std::string &game_local_path = "")

Initialise a new database handle.

Creates a handle for a database, which is then used by all database functions.

Return
The new database handle.
Parameters
  • game: A game code for which to create the handle.
  • game_path: The relative or absolute path to the game folder, or an empty string. If an empty string, the API will attempt to detect the data path of the specified game by searching for the game’s main master file in a sibling Data folder and by searching for the game’s Registry entry.
  • game_local_path: The relative or absolute path to the game’s folder in %LOCALAPPDATA% or an empty string. If an empty string, the API will attempt to look up the path that %LOCALAPPDATA% corresponds to. This parameter is provided so that systems lacking that environmental variable (eg. Linux) can still use the API.

Interfaces

class loot::DatabaseInterface

The interface provided by API’s database handle.

Data Loading

virtual void LoadLists(const std::string &masterlist_path, const std::string &userlist_path = "") = 0

Loads the masterlist and userlist from the paths specified.

Can be called multiple times, each time replacing the previously-loaded data.

Parameters
  • masterlist_path: A string containing the relative or absolute path to the masterlist file that should be loaded.
  • userlist_path: A string containing the relative or absolute path to the userlist file that should be loaded, or an empty string. If an empty string, no userlist will be loaded.

virtual void EvalLists() = 0

Evaluates all conditions and regular expression metadata entries.

Repeated calls re-evaluate the metadata from scratch. This function affects the output of all the database access functions.

Sorting

virtual std::vector<std::string> SortPlugins(const std::vector<std::string> &plugins) = 0

Calculates a new load order for the game’s installed plugins (including inactive plugins) and outputs the sorted order.

Pulls metadata from the masterlist and userlist if they are loaded, and reads the contents of each plugin. No changes are applied to the load order used by the game. This function does not load or evaluate the masterlist or userlist.

Return
A vector of the given plugin filenames in their sorted load order.
Parameters
  • plugins: A vector of filenames of the plugins to sort.

Masterlist Update

virtual bool UpdateMasterlist(const std::string &masterlist_path, const std::string &remote_url, const std::string &remote_branch) = 0

Update the given masterlist.

Uses Git to update the given masterlist to a given remote. If the masterlist doesn’t exist, this will create it. This function also initialises a Git repository in the given masterlist’s parent folder. If the masterlist was not already up-to-date, it will be re-loaded, but not re-evaluated.

If a Git repository is already present, it will be used to perform a diff-only update, but if for any reason a fast-forward merge update is not possible, the existing repository will be deleted and a new repository cloned from the given remote.

Return
true if the masterlist was updated. false if no update was necessary, ie. it was already up-to-date. If true, the masterlist will have been re-loaded, but will need to be re-evaluated separately.
Parameters
  • masterlist_path: A string containing the relative or absolute path to the masterlist file that should be updated. The filename must match the filename of the masterlist file in the given remote repository, otherwise it will not be updated correctly. Although LOOT itself expects this filename to be “masterlist.yaml”, the API does not check for any specific filename.
  • remote_url: The URL of the remote from which to fetch updates. This can also be a relative or absolute path to a local repository.
  • remote_branch: The branch of the remote from which to apply updates. LOOT’s official masterlists are versioned using separate branches for each new version of the masterlist syntax, so if you’re using them, check their repositories to see which is the latest release branch.

virtual MasterlistInfo GetMasterlistRevision(const std::string &masterlist_path, const bool get_short_id) = 0

Get the given masterlist’s revision.

Getting a masterlist’s revision is only possible if it is found inside a local Git repository.

Return
The revision data.
Parameters
  • masterlist_path: A string containing the relative or absolute path to the masterlist file that should be queried.
  • get_short_id: If true, the shortest unique hexadecimal revision hash that is at least 7 characters long will be outputted. Otherwise, the full 40 character hash will be outputted.

Plugin Data Access

virtual PluginTags GetPluginTags(const std::string &plugin) = 0

Outputs the Bash Tags suggested for addition and removal by the database for the given plugin.

Return
Bash Tag data for the plugin.
Parameters
  • plugin: The filename of the plugin to look up Bash Tag suggestions for.

virtual std::vector<SimpleMessage> GetPluginMessages(const std::string &plugin, const LanguageCode language) = 0

Outputs the messages associated with the given plugin in the database.

Return
A vector of messages associated with the specified plugin. Empty if the plugin has no messages associated with it.
Parameters
  • plugin: The filename of the plugin to look up messages for.
  • language: The language to use when choosing which message content strings to return.

virtual PluginCleanliness GetPluginCleanliness(const std::string &plugin) = 0

Determines the database’s knowledge of a plugin’s cleanliness.

Outputs whether the plugin should be cleaned or not, or if no data is available. The mechanism used to determine that a plugin should not be cleaned is not very reliable, and is likely to fail if EvalLists() was called with a language other than English. As such, some plugins that should not be cleaned may have the PluginCleanliness::unknown code outputted.

Return
A plugin cleanliness code.
Parameters
  • plugin: The plugin to look up the cleanliness state for.

Miscellaneous

virtual void WriteMinimalList(const std::string &outputFile, const bool overwrite) = 0

Writes a minimal metadata file that only contains plugins with Bash Tag suggestions and/or dirty info, plus the suggestions and info themselves.

Parameters
  • outputFile: The path to which the file shall be written.
  • overwrite: If false and outputFile already exists, no data will be written. Otherwise, data will be written.

Classes

class loot::LootVersion

A purely static class that provides information about the version of the LOOT API that is being run.

Public Static Functions

static std::string string()

Get the API version as a string.

Return
A string of the form “major.minor.patch”.

Public Static Attributes

const unsigned int major

The major version number.

const unsigned int minor

The minor version number.

const unsigned int patch

The patch version number.

const std::string revision

The source control revision that the API was built from.

Exceptions

class loot::CyclicInteractionError

An exception class thrown if a cyclic interaction is detected when sorting a load order.

Inherits from runtime_error

Public Functions

CyclicInteractionError(const std::string &firstPlugin, const std::string &lastPlugin, const std::string &backCycle)

Construct an exception detailing a plugin graph cycle.

Parameters
  • firstPlugin: A plugin in the cycle.
  • lastPlugin: Another plugin in the cycle.
  • backCycle: A string describing the path from lastPlugin to firstPlugin.

std::string getFirstPlugin()

Get the first plugin in the chosen forward path of the cycle.

Return
A plugin filename.

std::string getLastPlugin()

Get the first plugin in the chosen forward path of the cycle.

Return
A plugin filename.

std::string getBackCycle()

Get a description of the reverse path from the chosen last plugin to the chosen first plugin of the cycle.

Return
A string describing a path between two plugins in the plugin graph.

class loot::GitStateError

An exception class thrown if an error occurs when performing an operation on a Git repository due to invalid state.

Inherits from logic_error

class loot::GameDetectionError

An exception class thrown if an error occurs when detecting installed games.

Inherits from runtime_error

class loot::ConditionSyntaxError

An exception class thrown if invalid syntax is encountered when parsing a metadata condition.

Inherits from runtime_error

class loot::FileAccessError

An exception class thrown if an error is encountered while reading or writing a file.

Inherits from runtime_error

Error Categories

LOOT uses error category objects to identify errors with codes that originate in lower-level libraries.

const std::error_category &loot::libloadorder_category()

Get the error category that can be used to identify system_error exceptions that are due to libloadorder errors.

Return
A reference to the static object of unspecified runtime type, derived from std::error_category.

const std::error_category &loot::libgit2_category()

Get the error category that can be used to identify system_error exceptions that are due to libgit2 errors.

Return
A reference to the static object of unspecified runtime type, derived from std::error_category.

Credits

The LOOT API is written by WrinklyNinja in C++ and makes use of the Boost, libespm, libgit2, libloadorder, Pseudosem and yaml-cpp libraries. The copyright licenses for all of these and the LOOT API itself in Copyright License Texts.

Version History

0.10.3 - 2017-01-08

Added

  • Automated 64-bit API builds.

Changed

  • Replaced std::invalid_argument exceptions thrown during condition evaluation with ConditionSyntaxError exceptions.
  • Improved robustness of error handling when calculating file CRCs.

Fixed

  • Documentation was not generated correctly for enums, exceptions and structs exposed by the API.
  • Added missing documentation for CyclicInteractionError methods.

0.10.2 - 2016-12-03

Changed

  • Updated libgit2 to 0.24.3.

Fixed

  • A crash could occur if some plugins that are hardcoded to always load were missing. Fixed by updating to libloadorder v9.5.4.
  • Plugin cleaning metadata with no info value generated a warning message with no text.

0.10.1 - 2016-11-12

No API changes.

0.10.0 - 2016-11-06

Added

  • Support for TES V: Skyrim Special Edition.

Changed

  • Completely rewrote the API as a C++ API. The C API has been reimplemented as a wrapper around the C++ API, and can be found in a separate repository.
  • Windows builds now have a runtime dependency on the MSVC 2015 runtime redistributable.
  • Rewrote the API documentation, which is now hosted online at Read The Docs.
  • The Windows release archive includes the .lib file for compile-time linking.
  • LOOT now supports v0.10 of the metadata syntax. This breaks compatibility with existing syntax. See the syntax version history for the details.
  • Updated libgit2 to 0.24.2.

Removed

  • The loot_get_tag_map() function has no equivalent in the new C++ API as it is obsolete.
  • The loot_apply_load_order() function has no equivalent in the new C++ API as it just passed through to libloadorder, which clients can use directly instead.

Fixed

  • Database creation was failing when passing paths to symlinks that point to the game and/or game local paths.
  • Cached plugin CRCs causing checksum conditions to always evaluate to false.
  • Updating the masterlist when the user’s TEMP and TMP environmental variables point to a different drive than the one LOOT is installed on.

0.9.2 - 2016-08-03

Changed

  • libespm (2.5.5) and Pseudosem (1.1.0) dependencies have been updated to the versions given in brackets.

Fixed

  • The packaging script used to create API archives was packaging the wrong binary, which caused the v0.9.0 and v0.9.1 API releases to actually be re-releases of a snapshot build made at some point between v0.8.1 and v0.9.0: the affected API releases were taken offline once this was discovered.
  • loot_get_plugin_tags() remembering results and including them in the results of subsequent calls.
  • An error occurred when the user’s temporary files directory didn’t exist and updating the masterlist tried to create a directory there.
  • Errors when reading some Oblivion plugins during sorting, including the official DLC.

0.9.1 - 2016-06-23

No API changes.

0.9.0 - 2016-05-21

Changed

  • Moved API header location to the more standard include/loot/api.h.
  • Documented LOOT’s masterlist versioning system.
  • Made all API outputs fully const to make it clear they should not be modified and to avoid internal const casting.
  • The loot_db type is now an opaque struct, and functions that used to take it as a value now take a pointer to it.

Removed

  • The loot_cleanup() function, as the one string it used to destroy is now stored on the stack and so destroyed when the API is unloaded.
  • The loot_lang_any constant. The loot_lang_english constant should be used instead.

0.8.1 - 2015-09-27

Changed

  • Safety checks are now performed on file paths when parsing conditions (paths must not reference a location outside the game folder).
  • Updated Boost (1.59.0), libgit2 (0.23.2) and CEF (branch 2454) dependencies.

Fixed

  • A crash when loading plugins due to lack of thread safety.
  • The masterlist updater and validator not checking for valid condition and regex syntax.
  • The masterlist updater not working correctly on Windows Vista.

0.8.0 - 2015-07-22

Added

  • Support for metadata syntax v0.8.

Changed

  • Improved plugin loading performance for computers with weaker multithreading capabilities (eg. non-hyperthreaded dual-core or single-core CPUs).
  • LOOT no longer outputs validity warnings for inactive plugins.
  • Updated libgit2 to v0.23.0.

Fixed

  • Many miscellaneous bugs, including initialisation crashes and incorrect metadata input/output handling.
  • LOOT silently discarding some non-unique metadata: an error will now occur when loading or attempting to apply such metadata.
  • LOOT’s version comparison behaviour for a wide variety of version string formats.

0.7.1 - 2015-06-22

Fixed

  • “No existing load order position” errors when sorting.
  • Output of Bash Tag removal suggestions in loot_write_minimal_list().

0.7.0 - 2015-05-20

Initial API release.

Introduction

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 Wikipedia page is a good introduction. All you really need to know is:

  • How lists and associative arrays (key-value maps) are written.
  • That whitespace is important, and that only normal spaces (ie. no non-breaking spaces or tabs) count as such.
  • 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).
  • That YAML files must be written in a Unicode encoding.
  • That each key in a key-value map must only appear once per map object.

An important point that is more specific to how LOOT uses YAML:

  • Strings are case-sensitive, apart from file paths, regular expressions and checksums.

Some properties of file paths as used by LOOT:

  • They are evaluated as paths relative to the game’s Data folder.
  • They cannot reference a path outside of the game’s folder structure, ie. they cannot contain the substring ../../.
  • Regular expression file paths must be written in the EMCAScript syntax, and they must use / for directory separators.
  • 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 Meshes/Resources(1|2)/(upperclass)?table.nif, LOOT will look for a file named table.nif or upperclasstable.nif in the Meshes\Resources(1|2) folder, rather than looking in the Meshes\Resources1 and Meshes\Resources2 folders.

In this document, where a value’s type is given as X list this is equivalent to a YAML sequence of values which are of the data type X. Where a value’s type is given as X set, this is equivalent to a YAML sequence of unique values which are of the data type X. 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.

Metadata File Structure

The root of a metadata file is a key-value map. LOOT will recognise the following keys, none of which are required. Other keys may also be present, but are not processed by LOOT.

bash_tags

string list

A list of Bash Tags that are supported by the masterlist’s game. These Bash Tags are used to provide autocomplete suggestions in LOOT’s metadata editor.

globals

message list

A list of message data structures for messages that are displayed independently of any plugin.

plugins

plugin list and plugin set

The plugin data structures that hold all the plugin metadata within the file. It is a mixture of a list and a set because no non-regex plugin value may be equal to any other non-regex plugin value , but there may be any number of equal regex plugin values, and non-regex plugin values may be equal to regex plugin values.If multiple plugin values match a single plugin, their metadata is merged in the order the values are listed, and as defined in Merging Behaviour.

The message and plugin data structures are detailed in the next section.

Example

 bash_tags:
   - 'C.Climate'
   - 'Relev'
 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

Data Structures

LOOT expects metadata to be laid out using a certain set of data structures, described in this section.

Tag

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 string map and a scalar string.

Map Form

name

Required. A Bash Tag, prefixed with a minus sign if it is suggested for removal.

condition

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 Condition Strings for details. If undefined, defaults to an empty string.

Scalar Form

The scalar form is simply the value of the map form’s name key. Using the scalar form is equivalent to using the map form with an undefined condition key.

Equality

Two tag data structures are equal if the lowercased values of their name keys are identical.

Examples

Scalar form:

Relations

Map form:

name: -Relations
condition: 'file("Mart''s Monster Mod for OOO.esm") or file("FCOM_Convergence.esm")'

File

This structure can be used to hold file paths. It has two forms: a key-value string map and a scalar string.

Map Form

name

Required. An exact (ie. not regex) file path or name.

display

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. If undefined, the name key’s value is used.

condition

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 Condition Strings for details.

Scalar Form

The scalar form is simply the value of the map form’s name key. Using the scalar form is equivalent to using the map form with undefined display and condition keys.

Equality

Two file data structures are equal if the lowercased values of their name keys are identical.

Examples

Scalar form:

'../obse_loader.exe'

Map form:

name: '../obse_loader.exe'
condition: 'version("../obse_loader.exe", "0.0.18.0", &gt;=)'
display: 'OBSE v18+'

Localised Content

The localised content data structure is a key-value string map.

text

Required. The actual message content string.

lang

Required. The language that text is written in, given as a POSIX language code. LOOT supports the following languages and language codes:

Language POSIX Code
Brazilian Portuguese pt_BR
Chinese zh_CN
Danish da
English en
Finnish fi
French fr
German de
Korean ko
Polish pl
Russian ru
Spanish es
Swedish sv

Message

Messages are given as key-value maps.

type

string

Required. The type string can be one of three keywords.

say

A generic message, useful for miscellaneous notes.

warn

A warning message, describing a non-critical issue with the user’s mods (eg. dirty mods).

error

An error message, decribing a critical installation issue (eg. missing masters, corrupt plugins).

content

string or localised content list

Required. Either simply a string, or a list of localised content data structures. If the latter, one of the structures must be for English.

condition

string

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 Condition Strings for details.

subs

string list

A list of strings to be substituted into the message content string. The content string must use numbered specifiers (%1%, %2%, 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.

Message Formatting

LOOT supports formatting of messages using GitHub Flavored Markdown. Support is provided by the Marked library (v0.3). Strings that get substituted into messages, such as file display names and cleaning data utility strings, also support the same formatting options.

Language Support

If a message’s content value is a string, the message will use the string as its content if displayed. Otherwise, the first localised content 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.

Equality

The equality of two message data structures is determined by comparing the values of their content keys. As the values of the keys can be different types, a comparison value is selected for each message using the following logic:

  • If a value’s type is a localised content list, then the English content string in that list is selected as the comparison value.
  • If a value’s type is a string, then that string is selected as the comparison value.

The two message data structures are then equal if their lowercased comparison values are identical.

Examples

Translations by Google

type: say
condition: 'file("foo.esp")'
content:
  - lang: en
    text: 'An example link: <http://www.example.com>'
  - lang: ru
    text: 'Это пример ссылки: <http://www.example.com>'

would be displayed as

отмечать: Это пример ссылки: http://www.example.com

if the current language was Russian and foo.esp was installed, while

type: say
content: 'An alternative [example link](http://www.example.com), with no translations.'

would be displayed as

отмечать: An alternative example link, with no translations.

In English,

type: say
content: 'A newer version of %1% [is available](%2%).'
subs:
  - 'this plugin'
  - 'http://www.example.com'

would be displayed as

Note: A newer version of this plugin is available.

Location

This data structure is used to hold information on where a plugin is hosted online. It has two forms: a key-value string map and a scalar string.

Map Form

link

Required. A URL at which the plugin is found.

name

A descriptive name for the URL, which may be used as hyperlink text. If undefined, defaults to an empty string.

Scalar Form

The scalar form is simply the value of the map form’s link key. Using the scalar form is equivalent to using the map form with an undefined name key.

Equality

Two location data structures are equal if the lowercased values of their link keys are identical.

Examples

Scalar form:

'http://skyrim.nexusmods.com/mods/19/'

Map form:

link: 'https://steamcommunity.com/sharedfiles/filedetails/?id=419668499'
name: 'Unofficial Skyrim Patch on Steam Workshop'

Cleaning Data

This structure holds information on which versions of a plugin are dirty or clean, and if dirty, how many identical-to-master records, deleted records and deleted navmeshes (if applicable) it contains. Cleaning data is given as a key-value map.

crc

hexadecimal integer

Required. The CRC-32 checksum of the plugin. If the plugin is dirty, this needs to be the CRC of the plugin before before cleaning. LOOT displays the CRCs of installed plugins in its report. The 8-character CRC should be preceded by 0x so that it is interpreted correctly.

util

string

Required. The utility that was used to check the plugin for dirty edits. If available, the version of the utility used should also be included (e.g. TES5Edit v3.11).

info

string or localised content list

A message that will be displayed to the user. If a localised content list is provided, one of the structures must be for English. This is only used if the plugin is dirty, and is intended for providing cleaning instructions to the user. If undefined, defaults to an empty string.

itm

integer

The number of identical-to-master records reported for the dirty plugin. If undefined, defaults to zero.

udr

integer

The number of undeleted records reported for the dirty plugin. If undefined, defaults to zero.

nav

integer

The number of deleted navmeshes reported for the dirty plugin. If undefined, defaults to zero.

Equality

Two cleaning data structures are equal if the values of their crc keys are identical.

Examples

A dirty plugin:

crc: 0x3DF62ABC
util: '[TES5Edit](http://www.nexusmods.com/skyrim/mods/25859) v3.1.1'
info: 'A cleaning guide is available [here](http://www.creationkit.com/index.php?title=TES5Edit_Cleaning_Guide_-_TES5Edit).'
itm: 4
udr: 160

A clean plugin:

crc: 0x2ABC3DF6
util: '[TES5Edit](http://www.nexusmods.com/skyrim/mods/25859) v3.1.1'

Plugin

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.

name

string

Required. Can be an exact plugin filename or a regular expression plugin filename. If the filename contains any of the characters :\*?|, the string will be treated as a regular expression, otherwise it will be treated as an exact filename. For example, Example\.esm will be treated as a regular expression, as it contains a \ character.

enabled

boolean

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 true.

priority

integer

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 after list). Plugins that don’t change any of the same records are not compared, unless one of the plugins contains only a header record.

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 -127 to 127 inclusive, and if unspecified defaults to 0.

global_priority

integer

Modifies plugin position relative to all unrelated plugins (ie. neither plugin lists the other as a master, requirement, or in its after list).

A plugin with a higher global_priority value will load after a plugin with a lower priority value. The value can be anything in the range -127 to 127 inclusive, and if unspecified defaults to 0.

global_priority takes precedence over priority when comparing two plugins’ priorities: the priority value is only compared if the two plugins have the same global_priority value.

after

file set

Plugins that this plugin must load after, but which are not dependencies. Used to resolve specific compatibility issues. If undefined, the set is empty.

req

file set

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. If undefined, the set is empty.

inc

file set

Files that this plugin is incompatible with. If any of these files are present, an error message will be displayed. If undefined, the set is empty.

msg

message list

The messages attached to this plugin. The messages will be displayed in the order that they are listed. If undefined, the list is empty.

tag

tag set

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. If undefined, the set is empty.

url

location set

An unordered set of locations for this plugin. If the same version can be found at multiple locations, only one location should be recorded. If undefined, the set is empty. This metadata is not currently used by LOOT.

dirty

cleaning data set

Cleaning data for this plugin, identifying dirty plugins. Plugin entries with regular expression filenames must not contain cleaning data.

clean

cleaning data set

An unordered set of cleaning data structures for this plugin, identifying clean plugins. Plugin entries with regular expression filenames must not contain cleaning data. The itm, `udr and nav fields are unused in this context, as they’re assumed to be zero.

Equality

The equality of two plugin data structures is determined by comparing the values of their name keys.

  • If neither or both values are regular expressions, then the plugin data structures are equal if the lowercased values are identical.
  • If one value is a regular expression, then the plugin data structures are equal if the other value is an exact match for it.

Merging Behaviour

Key Merge Behaviour (merging B into A)
name Not merged.
enabled Replaced by B’s value.
priority Replaced by B’s value, unless that value is 0 and it was not explicitly set.
global_priority Replaced by B’s value, unless that value is 0 and it was not explicitly set.
after 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.
req 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.
inc 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.
msg 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.
tag 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.
url 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.
dirty Merged.If B’s dirty data set contain an item that is equal to one already present in A’s dirty data set, B’s item is discarded.
clean Merged. If B’s clean data set contain an item that is equal to one already present in A’s clean data set, B’s item is discarded.

Examples

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.'

Condition Strings

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.

Omitting optional parentheses (see below), their EBNF grammar is:

compound_condition ::=  condition, { ( logical_and | logical_or ), condition }
condition          ::=  [ logical_not ], function
logical_and        ::=  "and"
logical_or         ::=  "or"
logical_not        ::=  "not"

Types

file_path

A double-quoted file path, or "LOOT", which references the LOOT executable being run.

regular_expression

A double-quoted regular expression string to match file paths to.

checksum

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.

version

A double-quoted string of characters representing the version of a plugin or executable. LOOT displays the versions of plugins in its user interface after running.

comparison_operator

One of the following comparison operators.

==

Is equal to

!=

Is not equal to

<

Is less than

>

Is greater than

<=

Is less than or equal to

>=

Is greater than or equal to

Functions

There are several conditions that can be tested for using the functions detailed below. All functions return a boolean. For functions that take a path or regex, the argument is treated as regex if it contains any of the characters :\*?|.

file(file_path path)

Returns true if path is installed, and false otherwise.

file(regular_expression regex)

Returns true if a file matching regex is found, and false otherwise.

active(file_path path)

Returns true if path is an active plugin, and false otherwise.

active(regular_expression regex)

Returns true if an active plugin matching regex is found, and false otherwise.

many(regular_expression regex)

Returns true if more than one file matching regex is found, and false otherwise.

many_active(regular_expression regex)

Returns true if more than one active plugin matching regex is found, and false otherwise.

checksum(file_path path, checksum expected_checksum)

Returns true if the calculated CRC-32 checksum of path matches expected_checksum, and false otherwise. Returns false if path does not exist.

version(file_path path, version given_version, comparison_operator comparator)

Returns true if the boolean expression:

actual_version comparator given_version

(where actual version is the version read from path) holds true, and false otherwise. If path does not exist or does not have a version number, its version is assumed to be 0.

The comparison uses the precedence rules defined by Semantic Versioning, extended to allow leading zeroes, an arbitrary number of release version numbers, case-insensitivity and a wider range of separator characters.

Logical Operators

The and, or and not operators have their usual definitions, except that the not operator only ever operates on the result of the function immediately following it.

Order of Evaluation

Condition strings are evaluated according to the usual C-style operator precedence rules, and parentheses can be used to override these rules. For example:

function and function or not function

is evaluated as:

( function and function ) or ( not function )

but:

function and ( function or not function )

is evaluated as:

function and ( function or ( not function ) )

Parentheses cannot be used between a not operator and the function following it.

Performance

LOOT caches the results of condition evaluations. A regular expression check will still take longer than a file check though, so use the former only when appropriate to do so.

Version History

The version history of the metadata syntax is given below.

0.10 - 2016-11-06

Added

  • The clean key to the plugin data structure.
  • The global_priority field to the plugin data structure.
  • The many_active() condition function.
  • The info key to the cleaning data structure.

Changed

  • Renamed the str key in the localised content data structure to text .
  • The priority field of the plugin data structure now stores values between -127 and 127 inclusive.
  • Regular expressions no longer accept \ as a directory separator: / must now be used.
  • The file() condition function now also accepts a regular expression.
  • The active() condition function to also accept a regular expression.
  • Renamed the dirty info data structure to the cleaning data structure.

Removed

  • The regex() condition function, as it has been obsoleted by the file() function’s new regex support.

0.8 - 2015-07-22

Added

  • The name key to the location data structure.
  • The many("regex") condition function.
  • The documentation now defines the equality criteria for all of the metadata syntax’s non-standard data structures.

Changed

  • Detection of regular expression plugin entries. Previously, a plugin entry was treated as having a regular expression filename if the filename ended with \.esp or \.esp . Now, a plugin entry is treated as having a regular expression filename if the filename contains one or more of :\*?| .

Removed

  • Removed the ver key in the location data structure.

Fixed

  • The documentation gave the values of the after , req , inc , tag , url and dirty keys as lists, when they have always been sets.

0.7 - 2015-05-20

Added

  • The message string substitution key, i.e. sub , in the message data structure.
  • Support for YAML merge keys, i.e. << .

Changed

  • Messages may now be formatted using most of GitHub Flavored Markdown, minus the GitHub-specific features (like @mentions, issue/repo linking and emoji).

0.6 - 2014-07-05

No changes.

0.5 - 2014-03-31

Initial release.