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

Bug with Roll Queries in large multi-roll macros.

1454015199

Edited 1454015715
Diana P
Pro
Sheet Author
Hi, We are seeing an issue with multiple roll queries in large multi-roll macros.&nbsp; It was first brought to my attention in: <a href="https://app.roll20.net/forum/post/2877107/dandd-3-" rel="nofollow">https://app.roll20.net/forum/post/2877107/dandd-3-</a>... For testing purposes, I am using the default roll template.&nbsp; The results look the same in both Firefox and Chrome, I only use one add-on (Stylish) and it works the same if I have it disabled, etc. Basically, as the complexity of the macro goes up with additional roll queries, it eventually stops calculating correctly.&nbsp; In the entries after it stops calculating correctly, it only uses the first value found (whether it is a roll or just a number) and then ignores the rest of the calculation.&nbsp; See mouse-over results for the calculations: The latter part of the calculation takes the bonuses from the roll, divides it by 100, and then adds it back in so it is easy to see where the calculation breaks.&nbsp; Here are a set of 3 different macros, one with 2 roll queries, one in the attack calculation and one in the damage calculation, which works fine; the second with 3 roll queries, with the third query added to the attack calculation, which shows the calculations stopping working on the crit confirmation for attack 9; and the last with 5 roll queries, the additional ones are added one each to the attack and damage calculations and shows the calculation stopping on calculation for the 6th attack: ... macros, values used, and console log to follow in subsequent posts.
1454016266
Diana P
Pro
Sheet Author
I do have the D&D3.5 Character Sheet Template enabled for this campaign, but I am not using any of the fields; only some self-made Attributes and Abilities on the Attributes and Abilities tab. The ability Macro: &{template:default} {{name=Test Multi Attacks with Queries}} {{attack1= 1st attack hits AC [[ @{attackcalc} ]] }} {{critconfirm1= and deals crit'l dmg vs AC [[ @{attackcalc} ]] or less}} {{fumbleroll=**Fumble** }} {{damage1= for [[ @{damagecalc} ]] dmg, plus @{specprops} }} {{critdamage1=+ [[ @{critcalc} ]] crit'l dmg}} {{attack2= 2nd attack hits AC [[ @{attackcalc} ]] }} {{critconfirm2= and deals crit'l dmg vs AC [[ @{attackcalc} ]] or less}} {{damage2= for [[ @{damagecalc} ]] dmg, plus @{specprops} }} {{critdamage2=+ [[ @{critcalc} ]] crit'l dmg}} {{attack3= 3rd attack hits AC [[ @{attackcalc} ]] }} {{critconfirm3= and deals crit'l dmg vs AC [[ @{attackcalc} ]] or less}} {{damage3= for [[ @{damagecalc} ]] dmg, plus @{specprops} }} {{critdamage3=+ [[ @{critcalc} ]] crit'l dmg}} {{attack4= 4th attack hits AC [[ @{attackcalc} ]] }} {{ critconfirm4= and deals crit'l dmg vs AC [[ @{attackcalc} ]] or less }} {{damage4= for [[ @{damagecalc} ]] dmg, plus @{specprops} }} {{ critdamage4=+ [[ @{critcalc} ]] crit'l dmg }} {{attack5= 5th attack hits AC [[ @{attackcalc} ]] }} {{critconfirm5= and deals crit'l dmg vs AC [[ @{attackcalc} ]] or less}} {{damage5= for [[ @{damagecalc} ]] dmg, plus @{specprops} }} {{critdamage5=+ [[ @{critcalc} ]] crit'l dmg }} {{attack6= 6th attack hits AC [[ @{attackcalc} ]] }} {{critconfirm6= and deals crit'l dmg vs AC [[ @{attackcalc} ]] or less }} {{damage6= for [[ @{damagecalc} ]] dmg, plus @{specprops} }} {{critdamage6=+ [[ @{critcalc} ]] crit'l dmg}} {{attack7= 7th attack hits AC [[ @{attackcalc} ]] }} {{critconfirm7= and deals crit'l dmg vs AC [[ @{attackcalc} ]] or less}} {{damage7= for [[ @{damagecalc} ]] dmg, plus @{specprops} }} {{critdamage7=+ [[ @{critcalc} ]] crit'l dmg}} {{attack8= 8th attack hits AC [[ @{attackcalc} ]] }} {{critconfirm8= and deals crit'l dmg vs AC [[ @{attackcalc} ]] or less}} {{damage8= for [[ @{damagecalc} ]] dmg, plus @{specprops} }} {{critdamage8=+ [[ @{critcalc} ]] crit'l dmg}} {{attack9= 9th attack hits AC [[ @{attackcalc} ]] }} {{critconfirm9= and deals crit'l dmg vs AC [[ @{attackcalc} ]] or less}} {{damage9= for [[ @{damagecalc} ]] dmg, plus @{specprops} }} {{critdamage9=+ [[ @{critcalc} ]] crit'l dmg}} {{attack10= 10th attack hits AC [[ @{attackcalc} ]] }} {{critconfirm10= and deals crit'l dmg vs AC [[ @{attackcalc} ]] or less}} {{damage10= for [[ @{damagecalc} ]] dmg, plus @{specprops} }} {{critdamage10=+ [[ @{critcalc} ]] crit'l dmg}} the variables set up in Attributes: attackcalc: 1d20cs&gt;@{critmin} + @{statcalc} + @{attackbonuses} + @{attackqueries} + ( ( @{statcalc} + @{attackbonuses} + @{attackqueries} ) /100) damagecalc: either 1d4 + @{statcalc} + @{damagebonuses} + @{damagequeries} + ( ( @{statcalc} + @{damagebonuses} + @{damagequeries} )/100) or 3 + @{statcalc} + @{damagebonuses} + @{damagequeries} + ( ( @{statcalc} + @{damagebonuses} + @{damagequeries} )/100) critcalc: 2*@{damagecalc} specprops: Poison statcalc: 2 attackbonuses: 3 attackqueries: 2 queries: ?{Attack Circumstance Mod?|0} [Circumstance] 3 queries: 2*?{Flanking?|Yes,1|No,0} [Flank] + ?{Attack Circumstance Mod?|0} [Circumstance] 5 queries: 2*?{Charging?|Yes,1|No,0} [Charge] + 2*?{Flanking?|Yes,1|No,0} [Flank] + ?{Attack Circumstance Mod?|0} [Circumstance] damagebonuses: 2 damagequeries: 2 queries: ?{Damage Circumstance Bonus?|0}[Circumstance] 5 queries: ?{Another Query?|Yes,2|No,0} + ?{Damage Circumstance Bonus?|0}[Circumstance] critmin: 15 I put the log file here: <a href="https://github.com/suldae/Misc-Stuff/blob/master/C" rel="nofollow">https://github.com/suldae/Misc-Stuff/blob/master/C</a>... If needed, my tests were done in this campaign: <a href="https://app.roll20.net/campaigns/details/77455/d-a" rel="nofollow">https://app.roll20.net/campaigns/details/77455/d-a</a>... using " Test Mob " which is linked to the carrion crawler token on the Start page. Thanks for your help with this.
1454081092

Edited 1454081162
chris b.
Pro
Sheet Author
API Scripter
Sometimes removing spaces around curly brackets and parenthesis helps And also leaving one space before and after double square brackets, but not inside them. (so " [[@{mystuff}]] " ) Otherwise yes I've seen it go crazy with long macros.&nbsp; Why should spaces matter? i have no idea &nbsp;I thought it was simply about removing them to shorten the length, but sometimes I had to add spaces back around the inline rolls as well so they would all calculate
1454084840
Diana P
Pro
Sheet Author
That was my original thought as well.&nbsp; The original macro had no spaces; I added them to see if that would make a difference.&nbsp; However, I see no difference between having spaces in the square double brackets or before or after the curly braces and parenthesis and not having those spaces.&nbsp; The macro's output stops calculating correctly at the exact same place regardless of the spaces.&nbsp; And I find it easier to read the macro with the spaces so I left them in for my testing. :)