| Latest version | 11.0.1 |
|---|---|
| Minimum Core | 10 |
| Compatible Core | |
| File size | 9 B |
| Last updated | 2 years ago |
| Created | 3 years ago |
| Authors |
|
| Languages |
English |
| Systems |
Dnd5e |
| Project source | Project URL |
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.
findContainers(tokenDoc) returns the MeasuredTemplateDocument ids that contain a TokenDocument.findContained(templateDoc) returns the TokenDocument ids that are contained within a MeasuredTemplateDocument.findGrids(A, B, templateDoc) returns the grid cells between the two coordinates that are within a MeasuredTemplateDocument.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.
To install this package, open your Foundry Setup screen and navigate to your Module tab and click the Install Module button.
From there, you can either search for the package unique name: templatemacro or copy its manifest URL:
And paste it to the input box at the bottom of your window.

You can install this package directly to your Forge account.