Lore archive · Warcraft Wiki, 2023 dump
TOC format
Last wiki revision 2023-10-13
.toc (Table of Contents) files contain information about a particular addon (such as its name, description, saved variables, etc), as well as instructions on how the addon should be loaded by the client (for example, the order in which lua and xml files should be loaded). The file must be present, and have the same name (plus extension) as its parent folder for the addon to be recognized by the client.
The .toc file and addon folder name need to match, e.g. and
The file may contain the following elements:
- Metadata as
- Comments as
- A list of files as or
Whitespace before will be interpreted as the start of a filename. However, the client trims whitespace around metadata values (after the colon).
Backslashes are recommended for subdirectories to prevent issues with tags.
Classic and retail versions of the game can be properly supported by including multiple TOC files in the same addon. The client first searches for the respective suffix and otherwise falls back to
- Clients also recognize legacy suffixes, , and.
The .toc file provides an ordered list of files to be loaded by the client. In the earlier example:
- Vladimir.xml loads first, and is in the same folder as the .toc file
- Estragon.lua loads second, and is in the same folder as the .toc file
- SomeLibrary.lua loads third, and is in a subfolder called libs
Not every file must appear in a .toc list:
- XML files may contain or
- and can use images and sounds contained within the addon folder and its subfolders
The interface field declares the version of the game client for which the addon has been made. This field guarantees that users of an addon will have a game API that is compatible with the one the author used during development.
Conversely, if addons declare an older interface than the user's current one, instability and breakages may occur because the game API changes over time. However, users may opt into this risk by ticking the "Load out of date addons" checkbox. Additionally, the omission of this field causes the game to treat the addon as always out of date.
Here is an example of how this field is declared in TOC files:
There are a number of ways to get the current interface version.
This wiki maintains a set of the latest interfaces for each flavor of the game. They are displayed in the table below. Note that these values are updated by contributors, so they may occasionally be out of date.
The API function will return data about the currently released game client that is available to players. For example, will output the interface version to your chat frame.
The following directives change how an AddOn appears in the AddOns list. Both may be coloured using UI escape sequences (e.g. ), or localized by appending a hyphen and the locale code (e.g. ). Later entries overwrite earlier ones, so the non-localized fallback should go first.
Name displayed in the AddOns list.
Tooltip displayed in the AddOns list.
Path to a texture file to be shown as the icon for this addon in the addon list. Optional.
Name of a texture atlas to be shown as the icon for this addon in the addon list. Optional, and has a lower priority than IconTexture if both are set.
The following directives will control the registration of the addon into the Addon compartment dropdown accessible from the minimap.
Name of a global function to be executed when the dropdown list button for this addon has been clicked. This field is required to have the addon be shown in the Addon Compartment list.
Name of a global function to be executed when this dropdown list button for this addon has been highlighted. Optional.
Name of a global function to be executed when this dropdown list button for this addon is no longer highlighted. Optional.
The following directives control when an AddOn loads, and any dependencies that must or may load first.
to delay loading until.
AddOns that must load first. Aliases include and any word beginning with.
AddOns that should load first if available.
AddOns that, once loaded, trigger this one to load. Implies LoadOnDemand. Currently broken on Classic - Issue #223.
AddOns that, if present, trigger this one to behave as LoadOnDemand. See AddonLoader for an example.
to require the user to explicitly enable the AddOn in the AddOns list.
Variables saved in.
Variables saved in.
The following metadata may be accessed using.
- Author : The AddOn author's name, displayed
- Version: The AddOn version. Some automatic updating tools may prefer that this string begins with a numeric version number.
- X-_____: Any custom metadata prefixed by "X-", such as "X-Date", "X-Website" or "X-Feedback"
The following tags are inaccessible to third-party AddOns.
- AllowLoad : if an addon can be loaded in the GlueXML and FrameXML environments, or to restrict it to the GlueXML environment only.
- GuardedAddOn : if a secure addon is not permitted to be disabled and should be loaded before any other unguarded addons.
- OnlyBetaAndPTR : if an addon should only be loadable on test realms.
- SavedVariablesMachine : List of global variable names to be persisted across all accounts on the same machine.
- Secure : with Blizzard's digital signature to indicate a secure AddOn.
- WoW reads up to the first 1024 characters of each line only. Additional characters are ignored and do not cause an error.
- Starting from Patch 9.0, 1.14.0 and 2.5.3, newly created/added files and even complete addons, are also detected when doing a after the game started.
- returns basic information about an addon.
- Using the AddOn namespace describes the parameters passed to each file.
Source
https://warcraft.wiki.gg/wiki/TOC_format · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.