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

Re-using an inline roll more than once

I found some old macros that I had that re-used an inline roll and thought I would play with it again. &{template:default} {{Roll=$[[2]]}} {{Tier 1=[[ $[[3]] + 7 ]]}} {{Tier 2=[[ $[[3]] + 11 ]]}} {{Tier 3=[[ $[[3]] + 16 ]]}} {{name=Ability}} [[ [[1d10 First D10]] + [[2d10]] ]]  [ ]([[) [[2d6]] [ ](]]) Turns out I can only re-use the roll once before it starts breaking inline rolls again. Does anyone know why this is the case? And bonus points if you know how to make it happen without some sort of roll index manipulation and duplicating the roll.
1749184562

Edited 1749184766
Gauss
Forum Champion
Hi FoxRobinHood,  Because none of the dice rolls are being reused we can use basic addition/subtraction to add/subtract the modifiers in and out as needed.  This is what that looks like: &{template:default} {{name=Ability}} [[ [[1d10 First D10]] + [[2d10]] ]]  [[ [[ [[ [[2d6]] +7]] -7 +11]] -11 +16]] {{Roll=$[[2]]}} {{Tier 1=$[[4]]}} {{Tier 2=$[[5]]}} {{Tier 3=$[[6]]}} Roll is pulling 1d10 +2d10 Tier 1 is pulling 2d6+7  Tier 2 is pulling 2d6+7-7+11 (ie: 2d6+11) Tier 3 is pulling 2d6+7-7+11-11+16 (ie: 2d6+16)
Nice and slick Math to the rescue there. Very well done. So, you are not entirely sure why I can re-use that 2d6 roll once without breaking the inline roll, but the other attempted calls do break the roll?
1749229158

Edited 1749229358
GiGs
Pro
Sheet Author
API Scripter
Things like this wont work: {{Tier 1=[[ $[[3]] + 7 ]]}} $[[3]] looks like a number, but it isn't one. it is object, an entity with its own rules and properties. You can't perform arithmetic with objects like this.  Gauss's method works because it directly targets the roll..
But it does work in the screenshot that I posted above. I rolled a 12 with my 2d6, 12 + 7 was what I was trying to display and it correctly gives me 19 in the tier 1= row