onCampaignLoad
onCampaignLoad Macro
• Introduced in version 1.3b51
A special macro that can be created on library tokens to have macro code automatically execute when a campaign is loaded. A campaign is considered to have been loaded if it is opened via the File menu, or upon connecting to a server running that campaign. All output from onCampaignLoad is discarded, when it is executed automatically. This special macro is ideally suited for loading your defined functions via defineFunction().
When onCampaignLoad is executed automatically, it is considered a Trusted Macro. If you wish to use trusted functions within onCampaignLoad and execute it manually (e.g. while developing macros), you will have to make sure that it follows all of the rules of Trusted Macros.
How to Create an onCampaignLoad Macro
You can create an onCampaignLoad macro on any library token; simply create a macro that is specifically named onCampaignLoad
Limitations
Do not make changes in the onCampaignLoad-macro to the library token it resides on. Its not supported by the MapTool handles stuff and nasty stuff could happen. (Actually a duplicate lib token can/will appear and this will/can break stuff)
Library 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.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.