Difference between revisions of "Macros/102"
From Roll20 Wiki
Stephanie P. (Talk | contribs) |
Andreas J. (Talk | contribs) m |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | Now that you know how to make a macro, let us talk about '''crafting''' a macro, what goes '''into''' a macro. | + | {{revdate}}{{clear}} |
+ | |||
+ | Previous: [[Macros/101]] | ||
+ | {{NavMacroDocs}} | ||
+ | Now that you know how to make a [[macro]], let us talk about '''crafting''' a [[macro]], what goes '''into''' a macro. | ||
The most basic macros are simple roll commands and emotes: | The most basic macros are simple roll commands and emotes: | ||
Line 20: | Line 24: | ||
|} | |} | ||
− | These are simple macros, easy to make on the fly, but they tend to be very spammy as the /roll command outputs a minimum of three lines by itself. This is where the | + | These are simple macros, easy to make on the fly, but they tend to be very spammy as the <code>/roll</code> command outputs a minimum of three lines by itself. This is where the [[Inline Roll]] comes into play. |
{| | {| | ||
Line 64: | Line 68: | ||
− | That last macro probably looks weird. It takes advantage of the [[ | + | That last macro probably looks weird. It takes advantage of the [[Order of Operations]] used in evaluating macros/commands and the fact that queries are resolved before dice rolls. This means I can choose whether to add my sneak attack dice when I attack. If I don't want to add sneak attack dice, because I can't, I just type a 0 when that box appears and the rest of the macro will execute cleanly. |
+ | |||
+ | These macros are more flexible than our previous batch, but when you level up you have to manually recalculate your numbers, and make sure every macro gets adjusted. | ||
+ | |||
+ | I hope this tutorial is useful. | ||
+ | |||
+ | ===Todo=== | ||
+ | create The next tutorial covers using Attributes inside macros: [[Macros/103]] | ||
− | + | <hr> | |
+ | Originally created by [[User:219890|GenKitty]] ([[User talk:219890|talk]]) 12:01, 24 July 2015 (EDT) | ||
− | + | Updated by [[Andreas J.]] in Nov 2021. | |
+ | [[Category:Old Pages]] | ||
+ | [[Category:Macros]] |
Latest revision as of 15:07, 28 November 2021
Page Updated: 2021-11-28 |
Previous: Macros/101
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.
Now that you know how to make a macro, let us talk about crafting a macro, what goes into a macro.
The most basic macros are simple roll commands and emotes:
These are simple macros, easy to make on the fly, but they tend to be very spammy as the /roll
command outputs a minimum of three lines by itself. This is where the Inline Roll comes into play.
[[diceroll]] [[1d20+3]] |
These macros take up less room in the chat window and are much easier to read, while still being fairly easy to write. But these macros aren't flexible at all. They do not take into account temporary modifiers to hit and damage, which fluctuate fairly chaotically in some systems. For that, we need the Roll Query.
?{Query Text|Default Option} ?{Modifier to Hit?|0} ?{TemporaryMods} |
Roll Queries will cause a dialog box to pop up and ask you for a response. You can choose to not use a default option, but that requires that you type a value because leaving that box empty will make your macro fail in any number of delightful, obscure, ways. My suggestion is to always use a default of 0 so you can just hit enter and move on with life.
/em attacks with his longsword! He his AC [[1d20+11+ ?{Modifier to Hit|0}]] for a potential [[1d10 + 7 + ?{Modifier to Damage|0}]] damage.
/em casts Healing Word, the target spends a healing surge and adds [[2d6 + ?{Any bonus healing?|0}]] additional healing.
/em attempts an Acrobatics check: [[1d20 + 5 + ?{TempMods|0}]]
/em attacks with Clever Strike. She hits AC [[1d20 + 10]] for [[1d6 + 4 + ?{Modifier to Damage|0} + ?{Sneak?|[NH]2d6} ]] potential damage.
That last macro probably looks weird. It takes advantage of the Order of Operations used in evaluating macros/commands and the fact that queries are resolved before dice rolls. This means I can choose whether to add my sneak attack dice when I attack. If I don't want to add sneak attack dice, because I can't, I just type a 0 when that box appears and the rest of the macro will execute cleanly.
These macros are more flexible than our previous batch, but when you level up you have to manually recalculate your numbers, and make sure every macro gets adjusted.
I hope this tutorial is useful.
[edit] Todo
create The next tutorial covers using Attributes inside macros: Macros/103
Originally created by GenKitty (talk) 12:01, 24 July 2015 (EDT)
Updated by Andreas J. in Nov 2021.