From 27f5d081e16b7f441f47eef61c8cd9590fea1587 Mon Sep 17 00:00:00 2001
From: Material Foundry <68693756+CDeenen@users.noreply.github.com>
Date: Wed, 24 May 2023 16:24:38 +0200
Subject: [PATCH] Updated Token Action (markdown)
---
Token-Action.md | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/Token-Action.md b/Token-Action.md
index 79d0d8e..433b209 100644
--- a/Token-Action.md
+++ b/Token-Action.md
@@ -114,6 +114,7 @@ Most should be self-explanatory, but some are described below.
By selecting 'Custom', you can modify a value in the token or actor object. When you select 'Custom' you will get a new 'Formula' input box.
In 'Formula' you can fill in the desired formula. You can use the following:
+
* Numbers - Any number you want
* Token and actor data - see below
* Macros - see below
@@ -134,22 +135,22 @@ In 'Formula' you can fill in the desired formula. You can use the following:
Forget about the proper order of operations, any operation is performed from left to right. Each operation must be separated by an empty space. A properly formatted formula has a 'target' in the form of token or actor data, followed by a '=', followed by either a value or a function.
Token and actor data is the path the the desired data (from the token object).
-For example, to get the hit points in dnd5e, you'd use the path `actor.data.data.attributes.hp.value`.
+For example, to get the hit points in dnd5e, you'd use the path `actor.system.attributes.hp.value`.
Any path you want needs to be prefixed by '@', and surrounded by square brackets '[' and ']'.
-So in for the hp you'd fill in `[@actor.data.data.attributes.hp.value]`
+So in for the hp you'd fill in `[@actor.system.attributes.hp.value]`
`[@this]` is a shorthand for whatever data path you have to the left of the '=' sign.
Here are some examples:
-Set the walking speed to 25 feet: `[@actor.data.data.attributes.movement.walk] = 25`
-Increment the HP by 1: `[@actor.data.data.attributes.hp.value] = [@this] ++`
-Increment the HP by 1 but limit to the max hp: `[@actor.data.data.attributes.hp.value] = [@this] ++ <= [@actor.data.data.attributes.hp.max]`
-Set the AC to 10 plus the DEX modifier: `[@actor.data.data.attributes.ac.value] = 10 + [@actor.data.data.abilities.dex.mod]`
+Set the walking speed to 25 feet: `[@actor.system.attributes.movement.walk] = 25`
+Increment the HP by 1: `[@actor.system.attributes.hp.value] = [@this] ++`
+Increment the HP by 1 but limit to the max hp: `[@actor.system.attributes.hp.value] = [@this] ++ <= [@actor.system.attributes.hp.max]`
+Set the AC to 10 plus the DEX modifier: `[@actor.system.attributes.ac.value] = 10 + [@actor.system.abilities.dex.mod]`
-Currently you cannot use shorthand notation such as `[@actor.data.data.attributes.hp.value] ++` or `[@actor.data.data.attributes.hp.value] += 1`. Instead you will need to use one of the following methods:
-`[@actor.data.data.attributes.hp.value] = [@actor.data.data.attributes.hp.value] ++`
-`[@actor.data.data.attributes.hp.value] = [@actor.data.data.attributes.hp.value] + 1`
-`[@actor.data.data.attributes.hp.value] = [@this] ++`
+Currently you cannot use shorthand notation such as `[@actor.system.attributes.hp.value] ++` or `[@actor.system.attributes.hp.value] += 1`. Instead you will need to use one of the following methods:
+`[@actor.system.attributes.hp.value] = [@actor.system.attributes.hp.value] ++`
+`[@actor.system.attributes.hp.value] = [@actor.system.attributes.hp.value] + 1`
+`[@actor.system.attributes.hp.value] = [@this] ++`
If you want to modify string data, such as a token name, any part to the right of '=' should not contain any maths, or you might get unexpected results.
If the string contains any empty spaces, you must surround the string with square brackets '[' and ']'.
@@ -169,15 +170,20 @@ You would use, for example: `@macro moveToken 1 0` to move the token 1 gridspace
If the name of you macro or any of the arguments has spaces in it, you have to surround the name with square brackets '[' and ']'. For example, if you macro is named `Test Macro`, you use `@macro [Test Macro]`.
You can set multiple formulas or multiple macros to the same button by separating them with ';'. So you can increment the HP by 1 and set the walking speed to 25 feet with:
-`[@actor.data.data.attributes.movement.walk] = 25 ; [@actor.data.data.attributes.hp.value] = [@this] ++`
+`[@actor.system.attributes.movement.walk] = 25 ; [@actor.system.attributes.hp.value] = [@this] ++`
Or increment the HP by 1 and call the macro 'moveToken':
-`[@actor.data.data.attributes.hp.value] = [@this] ++ ; @macro moveToken 1 0`
+`[@actor.system.attributes.hp.value] = [@this] ++ ; @macro moveToken 1 0`