Roll Templates/Default
From Roll20 Wiki
Page Updated: 2023-01-28 |
Default Roll Template
The Default Roll Template is available in all Roll20. You don't have to even have a character sheet template selected for your game to use it.
Macro Creation
- Complete Guide to Macros & Rolls
- q Text Chat
- Dice Reference
- Order of Operations
- Macros
- Token Reference
- Character Reference
- Roll Templates
- Roll Table
Advanced
- Formatting
- HTML Replacement
- Chat Menus
- Hidden Rolls
- Advanced Macro Tips
- API Commands
- Char Sheet Creation
- External tools
Misc.
To use the default template, you first call &{template:default}
, then (optionally) define what will be shown in the header in a {{name= }}
-section, after which you can create any number of "rows" by creating more {{ }}
-sections.
Contents |
Property | Expected Value |
---|---|
name | The name of the roll, shown in the header of the roll listing. (If not used in a roll, the header will appear at the top of the roll template as a purple bar with no text.) |
(anything) | You can have any number of rows with any name you want, making the template somewhat flexible. The "property" name will be bold. |
The default template is special, and will list out whatever argument you give it in a table. It will put in the middle of the purple header anything you define in the {{name= }}
section, and then with every subsequent {{ }}
segment, it will alternate with white & gray background.
If a =
is used in the {{ }}
rows, the roll template will align the =
in the middle, and all rows will have the =
in the same spot. If any row have lots of more text/content on either side of the =
, it will be pressed to the side of the template for all rolls.
Example:
Notice that the content of the roll template is pressed to the left side, due the text segment on the Note-row. If that segment is removed, the content of the remaining rows will be closer to the center.
Here is a fairly close example of the default template's HTML& CSS with it's dependent CSS classes. If you intend to make your own roll template, or want to start from the default template, the best idea is to start with the code from Jakob's Better Default Template.
Examples
Some more examples using the default roll template. These should give more examples on how they can be used.
Roll template rolls that has inline labels, which will make it easier to look at the roll breakdown(when you hover your mouse over the result).
You can have rolls on both sides of the =
Several attacks at a time
&{template:default} {{name=Fist of Fury}} {{Attack1= [[1d20+5]]}} {{Damage1= [[1d6+3]]}} {{Attack2= [[1d20+5]]}} {{Damage2= [[1d6+3]]}} {{Offhand= [[1d20+4]]}} {{Damage1= [[1d4+3]]}}
Short Rest Macro
It asks you how many to spend & what hit dice to use, and displays how much was recovered as well as how many where spent(using the Reusing Rolls-trick).
&{template:default} {{name=Short Rest}} {{Recover= You heal [[ [[?{How many hit dice do you spend?|1}]]?{What's your Hit dice?|d4|d6|d8|d10|d12} ]] hit points, having spent $[[0]] of their hit dice.}}
Show Token info
Select a token on the map, and call this macro to get info on the token. If the token represents a character, it will show it's character_id
& character_name
, otherwise just show "selected|character_id" & "selected|character_name" if they are missing.
&{template:default} {{name=Token Info }} {{TokenID=@{selected|token_id} }} {{CharacterID=@{selected|character_id} }} {{TokenName=@{selected|token_name} }} {{characterName=@{selected|character_name} }} {{Bar1=@{selected|bar1} / @{selected|bar1|max} }} {{Bar2=@{selected|bar2} / @{selected|bar2|max} }} {{Bar3=@{selected|bar3} / @{selected|bar3|max} }} &{error}
Related Pages
- Complete Macro Guide
- Roll Templates
- Chat Menus - making use of Roll Templates to make Chat menu with buttons.
- Character Sheets
- Building Character Sheets