Introduction to Tables: Difference between revisions
(Add Categories) |
(Link to token properties for) |
||
Line 1: | Line 1: | ||
MapTool Tables make it easy to randomly select an image or a line of text from a list of options. Basic uses for tables include graphical dice rolls, simulating drawing from a decks of cards, generating random treasure, and rolling for random encounters. | MapTool Tables make it easy to randomly select an image or a line of text from a list of options. Basic uses for tables include graphical dice rolls, simulating drawing from a decks of cards, generating random treasure, and rolling for random encounters. | ||
Tables can be used with MapTool's macro scripting language using [[:Category:Table_Function|Table Macro Functions]] | Tables can be used with MapTool's macro scripting language using [[:Category:Table_Function|Table Macro Functions]]. | ||
The loaded campaign's tables can be viewed in the {{ui_location|Tables panel}}, toggled from the menu at {{ui_location|Window > Tables}}. | The loaded campaign's tables can be viewed in the {{ui_location|Tables panel}}, toggled from the menu at {{ui_location|Window > Tables}}. | ||
Line 42: | Line 42: | ||
* Duplicating a table will immediately open the New Table dialog populated with the source table's data and the name ''Copy Of (the name of your source table)''. | * Duplicating a table will immediately open the New Table dialog populated with the source table's data and the name ''Copy Of (the name of your source table)''. | ||
== Special Case: Token Image Tables == | |||
In a token's properties, there is an [[Introduction_to_Tokens#Image_Table|Image Table]] setting with lets you specify a table of 'facing' images intended for tokens on an isometric grid or that are represented by JRPG-style sprites. | |||
Image Tables work by keying the 'facing' value of a token to an image. Facing values are in degrees from -179 to 180. To properly work, image tables need their ''Range'' values to fully include all possible facing values (-179 to 180). Here are some tips on facing values: | |||
* Facing of '90' degrees is directly towards the bottom of the display and increases clockwise. At 180, the facing value loops to -179. | |||
* On a square grid, the four cardinal facing values in degrees are as follow: | |||
** 90: Down/South | |||
** 180: Left/West | |||
** -90: Up/North | |||
** 0: Right/East | |||
* On an isometric grid: | |||
** 45: Down & Right/Southeast | |||
** 135: Down & Left/Southwest | |||
** -135: Up & Left/Northwest | |||
** -45: Up & Right/Northeast | |||
Here are sample values for a table to display a token's facing images in 4 directions on an isometric grid | |||
<table> | |||
<thead> | |||
<tr> | |||
<th>Range</th> | |||
<th>Value / Image</th> | |||
</tr> | |||
</thead> | |||
<tbody> | |||
<tr><td>-179 - -90</td> | |||
<td>Northwest facing image</td></tr> | |||
<tr><td>-89 - 0</td> | |||
<td>Northeast facing image</td></tr> | |||
<tr><td>1 - 90</td> | |||
<td>Southeast facing image</td></tr> | |||
<tr><td>91 - 180</td> | |||
<td>Southwest facing image</td></tr> | |||
</tbody> | |||
</table> | |||
[[Category:Feature Guide]] | [[Category:Feature Guide]] | ||
[[Category:Beginner]] | [[Category:Beginner]] | ||
[[Category:Tutorial]] | [[Category:Tutorial]] |
Revision as of 21:14, 10 March 2020
MapTool Tables make it easy to randomly select an image or a line of text from a list of options. Basic uses for tables include graphical dice rolls, simulating drawing from a decks of cards, generating random treasure, and rolling for random encounters.
Tables can be used with MapTool's macro scripting language using Table Macro Functions.
The loaded campaign's tables can be viewed in the Tables panel
, toggled from the menu at Window > Tables
.
Default Tables
Every install of MapTool includes an option to add a set of default tables to your campaign from the menus by selecting Help > Add Default Tables...
. These tables are both useful and an excellent starting place to learn about basic table use. They include:
- 6 dice image tables for rolling a D4, D6, D8, D10, D12, and D20,
- 2 standard card deck tables, one with jokers and one without.
Using Tables
There are 3 ways to roll a simple result for a table:
- Using the mouse. Double-click the table from the
Tables panel
. If an image is present for the roll result, it will be shown in chat. If not, the 'Value' will be shown instead. - Using chat commands. Enter
/table table_name
or/tbl table_name
in chat to roll the table. Table names are case-sensitive, and if the name has a space enclose it in single or double quotes. If an image is present for the roll result, it will be shown in chat. If not, the 'Value' will be shown instead. - Using macro script.
- The table() function will display only the value of a random or specific row.
- The tableImage() function will display only the Image asset value of a random or specific row. This can be then used as the 'src' attribute in HTML image tags.
Creating Tables
New tables can be added by clicking the green plus symbol in the top left of the Tables panel
(Tables can also be created using the createTable() macro function). When creating a table, the following fields are available to you:
- Name: Your table's name. This name is case sensitive and will be used for chat commands and macros so short, descriptive names are recommended. If you include a space in your table's name you will have to enclose the name in quotes when rolling it with a chat command.
- Roll: A dice code in
XdY+Z
format. If left blank, MapTool will automatically determine a roll from the the lowest and highest values in the Range column of your table. For ranges that use multiple dice, always enter the Roll yourself. For instance, if your table has a total range from 2 to 12, MapTool will create a roll of1d11+1
when you probably want to enter2d6
. - Table Image: This is an image from the Resource Library to visually represent your table in the
- Show Table to Players: When ✓checked, will allow connected players to see the table in the
Tables panel
. - Allow Lookup by Players: When ✓checked, will allow connected players to use the table by double-clicking it in the Table Panels (if visible) or by using chat commands.
- Table Rows: Tables themselves are essentially lists where each row has three columns. Here is where you define your table's rows.
- Range: Either a single integer value or a hyphenated range (such as 5-10). If not set explicitly, the table's Roll is determined by taking the minimum and maximum numbers among your table's Range values.
- Value: A text value for the row. When activated with the mouse or via a chat command, the value will be shown only if no image is present.
- Image: An image from the Resource Library. When activated with the mouse or via a chat command, the row's image will be shown if present.
Note about Ranges: MapTool expects your table ranges to be continuous, i.e. without numerical gaps. A table that has three rows with the ranges 1
, 2
, and 4
will generate a roll of d4
and produce an error whenever '3' is rolled, because there is no corresponding Range value in any of the table's rows.
Editing, Removing, and Duplicating Tables
In the Tables panel
, select a table and click on the pencil icon to edit it, the red minus icon to remove it, or the double file icon to duplicate it. Tables can also be updated using a variety Table Macro Functions, though for most uses of tables the UI will be much more convenient. Here are notes about these table functions:
- When editing a table, remember to update the Roll so it matches your updated table. If you remove the Roll entirely and save the table, MapTool will recalculate a single dice roll for your table's range.
- Removing/deleting a table is permanent and can't be undone!
- Duplicating a table will immediately open the New Table dialog populated with the source table's data and the name Copy Of (the name of your source table).
Special Case: Token Image Tables
In a token's properties, there is an Image Table setting with lets you specify a table of 'facing' images intended for tokens on an isometric grid or that are represented by JRPG-style sprites.
Image Tables work by keying the 'facing' value of a token to an image. Facing values are in degrees from -179 to 180. To properly work, image tables need their Range values to fully include all possible facing values (-179 to 180). Here are some tips on facing values:
- Facing of '90' degrees is directly towards the bottom of the display and increases clockwise. At 180, the facing value loops to -179.
- On a square grid, the four cardinal facing values in degrees are as follow:
- 90: Down/South
- 180: Left/West
- -90: Up/North
- 0: Right/East
- On an isometric grid:
- 45: Down & Right/Southeast
- 135: Down & Left/Southwest
- -135: Up & Left/Northwest
- -45: Up & Right/Northeast
Here are sample values for a table to display a token's facing images in 4 directions on an isometric grid
<thead> </thead> <tbody></tbody>
Range | Value / Image |
---|---|
-179 - -90 | Northwest facing image |
-89 - 0 | Northeast facing image |
1 - 90 | Southeast facing image |
91 - 180 | Southwest facing image |