Register

Template Macro

An Add-on Module for Foundry Virtual Tabletop

Author: Zhell Project Source: Project URL Versions 11 - 11 (Verified 11) Last Updated 1 year, 2 months ago

Template Macro

You can use this module to trigger macros on certain events related to Measured Templates. The events include:

You can create macros in two ways:

Any template macro has four declared helper variables: template (the MeasuredTemplateDocument itself), scene (the parent of the template), token (the token moving, if relevant), and this, which contains a lot of other useful data, most notably any parameters passed through associated hooks.

The module contains some functions found in game.modules.get("templatemacro").api.

Additionally, the MeasuredTemplateDocument now has the function callMacro(type="never", options={}), which executes the appropriate embedded script, if it exists. The types are: "whenCreated", "whenDeleted", "whenMoved", "whenHidden", "whenRevealed", "whenEntered", "whenLeft", "whenThrough", "whenStaying", "whenTurnStart", "whenTurnEnd", "never", the last being a placeholder script meant for manual execution only.

Categories

Available Versions

  1. Version 11.0.1

    1 year, 2 months ago
    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  2. Version 11.0.0

    Foundry Version 11 - 11 (Verified 11) Manifest URL Read Notes
  3. Version 10.0.2

    Foundry Version 10 - 10 (Verified 10.291) Manifest URL Read Notes