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

Question regarding @{global_attack_mod}


Edited 1627236675
Hi! I'm someone new, and I'm experimenting a bit with macros, and needed some help. When I create a macro for an attack, the total is "divided" to show each element involved: When I use @{selected|global_attack_mod} to check one of the tokens, this is what I obtain: But when I add + @{global_attack_mod} to a roll, it does not appear decomposed in its different components, but just the total Is there anyway I can obtain that 6 as 2[Fighting Style: Archery] + 4[Bless]? This is what I am currently using to achieve the previous result, so I am not sure what it is lacking. [[1d20 + @{dexterity_mod}[DEX] + @{pb}[PROF] + @{global_attack_mod}]] Thank you in advance and excuse me if my English was not correct.
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Unfortunately, it looks like global_attack_mod already has inline brackets wrapped around itself which means it's going to nest like that. I'd recommend submitting a bug report on the helpdesk .

Edited 1627256421
Sheet Author
The idea of the global attack mod on the 5e sheet is to use it in the {{global}} field on the roll templates. Nesting in your main roll, as you've done, isn't the RAW way to do it as if you roll with advantage or disadvantage, you will get two different Bless (or other dX rolls) results, one for each d20 roll. It's only the d20 that is supposed to be rolled twice, hence the 5e sheet doesn't add the global mods in to the main roll - it keeps them in its own separate field so you just get one result per attack. Obviously play however you want, just pointing out why it is the way it is - it isn't intended to sit inside another roll expression. Possibly worth noting that it's now (with startRoll() triggered by an action button) entirely possible for this to be done properly, with a single Global roll applied to the two (dis)advantage results *and* added to their totals, so I'd assume this will be fixed at some point. It seems a simple fix, but with the bowl of spaghetti that is the 5e sheet with its many years of evolution & authors, it's probably going to have some baggage attached and turn out to not be a simple fix (ie you may as well shift the whole sheet to action buttons & startRoll() rather than just fix attack buttons).