Template Macro

An Add-on Module for Foundry Virtual Tabletop

Author: Zhell Project Source: Project URL Version 11 Last Updated 2 days, 17 hours 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.


Available Versions

  1. Version 11.0.0

    Compatible Foundry Versions: 11 - 11 Installation Link: Manifest URL Update Notes: Read Notes
  2. Version 10.0.2

    Compatible Foundry Versions: 10 - 10.291 Installation Link: Manifest URL Update Notes: Read Notes