Difference between revisions of "Macros/Nested Abilities"
From Roll20 Wiki
Andreas J. (Talk | contribs) (transclude from Macro page) |
Andreas J. (Talk | contribs) m |
||
Line 16: | Line 16: | ||
%{bob|attack} | %{bob|attack} | ||
%{bob|dmg} | %{bob|dmg} | ||
− | <pre> | + | </pre> |
You need to change the <code>#</code> into <code>%</code>, type <code>{</code>, then the name of the character, a vertical pipe (<code>|</code>), the ability name, and closing the expression with <code>}</code>. | You need to change the <code>#</code> into <code>%</code>, type <code>{</code>, then the name of the character, a vertical pipe (<code>|</code>), the ability name, and closing the expression with <code>}</code>. | ||
Line 47: | Line 47: | ||
Then You can have a chat command where you can choose which ability to use: | Then You can have a chat command where you can choose which ability to use: | ||
(example might need converted to [[HTML Entities]]): | (example might need converted to [[HTML Entities]]): | ||
− | < | + | <pre>?{Which ability?|Attack,%{Bugbear|attack} |Damage,%{Bugbear|damage} |Both,%{Bugbear|Both} }</pre> |
<noinclude>See [[Roll Queries]] for more info on nesting.</noinclude> | <noinclude>See [[Roll Queries]] for more info on nesting.</noinclude> |
Revision as of 13:38, 30 November 2021
Page Updated: 2021-11-30 |
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.
An ability is a macro which is tied to to a specific character's Attributes & Abilities-tab. Like macros, abilities can be nested inside each other, which gives you the capacity to chain abilities together, and call multiple abilities with a single command.
Nesting an ability is similar to nesting a macro but with a slight twist. Like a macro, simply include the name of the abilities you wish to call on separate lines inside your main ability.
Converting a nested macro to a nested ability
#attack #damage
becomes
%{bob|attack} %{bob|dmg}
You need to change the #
into %
, type {
, then the name of the character, a vertical pipe (|
), the ability name, and closing the expression with }
.
The vertical pipe(|
) key can be found above the backslash key \ on most keyboards.
- US keyboard: usually near the Enter-key. Shift+\ to type
- European keyboards: Usually found on the number row
- Finnish, Swedish keyboard: next to the right Shift. AltGr+| to type
Note:
Currently the ability reference symbol (%
) does not auto complete at this time like the attribute reference symbol (@
) or macro reference symbol (#
) do. You must type the entire thing yourself.
Example
In this example, we'll have three abilities: %{damage}
%{attack}
and %{both}
and our character who will be named Bugbear
Ability %{damage}
:
/roll 1d4+11
Ability %{attack}
:
/roll 1d20+9
Ability %{both}
:
%{Bugbear|attack} %{Bugbear|damage}
Then You can have a chat command where you can choose which ability to use: (example might need converted to HTML Entities):
?{Which ability?|Attack,%{Bugbear|attack} |Damage,%{Bugbear|damage} |Both,%{Bugbear|Both} }
See Roll Queries for more info on nesting.
More Examples
Other pages with macro examples: