From 5d33e6566afc586445ec8162f91f5e5b9860401a Mon Sep 17 00:00:00 2001 From: Material Foundry <68693756+CDeenen@users.noreply.github.com> Date: Mon, 5 Sep 2022 20:10:16 +0200 Subject: [PATCH] Updated Token Action (markdown) --- Token-Action.md | 178 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 123 insertions(+), 55 deletions(-) diff --git a/Token-Action.md b/Token-Action.md index 3baf6ca..7616acd 100644 --- a/Token-Action.md +++ b/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.
-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. ![](https://github.com/CDeenen/MaterialDeck/blob/Master/wiki/img/TokenControl.png) @@ -14,61 +14,84 @@ Button functions in the top row, from left to right: * Display movement speed * Display initiative -# Configuration -#### 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.
+

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.
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.
-Currently 'DnD 5e', 'DnD 3.5e', 'Pathfinder 1e', 'Pathfinder 2e' and 'Shadow of the Demon Lord' are supported.
+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.
-### Token -The token drop-down box will allow you to set what token should be targeted for the button actions. -* Selected Token: The currently selected token -* 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 -You can select a stat to be displayed on the button (under the name, if 'Display Name' is selected).
-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) +

Overview

-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 +

Token Selection

+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: + + + +In case of 'Token Name' or 'Actor Name', the first token or actor with that name will be selected. + +

Page-Wide Token

+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. + +

Mode

+The Token Action has multiple modes to select from: + + +

Token Mode

+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. + +

Stats

+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:
+ +"`token/actor name` `prepend title` `stat`"
+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:
+"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. + +

Custom Stats

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).
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 ']'.

So for the strength modifier, you'd fill in `[@actor.data.data.abilities.str.mod]`.
You can add text around it: `STR: [@actor.data.data.abilities.str.mod]`
And use multiple stats: `STR: [@actor.data.data.abilities.str.mod] DEX: [@actor.data.data.abilities.dex.mod]`
+
+Note: Starting from Foundry v10, `actor.data.data` is replaced with `actor.system` -### On Click -Determines what Foundry should do when you press the button: -* Do Nothing - Does nothing -* Custom - Assign a custom on click action (see below) -* 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) +

On Click

+Using 'On Click', you can perform something by pressing the button.
+'Custom', 'Set Vision & Light', 'Set Token Wildcard Image', 'Handle Condition', 'Toggle CUB Condition' and 'Dice Roll' are described in more detail below.
+'Call Macro' is configured similar to the Macro Action, the others should be self-explanatory. -#### Custom 'On Click' Function +

Custom On Click

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!

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.
@@ -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] ++`
Or increment the HP by 1 and call the macro 'moveToken':
`[@actor.data.data.attributes.hp.value] = [@this] ++ ; @macro moveToken 1 0` -### Set Vision + +

Set Vision & Light

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.
+ +
Selection Boxes
+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. + +
Number Fields
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 +
Sliders & Color Selectors
+Sliders and color selectors have a checkbox to their right. The values/color is only updated if that checkbox is selected. + +

Set Token Wildcard Image

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.
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.
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.
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 -If 'Toggle Condition' was selected at 'On Click', a dropdown menu appears with a list of conditions available in the current game system.
+

Inventory, Features & Spellbook Modes

+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 -Only works if [Combat Utility Belt](https://foundryvtt.com/packages/combat-utility-belt/) is installed and enabled.
-Allows you to toggle conditions from the CUB 'Condition Lab'. Just fill in the name of the condition in the 'Condition Name' field. +

Type/Spell Level

+'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. -### Display Name +

Selection

+Here you can specify how the item, feature or spell is selected. + + +

Display Uses/Quantity

+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. + +

Display Name

+Enabling this will display the name of the item/feature/spell on the Stream Deck + +

Display Icon

+Enabling this will display the icon of the item/feature/spell on the Stream Deck + +

Offsets

+Offsets can be used to scroll through the items, features or spells, for items/features/spells that have 'Selection' set to 'Order'.
+ +

Item Absolute Offset

+Set the offset using the 'Offset' field. This will add the 'Offset' value to the 'Nr' field of the selection. + +

Item Relative Offset

+Set the offset using the 'Offset' field. Everytime you press the button, the offset increases or decreases by that value. + +

Display Item Offset

+Display the current offset on the Stream Deck. + +

Icon, Name & Background

+ +

Icon

+Selects which icon should be displayed on the button: + + +

Display Name

Toggles whether or not the button should display the token's name. -### Display Icon -Toggles whether or not the button should display the icon of the selected token. - -### Background +

Background

Sets the background color. The icon needs to have transparent parts (so no jpeg). \ No newline at end of file