Updated Token Action (markdown)
178
Token-Action.md
178
Token-Action.md
@@ -1,5 +1,5 @@
|
|||||||
The token action gives you some options to display stats of tokens in Foundry, and can be set up to do some things when you press the button, for example center the view on that token, or open the token's character sheet.<br>
|
The token action gives you some options to display stats of tokens in Foundry, and can be set up to do some things when you press the button, for example center the view on that token, or open the token's character sheet.<br>
|
||||||
See the image below for an example on how to set up a token control screen. It has been taken from the provided example XL profile.
|
See the image below for an example on how to set up a token control screen.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -14,61 +14,84 @@ Button functions in the top row, from left to right:
|
|||||||
* Display movement speed
|
* Display movement speed
|
||||||
* Display initiative
|
* Display initiative
|
||||||
|
|
||||||
# Configuration
|
<h4>Game Systems</h4>
|
||||||
#### Game Systems
|
The Stream Deck application automatically detects what game system you're using, as long as Foundry is running and connected. If not, it will default to DnD 5e. In the module settings it is possible to configure a system override, which will force MD to use a specific system.<br>
|
||||||
The Stream Deck application automatically detects what game system you're using, as long as Foundry is running and connected. If not, it will default to DnD 5e.<br>
|
|
||||||
System-specific options, such as the some 'stats' or 'on-click' options, can result in blank fields in the property inspector, when switching from a system that supports them to one that doesn't.<br>
|
System-specific options, such as the some 'stats' or 'on-click' options, can result in blank fields in the property inspector, when switching from a system that supports them to one that doesn't.<br>
|
||||||
Currently 'DnD 5e', 'DnD 3.5e', 'Pathfinder 1e', 'Pathfinder 2e' and 'Shadow of the Demon Lord' are supported.<br>
|
Currently 'DnD 5e', 'DnD 3.5e', 'Pathfinder 1e', 'Pathfinder 2e', 'Shadow of the Demon Lord', 'Forbidden Lands', 'Starfinder', and 'Warhammer Fantasy Roleplay 4e' are supported.<br>
|
||||||
|
|
||||||
### Token
|
<ul>
|
||||||
The token drop-down box will allow you to set what token should be targeted for the button actions.
|
<li><b></b>: </li>
|
||||||
* Selected Token: The currently selected token
|
</ul>
|
||||||
* Token Name: Specify the token name in the 'Name' box, it will display the first token with that name that Foundry can find
|
|
||||||
* Actor Name: Specify the actor name in the 'Name' box, it will display the first token of that actor that Foundry can find
|
|
||||||
* Token Id: Specify the token id in the 'Id' box, it will display the token with that id
|
|
||||||
* Actor Id: Specify the actor id in the 'Id' box, it will display the first token of that actor that Foundry can find
|
|
||||||
|
|
||||||
### Stats
|
<h1>Overview</h1>
|
||||||
You can select a stat to be displayed on the button (under the name, if 'Display Name' is selected).<br>
|
|
||||||
You can choose between the following stats:
|
|
||||||
* None
|
|
||||||
* Custom (see below)
|
|
||||||
* Hit points
|
|
||||||
* Temporary hit points
|
|
||||||
* Armor class
|
|
||||||
* Shield hit points (all systems except dnd5e)
|
|
||||||
* Movement speed
|
|
||||||
* Initiative
|
|
||||||
* Passive Perception (dnd5e only)
|
|
||||||
* Passive Investigation (dnd5e only)
|
|
||||||
|
|
||||||
Some of these have their own default icon (heart for HP, shield for AC, etc) that will be displayed if 'Display Icon' is deselected.
|
* [Token Selection](placeholder)
|
||||||
|
* [Mode](placeholder)
|
||||||
|
* [Token Mode](placeholder)
|
||||||
|
* [Stats](placeholder)
|
||||||
|
* [On Click](placeholder)
|
||||||
|
* [Inventory, Features & Spellbook Modes](placeholder)
|
||||||
|
* [Offsets](placeholder)
|
||||||
|
* [Icon, Name & Background](placeholder)
|
||||||
|
|
||||||
#### Custom Stats
|
<h1>Token Selection</h1>
|
||||||
|
The first 2 options ('Page-Wide Token' and 'Token') determine which token (or actor) will be used for the action.
|
||||||
|
Using the 'Token' dropdown menu, you can select between the following options:
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><b>Selected Token</b>: The currently selected token</li>
|
||||||
|
<li><b>Token Name</b>: Specify the token name in the 'Name' box</li>
|
||||||
|
<li><b>Actor Name</b>: Specify the actor name in the 'Name' box</li>
|
||||||
|
<li><b>Token Id</b>: Specify the token id in the 'Id' box</li>
|
||||||
|
<li><b>Actor Id</b>: Specify the actor id in the 'Id' box</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
In case of 'Token Name' or 'Actor Name', the first token or actor with that name will be selected.
|
||||||
|
|
||||||
|
<h4>Page-Wide Token</h4>
|
||||||
|
All 'Token' actions with 'Page-Wide Token' enabled, will use the same token, so if you change, for example, the token name, this will change for all those actions. This allows for you to quickly reconfigure a page, or use the 'Set Page-Wide Token' 'On Click' option to change the token selection using a button press.
|
||||||
|
|
||||||
|
You could, for example, populate the top row of your Stream Deck with all PC tokens (by selecting those tokens by name), and configure them all to set the page-wide token to their token. If you then populate the rest of the Stream Deck with other 'Token' actions, you can quickly change what token the buttons are applied to.
|
||||||
|
|
||||||
|
<h1>Mode</h1>
|
||||||
|
The Token Action has multiple modes to select from:
|
||||||
|
<ul>
|
||||||
|
<li><b>Token</b>: Display token stats, and perform on click actions such as moving the token or rolling for skill checks</li>
|
||||||
|
<li><b>Inventory</b>: Display an inventory item and perform rolls using that item</li>
|
||||||
|
<li><b>Features</b>: Display a token feature and perform rolls using that feature</li>
|
||||||
|
<li><b>Spellbook</b>: Display a spell and roll for that spell</li>
|
||||||
|
<li><b>Offsets</b>: Allows you to configure an offset so you can scroll through more items, features and spells</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Token Mode</h2>
|
||||||
|
The Token mode can be used to display stats of a token or actor, such as its hit points, armor class or ability scores. You can configure the stats to display, and what to do when you click the button.
|
||||||
|
|
||||||
|
<h3>Stats</h3>
|
||||||
|
With the 'Stats' dropdown menu, you can select what to display on the button. The text that will be displayed on the button will take the following form:<br>
|
||||||
|
|
||||||
|
"`token/actor name` `prepend title` `stat`"<br>
|
||||||
|
Where the token/actor name is only displayed if 'Display Name' is checked.
|
||||||
|
Normally, the 'Stat' option only displays a value. You can use 'Prepend Title' to add some extra information. For example, by filling in `HP: ` in the 'Prepend Title' field, and set 'Stat' to HP, you will get something like:<br>
|
||||||
|
"HP: 10/20"
|
||||||
|
|
||||||
|
The stats that are available will depend on the game system, and will usually include the most important stats of that system. Other stats, that are not available can be added using the 'Custom' option.
|
||||||
|
|
||||||
|
<h4>Custom Stats</h4>
|
||||||
By selecting 'Custom', you can enter a formula to get any stat from a token by filling in the path the the desired stat (from the token object).<br>
|
By selecting 'Custom', you can enter a formula to get any stat from a token by filling in the path the the desired stat (from the token object).<br>
|
||||||
For example, to get the strength modifier in dnd5e, you'd use the path `actor.data.data.abilities.str.mod`. Any stat you want to display needs to be prefixed by '@', and surrounded by square brackets '[' and ']'.<br>
|
For example, to get the strength modifier in dnd5e, you'd use the path `actor.data.data.abilities.str.mod`. Any stat you want to display needs to be prefixed by '@', and surrounded by square brackets '[' and ']'.<br>
|
||||||
<br>
|
<br>
|
||||||
So for the strength modifier, you'd fill in `[@actor.data.data.abilities.str.mod]`.<br>
|
So for the strength modifier, you'd fill in `[@actor.data.data.abilities.str.mod]`.<br>
|
||||||
You can add text around it: `STR: [@actor.data.data.abilities.str.mod]`<br>
|
You can add text around it: `STR: [@actor.data.data.abilities.str.mod]`<br>
|
||||||
And use multiple stats: `STR: [@actor.data.data.abilities.str.mod] DEX: [@actor.data.data.abilities.dex.mod]`<br>
|
And use multiple stats: `STR: [@actor.data.data.abilities.str.mod] DEX: [@actor.data.data.abilities.dex.mod]`<br>
|
||||||
|
<br>
|
||||||
|
<b>Note:</b> Starting from Foundry v10, `actor.data.data` is replaced with `actor.system`
|
||||||
|
|
||||||
### On Click
|
<h3>On Click</h3>
|
||||||
Determines what Foundry should do when you press the button:
|
Using 'On Click', you can perform something by pressing the button.<br>
|
||||||
* Do Nothing - Does nothing
|
'Custom', 'Set Vision & Light', 'Set Token Wildcard Image', 'Handle Condition', 'Toggle CUB Condition' and 'Dice Roll' are described in more detail below.<br>
|
||||||
* Custom - Assign a custom on click action (see below)
|
'Call Macro' is configured similar to the <a href="https://github.com/CDeenen/MaterialDeck/wiki/Macro-Action">Macro Action</a>, the others should be self-explanatory.
|
||||||
* Center on Token - Centers the view on the selected token
|
|
||||||
* Open Character Sheet - Opens or closes the selected token's character sheet
|
|
||||||
* Open Token Config - Opens or closes the selected token's configuration screen
|
|
||||||
* Toggle Visibility - Toggles the visibility of the selected token
|
|
||||||
* Toggle Combat State - Toggles the combat state of the selected token
|
|
||||||
* Target Token - Targets the selected token
|
|
||||||
* Set Vision - Set the token's vision and lighting
|
|
||||||
* Set Token Wildcard Image - Change the token image to one of the tokens wildcard images (see below)
|
|
||||||
* Toggle Condition - Toggles a condition on the selected token
|
|
||||||
* Toggle CUB Condition - Toggles a [Combat Utility Belt](https://foundryvtt.com/packages/combat-utility-belt/) condition
|
|
||||||
* Toggle Initiative - Toggle the initiative (Shadow of the Demon Lord only)
|
|
||||||
|
|
||||||
#### Custom 'On Click' Function
|
<h4>Custom On Click</h4>
|
||||||
<b>Please note that this function is quite powerful, but can seriously mess up tokens and actors if you're not careful with the targets. Please make sure you fill in the correct path and create a test character to test it out on first!</b><br>
|
<b>Please note that this function is quite powerful, but can seriously mess up tokens and actors if you're not careful with the targets. Please make sure you fill in the correct path and create a test character to test it out on first!</b><br>
|
||||||
<br>
|
<br>
|
||||||
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.<br>
|
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.<br>
|
||||||
@@ -131,11 +154,20 @@ You can set multiple formulas or multiple macros to the same button by separatin
|
|||||||
`[@actor.data.data.attributes.movement.walk] = 25 ; [@actor.data.data.attributes.hp.value] = [@this] ++`<br>
|
`[@actor.data.data.attributes.movement.walk] = 25 ; [@actor.data.data.attributes.hp.value] = [@this] ++`<br>
|
||||||
Or increment the HP by 1 and call the macro 'moveToken':<br>
|
Or increment the HP by 1 and call the macro 'moveToken':<br>
|
||||||
`[@actor.data.data.attributes.hp.value] = [@this] ++ ; @macro moveToken 1 0`
|
`[@actor.data.data.attributes.hp.value] = [@this] ++ ; @macro moveToken 1 0`
|
||||||
### Set Vision
|
|
||||||
|
<h4>Set Vision & Light</h4>
|
||||||
If 'Set Vision' was selected at 'On Click', a lot of vision settings appear. They behave identical to the settings in the Vision tab the Token Configuration screen in Foundry.<br>
|
If 'Set Vision' was selected at 'On Click', a lot of vision settings appear. They behave identical to the settings in the Vision tab the Token Configuration screen in Foundry.<br>
|
||||||
|
|
||||||
|
<h5>Selection Boxes</h5>
|
||||||
|
The selection boxes all have a 'No Change' option. Selecting this will prevent that setting from being updated when pressing the button. Setting it to anything else will perform a change.
|
||||||
|
|
||||||
|
<h5>Number Fields</h5>
|
||||||
If no value is filled in, that value is not updated, so it is possible to set, for example, the 'Dim Light Radius' without affecting the 'Dim Vision' setting by keeping the 'Dim Vision' field empty.
|
If no value is filled in, that value is not updated, so it is possible to set, for example, the 'Dim Light Radius' without affecting the 'Dim Vision' setting by keeping the 'Dim Vision' field empty.
|
||||||
|
|
||||||
#### Set Token Wildcard Image
|
<h5>Sliders & Color Selectors</h5>
|
||||||
|
Sliders and color selectors have a checkbox to their right. The values/color is only updated if that checkbox is selected.
|
||||||
|
|
||||||
|
<h4>Set Token Wildcard Image</h4>
|
||||||
You can change the token image if you use the wildcard image option that foundry provides click [here](https://foundryvtt.com/article/tokens/) for more info on how to set up wildcard images.<br>
|
You can change the token image if you use the wildcard image option that foundry provides click [here](https://foundryvtt.com/article/tokens/) for more info on how to set up wildcard images.<br>
|
||||||
When you set 'On Click' to 'Set Token Wildcard Image' you get the two new boxes in the PI: 'Wildcard Image' and 'Value'.
|
When you set 'On Click' to 'Set Token Wildcard Image' you get the two new boxes in the PI: 'Wildcard Image' and 'Value'.
|
||||||
|
|
||||||
@@ -143,18 +175,54 @@ With 'Wildcard Image' you select what you want the button to do.<br>If it is set
|
|||||||
If you set 'Wildcard Image' to 'Set Image', it will set the image to the n'th image of the list, where 'n' is set using the 'Value' input box.<br>
|
If you set 'Wildcard Image' to 'Set Image', it will set the image to the n'th image of the list, where 'n' is set using the 'Value' input box.<br>
|
||||||
By setting 'Wildcard Image' to 'Offset', you can offset the selected image by 'Value'. So if on one button you have 'Wildcard Image' set to 'Set Image' and 'Value' set to n, after pressing the button set to 'Offset', n will be n plus the offset value.
|
By setting 'Wildcard Image' to 'Offset', you can offset the selected image by 'Value'. So if on one button you have 'Wildcard Image' set to 'Set Image' and 'Value' set to n, after pressing the button set to 'Offset', n will be n plus the offset value.
|
||||||
|
|
||||||
### Toggle Condition
|
<h2>Inventory, Features & Spellbook Modes</h2>
|
||||||
If 'Toggle Condition' was selected at 'On Click', a dropdown menu appears with a list of conditions available in the current game system.<br>
|
The 'Inventory', 'Features' and 'Spellbook' modes all function similarly, where they allow you to display (and roll) an item, feature or spell from the token.
|
||||||
|
|
||||||
### Toggle CUB Condition
|
<h3>Type/Spell Level</h3>
|
||||||
Only works if [Combat Utility Belt](https://foundryvtt.com/packages/combat-utility-belt/) is installed and enabled.<br>
|
'Type' allows you to filter the selection down to, for example, weapons, active abilities, or level 2 spells. The available options depend on the 'Mode' and gaming system.
|
||||||
Allows you to toggle conditions from the CUB 'Condition Lab'. Just fill in the name of the condition in the 'Condition Name' field.
|
|
||||||
|
|
||||||
### Display Name
|
<h3>Selection</h3>
|
||||||
|
Here you can specify how the item, feature or spell is selected.
|
||||||
|
<ul>
|
||||||
|
<li><b>Order</b>: Select a nr in the 'Nr' field, the item in that position of the iteam/feature/spell list will be selected (ordered as they appear in the character sheet)</li>
|
||||||
|
<li><b>Name</b>: Fill in the item/feature/spell name in the 'Name' field, and the first item with that name will be selected</li>
|
||||||
|
<li><b>Id</b>: Fill in the item/feature/spell id in the 'Id' field, and the item with that id will be selected</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>Display Uses/Quantity</h3>
|
||||||
|
Enabling this will display a box at the bottom of the button, displaying either the uses of a feature or spell, or the quantity of the item.
|
||||||
|
|
||||||
|
<h3>Display Name</h3>
|
||||||
|
Enabling this will display the name of the item/feature/spell on the Stream Deck
|
||||||
|
|
||||||
|
<h3>Display Icon</h3>
|
||||||
|
Enabling this will display the icon of the item/feature/spell on the Stream Deck
|
||||||
|
|
||||||
|
<h2>Offsets</h2>
|
||||||
|
Offsets can be used to scroll through the items, features or spells, for items/features/spells that have 'Selection' set to 'Order'.<br>
|
||||||
|
|
||||||
|
<h3>Item Absolute Offset</h3>
|
||||||
|
Set the offset using the 'Offset' field. This will add the 'Offset' value to the 'Nr' field of the selection.
|
||||||
|
|
||||||
|
<h3>Item Relative Offset</h3>
|
||||||
|
Set the offset using the 'Offset' field. Everytime you press the button, the offset increases or decreases by that value.
|
||||||
|
|
||||||
|
<h3>Display Item Offset</h3>
|
||||||
|
Display the current offset on the Stream Deck.
|
||||||
|
|
||||||
|
<h1>Icon, Name & Background</h1>
|
||||||
|
|
||||||
|
<h3>Icon</h3>
|
||||||
|
Selects which icon should be displayed on the button:
|
||||||
|
<ul>
|
||||||
|
<li><b>None</b>: Display no icon</li>
|
||||||
|
<li><b>Token Icon</b>: Display the token icon</li>
|
||||||
|
<li><b>Actor Icon</b>: Display the actor icon</li>
|
||||||
|
<li><b>Default</b>: Display a 'default' icon, depending on the 'stat' option. For example, the 'HP' stat will display a heart, while the 'Speed' stat will display boots</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>Display Name</h3>
|
||||||
Toggles whether or not the button should display the token's name.
|
Toggles whether or not the button should display the token's name.
|
||||||
|
|
||||||
### Display Icon
|
<h3>Background</h3>
|
||||||
Toggles whether or not the button should display the icon of the selected token.
|
|
||||||
|
|
||||||
### Background
|
|
||||||
Sets the background color. The icon needs to have transparent parts (so no jpeg).
|
Sets the background color. The icon needs to have transparent parts (so no jpeg).
|
||||||
Reference in New Issue
Block a user