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

Help! Does roll templates have a maximum number of calculations?

1601231694
Peter B.
Pro
Sheet Author
I have a buttons that activate a Roll template, with multiple fields. In these fields I have different calculations. And It seems that there is some kind of maximum amount of calculations that can be performed in a single call. I am using the AD&D 2E Revised character sheet, and the 2Espell roll template: Here is my data: &{template:2Espell}{{title=Test}}{{splevel=Test}}{{school=Test}}{{components=Test}}{{time=Test}}{{rage=Test}}{{duration=Test}}{{aoe=Test}}{{save=Test}}{{damage=Test}}{{damagetype=Test}}{{healing=Test}}{{reference=Test}}{{materials=Test}}{{effects=Test data Should be 12: [[4*[[@{Charlie|level-wizard}]]]] Should be 12: [[4*[[@{Charlie|level-wizard}]]]] Should be 12: [[4*[[@{Charlie|level-wizard}]]]] Should be 12: [[4*[[@{Charlie|level-wizard}]]]] Should be 12: [[4*[[@{Charlie|level-wizard}]]]] Should be 12: [[4*[[@{Charlie|level-wizard}]]]]}} This is the output I get: If I change the second calculation to use parenthesis instead of square brackets then the calculations will progress further down: &{template:2Espell}{{title=Test}}{{splevel=Test}}{{school=Test}}{{components=Test}}{{time=Test}}{{rage=Test}}{{duration=Test}}{{aoe=Test}}{{save=Test}}{{damage=Test}}{{damagetype=Test}}{{healing=Test}}{{reference=Test}}{{materials=Test}}{{effects=Test data Should be 12: [[4*[[@{Charlie|level-wizard}]]]] Should be 12: [[4*(@{Charlie|level-wizard})]] <--- changed to parenthesis Should be 12: [[4*[[@{Charlie|level-wizard}]]]] Should be 12: [[4*[[@{Charlie|level-wizard}]]]] Should be 12: [[4*[[@{Charlie|level-wizard}]]]] Should be 12: [[4*[[@{Charlie|level-wizard}]]]]}} With this I get the following output: It seems that there is a maximum of 2 nested calculations before it falls back to only do a single calculations. Have anyone else noticed something like this? I am scratching my head for answers on this.
1601231915

Edited 1601231989
vÍnce
Pro
Sheet Author
Try adding spaces around your inline rolls.  ie this "[[[[1d20]]]]" rewritten with whitespace added would be "[[ [[ 1d20 ]] ]]".  We noticed this issue when creating the iterative attacks on the pathfinder community sheet.
1601233096
GiGs
Pro
Sheet Author
API Scripter
That's interesting, and nice to know, Vince. I would add though that for a calculation like this: Should be 12: [[4*(@{Charlie|level-wizard})]] You dont need to use parenthesis. You should just be using Should be 12: [[4*@{Charlie|level-wizard}]]
1601233098
Peter B.
Pro
Sheet Author
Vince said: Try adding spaces around your inline rolls.  ie this "[[[[1d20]]]]" rewritten with whitespace added would be "[[ [[ 1d20 ]] ]]".  We noticed this issue when creating the iterative attacks on the pathfinder community sheet. Wow. You are a life safer! Just tested and sure enough, works out exactly as you say! Thank you so much!
1601233183
Peter B.
Pro
Sheet Author
GiGs said: That's interesting, and nice to know, Vince. I would add though that for a calculation like this: Should be 12: [[4*(@{Charlie|level-wizard})]] You dont need to use parenthesis. You should just be using Should be 12: [[4*@{Charlie|level-wizard}]] Thanks Gigs but are you sure? What if the value of level-wizard is 4+3, wouldnt it become 4*4+3? Instead of 4*(4+3)?
1601233277
Peter B.
Pro
Sheet Author
Peter B. said: Thanks Gigs but are you sure? What if the value of level-wizard is 4+3, wouldnt it become 4*4+3? Instead of 4*(4+3)? I just tested it and it does calculate incorrectly if the field itself is a calculation :)
1601233561

Edited 1601233603
GiGs
Pro
Sheet Author
API Scripter
Peter B. said: GiGs said: That's interesting, and nice to know, Vince. I would add though that for a calculation like this: Should be 12: [[4*(@{Charlie|level-wizard})]] You dont need to use parenthesis. You should just be using Should be 12: [[4*@{Charlie|level-wizard}]] Thanks Gigs but are you sure? What if the value of level-wizard is 4+3, wouldnt it become 4*4+3? Instead of 4*(4+3)? You're right there. I didnt consider that the attribute might contain an autocalc field or string. In that case you definitely should surround them with parenthesis or inline roll brackets. My preference for situations like this is parenthesis. 
1601240488
Peter B.
Pro
Sheet Author
GiGs said: You're right there. I didnt consider that the attribute might contain an autocalc field or string. In that case you definitely should surround them with parenthesis or inline roll brackets. My preference for situations like this is parenthesis.  I have learned that players tend to do a lot of unexpected stuff :). I also added this because priests have a spell, Combine, that specifically increases the caster level and not the regular level. I have been thinking of the parenthesis, but I prefer the inline roll as I feel that makes the subsequent mouse over text show the simplest calculation. I do recognize that this is an edge case, and that the vast majority of players will just have a single number there.
1601240765
GiGs
Pro
Sheet Author
API Scripter
Peter B. said: I have been thinking of the parenthesis, but I prefer the inline roll as I feel that makes the subsequent mouse over text show the simplest calculation.  I sometimes use inline rolls for the same reason - it makes for cleaner presentation. But for rolls with a LOT of inline rolls, particularly with some nested inside each other, its a good idea to cut down on the number of them - they seem to cause a bit of lag.  But yeah, when presentation is a factor, inline rolls can be superior.