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

Using [[]] is breaking some macros

I have a &{template:pc} macro working for a single attack that utilizes floor calculations to determine static bonuses. However, those same calculations, when run through the 2nd+ roll/rolldmg yields an output that doesn't calculate fully. Here is the current macro that I'm working with: &{template:pc& #125; {{showchar=[[1]]& #125;& #125; {{charname=Raja - Full Attack& #125;& #125; {{name=BASTARDSWORD& #125;& #125; {{type=attack& #125;& #125; {{atkvs=Melee vs AC& #125;& #125; {{attack=1& #125;& #125; {{roll=[[1d20cs>19 + @{melee_mod}[MELEE] +1[WeaponBonus] + 1[WeaponFocus] + 1[WeaponTraining] - 2[SIZE] + @{attack_bonus}[BUFFS] + ?{MiscMod& #124;0& #125; ]]& #125;& #125; {{rolldmg1=[[2d8 + [[floor(1.5*@{strength_mod})]][STR] + 1[WeaponTraining] + 2[WeaponSpecialization] + [[3+[[floor(@{class1_bab} /4)*3]]]][PowerAttack] + @{melee_damage_bonus}[BUFFS] + ?{DamageMod& #124;0& #125; ]]& #125;& #125; {{critconfirm=[[1d20 + @{melee_mod}[MELEE] +1[WeaponBonus] + 1[WeaponFocus] + 1[WeaponTraining] - 2[SIZE] + @{attack_bonus}[BUFFS] + ?{MiscMod& #124;0& #125; ]]& #125;& #125; {{rolldmg1crit=[[4d8 + 2*[[[[floor(1.5*@{strength_mod} )]][STR] + 1[WeaponTraining] + 2[WeaponSpecialization] + [[3+[[floor(@{class1_bab} /4)*3]]]][PowerAttack] + @{melee_damage_bonus}[BUFFS] + ?{DamageMod& #124;0& #125; ]]]]& #125;& #125; {{roll1=[[1d20cs>19 + @{melee_mod}[MELEE] - 5[Iterative] +1[WeaponBonus] + 1[WeaponFocus] + 1[WeaponTraining] - 2[SIZE] + @{attack_bonus}[BUFFS] + ?{MiscMod& #124;0& #125; ]]& #125;& #125; {{roll1dmg1=[[2d8 + [[floor(1.5*@{strength_mod})]][STR] + 1[WeaponTraining] + 2[WeaponSpecialization] + [[3+[[floor(@{class1_bab} /4)*3]]]][PowerAttack] + @{melee_damage_bonus}[BUFFS] + ?{DamageMod& #124;0& #125; ]]& #125;& #125; {{critconfirm1=[[1d20 + @{melee_mod}[MELEE] - 5[Iterative] +1[WeaponBonus] + 1[WeaponFocus] + 1[WeaponTraining] - 2[SIZE] + @{attack_bonus}[BUFFS] + ?{MiscMod& #124;0& #125; ]]& #125;& #125; {{roll1dmg1crit=[[4d8 + 2*[[[[floor(1.5*@{strength_mod} )]][STR] + 1[WeaponTraining] + 2[WeaponSpecialization] + [[3+[[floor(@{class1_bab} /4)*3]]]][PowerAttack] + @{melee_damage_bonus}[BUFFS] + ?{DamageMod& #124;0& #125; ]]]]& #125;& #125;
1621046631
The Aaron
Roll20 Production Team
API Scripter
There are definitely issues when you get up there in number of inline rolls.&nbsp; I've filed several bug reports about it in the past, here's the most recent one:&nbsp;<a href="https://app.roll20.net/forum/post/6778746/api-sendchat-returns-bad-results-to-callback-with-rollable-tables-expressions-with-inline-rolls" rel="nofollow">https://app.roll20.net/forum/post/6778746/api-sendchat-returns-bad-results-to-callback-with-rollable-tables-expressions-with-inline-rolls</a>
I came across that a few times when making macros with that sheet (since it can have so many attack and damage rolls in a single template)
1621056180

Edited 1621056274
vÍnce
Pro
Sheet Author
I first encountered this with the PF Community sheet when we added +8 iterative attacks...&nbsp; Try adding whitespace around the double square brackets. ie&nbsp; this [[ 1d20+2 ]] instead of [[1d20+2]] Seems to only be an issue when you have LOTS of inline rolls.
1621057810

Edited 1621058128
There's only 4 rolls going on in this macro. If I were to shorten it to the following, it would still cause the same issue: {{roll=[[1d20]]}} {{rolldmg1=[[2d8 + [[3+[[floor(@{class1_bab} /4)*3]]]] ]]}} {{roll1=[[1d20 - [[1+[[floor(@{class1_bab} /4)*3]]]] ]]}} {{roll1dmg1=[[2d8 + [[3+[[floor(@{class1_bab} /4)*3]]]] ]]}} It should also be noted that the macros I'm writing are being stored as abilities with HTML replacements where necessary as I'm calling them from another macro. If I remove the [[3+[[floor(@{class1_bab} /4)*3]]]] from the second damage section, it'll display/calculate properly. This only seems to happen when I'm calling the ability from another ability/macro and only after the first attack/damage sections.
1621090811
Kraynic
Pro
Sheet Author
Nathan said: There's only 4 rolls going on in this macro. If I were to shorten it to the following, it would still cause the same issue: Every set of [[]] is a roll as far as the dice roller is concerned.&nbsp; You might try Vince's trick and see if it works out for you.
I think I fixed it. I needed to add a second set of brackets around [[ [[ floor(1.5*@{strength_mod}) ]] ]] in order for it to parse properly after the first roll set. The second of brackets weren't required for the first roll.