Updated Token Action (markdown)
@@ -74,8 +74,8 @@ By selecting 'Custom', you can modify a value in the token or actor object. When
|
||||
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
|
||||
* `[@this]` - gets the value of 'Target'. In the above example this would return the hp
|
||||
* '=' - sets the target on the left of '=' to the value on the right
|
||||
* `[@this]` - gets the value of 'target', see below
|
||||
* `=` - sets the target on the left of '=' to the value on the right
|
||||
* `++` - add 1
|
||||
* `--` - subtract 1
|
||||
* `+` - addition
|
||||
@@ -87,13 +87,14 @@ In 'Formula' you can fill in the desired formula. You can use the following:
|
||||
* `<`, `<=`, `>`, `>=` - limit the value
|
||||
* Strings - see below
|
||||
|
||||
Forget about the proper order of operations, any operation is performed from left to right. Each operation must be separated by an empty space<br>
|
||||
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.<br>
|
||||
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.<br>
|
||||
<br>
|
||||
Token and actor data can be any path the the desired data (from the token object).<br>
|
||||
Token and actor data is the path the the desired data (from the token object).<br>
|
||||
For example, to get the hit points in dnd5e, you'd use the path `actor.data.data.attributes.hp.value`. Any stat you want needs to be prefixed by '@', and surrounded by square brackets '[' and ']'.<br>
|
||||
So in for the hp you'd fill in `[@actor.data.data.attributes.hp.value]`<br>
|
||||
|
||||
<br>
|
||||
`[@this]` is a shorthand for whatever data path you have to the left of the '=' sign.<br>
|
||||
<br>
|
||||
Here are some examples:<br>
|
||||
Set the walking speed to 25 feet: `[@actor.data.data.attributes.movement.walk] = 25`<br>
|
||||
Increment the HP by 1: `[@actor.data.data.attributes.hp.value] = [@this] ++`<br>
|
||||
@@ -102,7 +103,12 @@ Set the AC to 10 plus the DEX modifier: `[@actor.data.data.attributes.ac.value]
|
||||
<br>
|
||||
You can set multiple formulas 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:<br>
|
||||
`[@actor.data.data.attributes.movement.walk] = 25 ; [@actor.data.data.attributes.hp.value] = [@this] ++`<br>
|
||||
|
||||
<br>
|
||||
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:<br>
|
||||
`[@actor.data.data.attributes.hp.value] = [@actor.data.data.attributes.hp.value] ++`<br>
|
||||
`[@actor.data.data.attributes.hp.value] = [@actor.data.data.attributes.hp.value] + 1`<br>
|
||||
`[@actor.data.data.attributes.hp.value] = [@this] ++`<br>
|
||||
<br>
|
||||
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 ']'.<br>
|
||||
So, for example, to set the token name: `[@actor.name] = John` or `[@actor.name] = [John Doe]`. Setting it to `[@actor.name] = John Doe` will not work.
|
||||
|
||||
Reference in New Issue
Block a user