Library Token
Introduced in MapTool version b46, the Library Token is a special token type that acts as a library of properties and trusted macros that may be accessed and called by other macros.
Library Token Naming
All library tokens must have a name in the format "Lib:name", to indicate that they are to serve as a Library Token and not a "normal" token. Example library token names might be:
- Lib:test
- Lib:combat
- Lib:gamemaster
Creating a Library Token
To create a Library Token, do the following:
- Drag a new token on to one of the maps in your campaign.
- Rename it with a name in the format Lib:name (e.g., Lib:DnD, Lib:GameRules, etc.).
-
Right click on the token and make sure that Visible to Players is checked.
- Double-click on it, and go to the Ownership tab. Make sure that nothing is checked.
- Set the token type to NPC (upper right corner of the Token Configuration dialog).
After that, you have a Library Token. Note that you cannot have two library tokens with the same name in the same campaign (even if they're on different maps!).
Once again, the requirements are:
- The library token must be visible to players (make sure Visible to Players is set in the right-click context menu). The library token need not be on the "Token" layer (you can keep it on the "Hidden" layer to hide it from players, although "Visible to Players" must still be set to true).
-
The library token must have a name in the format "Lib:name"
-
The library token must be present on only one map in the campaign file.
-
The library token may not be owned by any players (it's best not to be owned by ANYONE!)
Library Tokens and Trusted Macros
In addition to the above requirements if you want players to be able to run any macro that calls a function designated as a trusted function the following requirement must also be met.
-
The library token must not be owned by any players (in the Ownership tab of the Edit Token dialog, make sure that no boxes are checked)
Multiple library tokens may exist in the same campaign provided no two library tokens have the same token name.
Library Token Macros
Library token macros are created and edited like macros on any token. Macros on a library token may be called using the [MACRO(): ] roll option. Since Library token macros are trusted, they may perform operations not available to regular tokens.
Library Token Properties
Library token properties can be accessed by using the getLibProperty() function. Note that default property values do NOT work using that function.
Campaign File: A zipped XML file with the '''.cmpgn''' file extension containing tokens, maps, token macros, campaign macros, and token propertiesLibrary Token: A special token designed to hold a library of macros (similar to a function library) that can be called by token macros, campaign macros, and global macros. Often called "Lib:tokens."Token: A visual marker representing a character, monster, or NPCCampaign Macro: A macro specific to a campaign file. These macros are available to players and the GM, and are displayed in the Campaign Macros window.Global Macro: Macros that are available regardless of the campaign file currently loaded in MapTool, and regardless of whether the instance of MapTool is a server or a client. Global macros are ''only'' available to the running instance.Trusted Macro: A macro run from a Library token or run by the GM, that cannot be edited by a player.Macro: A series of text instructions used to automate processes in MapTool.Roll Option: One of several "switches" that alter how the macro code following the switch is executedDialog: A modeless (''i.e.'', does not require user interaction) popup generated by the dialog roll option.Campaign: A zipped XML file with the '''.cmpgn''' file extension containing tokens, maps, token macros, campaign macros, and token propertiesMap: An image file displayed in the map display area in MapTool. This image is shared among all connected players and the GM.Property: Generic term for a variable contained in a token; a more explicit term is token property