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

Reuse a die roll multiple times in an output text

1585551185
Peter B.
Pro
Sheet Author
What I want to do is for the initiative roll to show both the rolled number and the added modifer in the next. The output I would like to look something like this: Players starts to cast a spell on 5 and finishes on 9  In this case I would add 9 to the turn tracker. How I imagine the macro looking would be something like this: /em starts to cast a spell on [[1d10]] and finishes on [[1d10+@{Modifier}]] The problem with with this approach is that the die is rolled twice, and therefore won't work. I would like to save the first roll in a local variable and thereby using it multiple times. If it was any other programming language I would write it like: var s = "starts to cast a spell on "; var roll = [[1d10]]; s += roll; s += " and finishes on "; s += roll+@{Modifier}; print(s); I have no idea if this is even possible. Please let me know if any macro ninja out there knows if there is a way to achieve this :)
1585556510
Ziechael
Forum Champion
Sheet Author
API Scripter
This isn't possible with the default dice roller, with access to the API (a pro subscriber perk enabled based on the creator's sub level) you can do this however... and more!