Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Generic Attack Macro with Advantage and +hit Queries

I developed a generic macro to use for monster attacks as DM that queries for advantage/disadvantage and for +hit so it can be used for any monster.  I was being lazy and not creating character sheets for enemies (is this what everyone else does?) and instead making big macros for each monster's attack that had hit roll and damage roll all together.  This worked fine for some early/small campaigns, but as monsters got more attacks and my players got high level enough to force advantage and disadvantage more often, it became cumbersome.  When I had to roll advantage or disadvantage I would hit the macro twice and bombard my players with an enormous wall of dice rolls. God forbid the monsters had 3+ attacks.  This way I can just hit this macro for each attack (and answer the queries) and then have a damage macro for each monster instead, hopefully cutting down on chat box clutter and me having to sort through huge dice rolls to pick out the advantage and disadvantage. As for the macro itself, it kept wanting to break on me because it didn't like queries within queries, but swapping in some HTML seemed to fix it. To use, simply hit the macro, select standard, advantage, or disadvantage, then type in the +hit modifier.  Macro as follows: [[ ?{Attack Type|Standard, 1d20 + ?{To Hit}|Advantage, 2d20d1 + ?{To Hit}|Disadvantage, 2d20kl1 + ?{To Hit}} ]]
1617004297
Ziechael
Forum Champion
Sheet Author
API Scripter
Thanks Chris, always great when the community takes the time to share :) Because I can never resist a teaching moment, especially around queries, here is a simplified version: [[ ?{Attack Type|Standard,1d20|Advantage,2d20d1|Disadvantage,2d20kl1} + ?{To Hit|0} ]] Because you have the second query as a static addition to all results of the first query you can just put it outside of the query and save yourself the headache of html entities. I also added a default '0' value to the To Hit query to avoid a potentially roll-breaking null entry.
Thanks! That is way simpler. I'm pretty new to this so I appreciate the help!
1617091706
Ziechael
Forum Champion
Sheet Author
API Scripter
No problem, to be 'pretty new' and already using html replacements as part of nested queries you are WAY ahead of the curve I'd say :) Keep up the great work!