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 .
×

5e: Get value of the advantage toggle

1787227204

Edited 1787227292
I have a macro to roll weapon attacks, using the default template and some buttons for each type of strike. &{template:default} {{name=瑱 Spear}} {{Attack Rolls=[[1d20+@{strength_mod}[STR]+@{pb} + (@{global_attack_mod})[mod]]] / [[1d20+@{strength_mod}+@{pb} + (@{global_attack_mod})[mod]]]}} {{Actions=[Jab](~Jab-Spear) [Reverse](~ReverseStrike) [Smite!](~Smite!)}} (added linebreaks for readability) Instead of querying advantage in the macro   -  a pain in the bum to do when most of your strikes are normal - I'd like to use the advantage toggle from the 5e sheet (advantage/normal/disadvantage). The sheet uses @{rtype} for this kind of thing, but I've no idea how to apply that to the default template. Tried adding {{Advantage?=@{rtype} + @{strength_mod} + @{pb} + (@{global_attack_mod})[mod]]]}}}} as an experiment, but that just broke the macro. Is there a way to get advantage on the default template without  asking the player every time?
The only way to do what you are looking for is to not use the default roll template. When the rtype is set to 'Toggle', the code that comes out is one of three different options that include three fields: 'query', 'normal/advantage/disadvantage', and the 'r2' field. This will not work in your macro, because it relies on the D&D 5E (Classic) roll template, which works differently than the 'default' template that you are using. There is javascript built in to the sheet that changes how the braces work and how they are displayed. The 'rtype' attribute is automatically updated by the sheetworkers when you change the Roll Queries setting on the character sheet, and the 'advantagetoggle' attribuet is automatically updated when you change the toggle between Advantage/Normal/Disadvantage. Here are what the various attributes are, and this might help explain why you're not getting what you're looking for.  rtype Always: {{always=1}} {{r2=[[@{d20} rtype Toggle: @{advantagetoggle} rtype Query:  @{queryadvantage} rtype Never:  {{normal=1}} {{r2=[[0d20 advantagetoggle Advantage {{query=1}} {{advantage=1}} {{r2=[[@{d20} advantagetoggle Normal {{query=1}} {{normal=1}} {{r2=[[0d20 advantagetoggle Disdvantage {{query=1}} {{disadvantage=1}} {{r2=[[@{d20} queryadvantage {{query=1}} ?{Advantage?|Normal Roll,&#123&#123normal=1&#125&#125 &#123&#123r2=[[0d20|Advantage,&#123&#123advantage=1&#125&#125 &#123&#123r2=[[@{d20}|Disadvantage,&#123&#123disadvantage=1&#125&#125 &#123&#123r2=[[@{d20}} Advantage simply means rolling two dice and using the higher roll. It looks like you already are rolling twice, so all you have to do is use the higher roll for advantage, use the left roll for normal, and use the lower roll for disadvantage. I'm not clear on what exactly you want to do differently, because the macro you shared doesn't query for advantage at all, and already shows advantage without a query. The dice code for a single die roll that shows advantage is: [[2d20kh1+@{strength_mod}[STR]+@{pb} + (@{global_attack_mod})[mod]]]
Eugh, I had a feeling that would be the case. Thanks for the detailed breakdown: I've always struggled with making sense of the rtype/r1/r2 attributes in 5e macros, and this helps. In answer to your question, I want the chat to show whether the roll was made with advantage, disadvantage, or a straight roll. For now I'm just rolling both and announcing which roll counts over VC, but I would prefer to have it on record - and it makes it easier for the GM to see at a glance. (Also, apparently, if you have two separate rolls on a macro, the 3D dice only shows the second roll. Which isn't the end of the world but makes me sad.) Do you know if it's possible to add buttons to 5e attack macros (like the jab/strike/smite from my example, which call separate damage macros)?
1787247786

Edited 1787247893
Gauss
Forum Champion
Yes, you can add the buttons to 5e macros. Stick the buttons in the description ("desc" section).  As for 3d dice, you need to add [[0]] between your fields for every inline roll. example: &{template:default} {{name=瑱 Spear}} [[0]] [[0]] {{Attack Rolls=[[1d20+@{strength_mod}[STR]+@{pb} + (@{global_attack_mod})[mod]]] / [[1d20+@{strength_mod}+@{pb} + (@{global_attack_mod})[mod]]]}} {{Actions=[Jab](~Jab-Spear) [Reverse](~ReverseStrike) [Smite!](~Smite!)}}
Oooh, brilliant, thank you!