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

Macro Help, Please!

After working at it for several hours, I cannot figure it out.  So I'm asking for community for help.  (Yes, several hours.  I'm stubborn and like to learn on my own when possible.) I'm trying to use a macro using the Simple Template from the 5e OGL sheet to make a Spell Attack Roll.  The macro is: &{template:simple} {{rname=Spell Attack}} {{mod=[[@{selected|pb}]]+[[@{selected|spellcasting_ability}]]}} {{charname=@{selected|token_name}}} {{r1=[[1d20+[[[[@{selected|pb}]]+[[@{selected|spellcasting_ability}]]]]]]}} {{@{selected|rtype}+[[[[@{selected|pb}]]+[[@{selected|spellcasting_ability}]]]]]]}} I can't get the 2nd roll to work.  The first roll is fine, and in the formatting I want.  I want it to say the roll + total mod, not individual mods.  That's what the mod field is for, imo.  But no matter what I do, I can't get the 2nd roll to work when I select Advantage or Disadvantage. If it matters, I use the Query Advantage option on my character sheets. Thanks for any help!
1499905403

Edited 1499905421
So I just struggled with this myself, but I think I finally have an answer for you. Apparently when you use r1 or r2 in the template, each inline calculation inside the overall r1/r2 needs to have a label ([[CALC]][LABEL]) This macro will work for what you want. &{template:simple} {{rname=Spell Attack}} {{mod=[[@{selected|pb}]]+[[@{selected|spellcasting_ability}]]}} {{charname=@{selected|token_name}}} {{r1=[[1d20+[[@{selected|pb}]][PB]+[[@{selected|spellcasting_ability}}]][SPL]]]}} @{selected|rtype}+[[@{selected|pb}]][PB]+[[@{selected|spellcasting_ability}}]][SPL]]]}}
That works!  Thank you.   I would never have come up with the idea of Labels.
1499916098

Edited 1499916134
vÍnce
Pro
Sheet Author
Kyle G. said: So I just struggled with this myself, but I think I finally have an answer for you. Apparently when you use r1 or r2 in the template, each inline calculation inside the overall r1/r2 needs to have a label ([[CALC]][LABEL]) This macro will work for what you want. &{template:simple} {{rname=Spell Attack}} {{mod=[[@{selected|pb}]]+[[@{selected|spellcasting_ability}]]}} {{charname=@{selected|token_name}}} {{r1=[[1d20+[[@{selected|pb}]][PB]+[[@{selected|spellcasting_ability}}]][SPL]]]}} @{selected|rtype}+[[@{selected|pb}]][PB]+[[@{selected|spellcasting_ability}}]][SPL]]]}} Hmmm, inline labels shouldn't be required... I've seen some strangeness with roll templates and multiple inline rolls that do not have "padding" before and after the double square brackets. I think your macro with padding will work as expected as well as adding inline labels. &{template:simple} {{rname=Spell Attack}} {{mod=[[ @{selected|pb} ]]+[[ @{selected|spellcasting_ability} ]]}} {{charname=@{selected|token_name}}} {{r1=[[ 1d20+[[ [[ @{selected|pb} ]]+[[ @{selected|spellcasting_ability} ]] ]] ]]}} {{@{selected|rtype}+[[ [[ @{selected|pb} ]]+[[ @{selected|spellcasting_ability} ]] ]] ]]}}
Vince said: Hmmm, inline labels shouldn't be required... I've seen some strangeness with roll templates and multiple inline rolls that do not have "padding" before and after the double square brackets. I think your macro with padding will work as expected as well as adding inline labels. &{template:simple} {{rname=Spell Attack}} {{mod=[[ @{selected|pb} ]]+[[ @{selected|spellcasting_ability} ]]}} {{charname=@{selected|token_name}}} {{r1=[[ 1d20+[[ [[ @{selected|pb} ]]+[[ @{selected|spellcasting_ability} ]] ]] ]]}} {{@{selected|rtype}+[[ [[ @{selected|pb} ]]+[[ @{selected|spellcasting_ability} ]] ]] ]]}} I always add a blank space between each bracket of an inline roll after having had many macros break due to that weird behavior you described.  
Thank you for the additional input, Vince and Ed! Vince, your version acts exactly as I wanted.  I'll remember the padding in the future.