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 .
×
Advertisement Create a free account

Global Attack Mod Issue

So I have the following formula for adding in a global attack mod to an attack roll with both advantage and disadvantage. &{template:atk} {{mod=[[@{selected|strength_mod}+@{selected|PB}+@{selected|global_attack_mod}]]}} {{range= 20/60}} {{r1=[[1d20cs>20+@{selected|strength_mod}+@{selected|PB}+@{selected|global_attack_mod}]]}} {{always=1}} {{r2=[[1d20cs>20+@{selected|strength_mod}+@{selected|PB}+@{selected|global_attack_mod}]]}} {{rname=Handaxe}} {{rnamec=Handaxe}} The result of said attack roll appears like this. The first roll works just fine, the second not so much. If I remove the first rolls global_attack_mod entry the disadvantage field then works. I need both to work together and am not seeing an issue in the macro layout. If anyone has any suggestions I appreciate any input. Thanks.
1623384448

Edited 1623384944
Try putting a space after the global_attack_mod Attribute call, as silly as it sounds. {{r1=[[1d20cs>20+@{selected|strength_mod}+@{selected|PB}+@{selected|global_attack_mod} ]] }} I think the chat parser is getting tripped up by too many squackets. The mod Attribute is expanded before the calculation is done, and the [Roll Tag] on the end is butting up against the outer squackets, thusly: {{r1=[[1d20cs>20+@{selected|strength_mod}+@{selected|PB}+ [[1d4[Bless]]]]]}} I'm a bit lost as to where the problem squacket is going, and why it isn't printed in the template if it's no longer paired. How is it interfering with the second roll if it isn't there? Why is the first roll working at all if there's an unpaired squacket? Why aren't elephants? Also, adding the globals into the main calculation like you have done will result in two different results for Advantage/Disadvantage for things with a roll, like Bless's 1d4. This isn't RAW as it's only supposed to be the d20 which is rolled twice - this may not bother you, but something to be aware of. Oh... and you'll be getting yet another value rolled for the {{mod}} property. So three different rolls for @{global_attack_mod}, unless they're all static modifiers like Rage. Incidentally, this is why the Roll20 sheet rolls globals separately - the roll parser is unable to reuse results for later addition, so it currently needs to be rolled as a standalone result and manually added to avoid getting multiple results.
That worked perfectly, thank you very much  Oosh .