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

Inline roll breaking in complex macros

1470323169

Edited 1470324027
Detailed Description of the Problem /  Steps to Reproduce the Problem When trying to write macros with above-average length/complexity, inline rolls sometimes break down. The issue is semi-consistent (on rare times the same macro will work flawlessly and break down shortly after, but that's a minority case and I have not been able to track down what would make it work. &{template:default} {{name=**Winged Horde [W]**}} {{Standard=Arcane ✦ Implement ✦ Illusion ✦ Psychic ✦ Thunder}} {{TARGET=Enemies ✦ AB1/3 R10}} {{ATTACK=[[1d20cs>@{PSC}+[[@{LVL}+@{RM|max}+@{IMP}+@{ATW}]]+[[?{Attack Mod|0}+?{PoS|No,0|Yes,1}]]]] [[1d20cs>@{PSC}+[[@{LVL}+@{RM|max}+@{IMP}+@{ATW}]]+[[?{Attack Mod|0}+?{PoS|No,0|Yes,1}]]]] [[1d20cs>@{PSC}+[[@{LVL}+@{RM|max}+@{IMP}+@{ATW}]]+[[?{Attack Mod|0}+?{PoS|No,0|Yes,1}]]]] [[1d20cs>@{PSC}+[[@{LVL}+@{RM|max}+@{IMP}+@{ATW}]]+[[?{Attack Mod|0}+?{PoS|No,0|Yes,1}]]]] [[1d20cs>@{PSC}+[[@{LVL}+@{RM|max}+@{IMP}+@{ATW}]]+[[?{Attack Mod|0}+?{PoS|No,0|Yes,1}]]]] [[1d20cs>@{PSC}+[[@{LVL}+@{RM|max}+@{IMP}+@{ATW}]]+[[?{Attack Mod|0}+?{PoS|No,0|Yes,1}]]]] [[1d20cs>@{PSC}+[[@{LVL}+@{RM|max}+@{IMP}+@{ATW}]]+[[?{Attack Mod|0}+?{PoS|No,0|Yes,1}]]]] [[1d20cs>@{PSC}+[[@{LVL}+@{RM|max}+@{IMP}+@{ATW}]]+[[?{Attack Mod|0}+?{PoS|No,0|Yes,1}]]]] VS Will}} {{HIT=[[2d6+1d4+[[@{IMP|max}+@{PSC|max}+@{ATW|max}]]+[[?{Damage Mod|0}+?{PoS|No,0|Yes,1}*(3d8+6)+?{ES|No,0|Yes,1}*(-6)+?{EoT|No,0|Yes,3}]]]] damage No OA UEoCNT **-2** to next attack roll **-2** to hit me UEoCNT 1T grants CA UEoCNT}} {{CRIT=[[[[@{CRIT}]]d[[@{CRIT|max}]]+[[@{CRIT}*2]]+[[16+@{IMP|max}+@{PSC|max}+@{ATW|max}+?{Damage Mod|0}+?{PoS|No,0|Yes,1}*30+?{ES|No,0|Yes,1}*(-6-@{CRIT}*2)+?{EoT|No,0|Yes,3}]]]] damage}} In this macros (and many others with a similar format) the CRIT inline roll breaks down, displaying as:  [[4d 6 + 8 + 50 ]] damage Parts in bold are what is displayed as inline rolls result (the 4 for some odd reason is not), and obviously the total is not compounded as it should be. Spacing the brackets has no effect, and i re-written that macor several times trimming it down as much as possible, but with no success. Adding a pair of [[ bracket in the CRIT line AND spacing the brackets works as a fix, but only for some of the similar macros, while other seem to be unaffected. The revised crit line is: {{CRIT=[[ [[ [[@{CRIT}]]d[[@{CRIT|max}]]+[[@{CRIT}*2]]+[[16+@{IMP|max}+@{PSC|max}+@{ATW|max}+?{Damage Mod|0}+?{PoS|No,0|Yes,1}*30+?{ES|No,0|Yes,1}*(-6-@{CRIT}*2)+?{EoT|No,0|Yes,3}]] ]] damage}} and gives this output [[ 61 damage Setup Windows NT 10.0, Chrome/51.0.2704.103, JS enabled, Cookies enabled, resolution 2560 x 1440 (browser 2560 x 1295), Flash 22.0.-1
You have one too many sets of brackets on the right, also be sure to have a space at the beginning and the end of every pair of inline brackets. try {{CRIT=[[ [[ @{CRIT} ]]d[[ @{CRIT|max} ]]+[[ @{CRIT}*2 ]]+[[ 16+@{IMP|max}+@{PSC|max}+@{ATW|max}+?{Damage Mod|0}+?{PoS|No,0|Yes,1}*30+?{ES|No,0|Yes,1}*(-6-@{CRIT}*2)+?{EoT|No,0|Yes,3} ]] ]] damage}} Hope that helps
1470325584

Edited 1470325669
The line with "one too many sets of bracket" was intentional and as pointed out it actually fixes some macros (but not all of them). Also, as outlined in my post, I already tried the "spacing out bracket sets" trick without success. Your line gives the following output: [[ 4 d 6 + 8 + 35 ]] Which "fixes" the oddity of missing inline on the 4, but not the main problem of the macro.
1470336569

Edited 1470341293
Silvyre
Forum Champion
The issue likely lies with the Attribute calls with the max flag. Within Abilities, Attribute calls with the 'max' flag require a keyword (e.g. 'selected', 'target|TargetName', ' character_name ', etc.) to work . (Edit: this is no longer the case.) Adding a keyword to every Attribute call with the 'max' and removing the extra opening pair of inline roll brackets should fix your macros. It can be an understandable inconvenience (to either the players or to a GM supplying Ability macros to multiple Characters) to be required to supply/use a keyword to all Attribute calls using the 'max' flag within all Abilities. As such, I'll suggest a 'hack' that may be helpful: @{ @{character_name} |AttributeName|max} . Unfortuantely, this 'hack' does not work off the bat; it requires a bit of setup: Create a Character that All Players see within their Journal and have permission to edit. (Some users name this Character something like 'Macros'.) Add an Attribute to the 'Macros' Character and give it the following Current value: @{ If the above Attribute was named 'A', we can make the 'hack' work via @{Macros|A} @{character_name} |AttributeName|max} .
1470338617

Edited 1470338705
Thank you for the reply Silvyre, but I'm not sure if I understand what is going on. Most of the macros I write make use of the MAX flag, and I never experienced problems until this character came up. Also other rolls in the macro posted make use of the MAX flag without problems. As a note, (that I forgot to mention) the macros are abilities in the character sheet, called either from the sheet itself or as token actions.
1470341100
Silvyre
Forum Champion
My apologies; apparently the issue I was referencing has been fixed. Try giving the "spacing out bracket sets" treatment to every inline roll in the macro, not just those in the final line.
1470343457

Edited 1470343469
Silvyre said: Try giving the "spacing out bracket sets" treatment to every inline roll in the macro, not just those in the final line. This seems to work so far, thank you very much. Although I have to say I am puzzled, how and why is an inline roll affecting a different inline roll?
Mattia said: Silvyre said: Try giving the "spacing out bracket sets" treatment to every inline roll in the macro, not just those in the final line. This seems to work so far, thank you very much. Although I have to say I am puzzled, how and why is an inline roll affecting a different inline roll? More likely the regex being used to sort through the rolls is hanging up somewhere and having issues with complex nested commands and rolls.