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 .
×

Is there anyway to reference dice rolls that have occurred in the same macro?

I'm trying to make a macro for an AoE spell, and here's what I have: /me rolls a [[?{Number of Dice}d?{Number of Sides}]] for a failed save /me rolls a [[round(?{Number of Dice}d?{Number of Sides)/2)}]] for a successful save This properly rolls the dice (8d6 for example), except the issue arises with the rounding. I want it to round the previous result I rolled, but instead, it rerolls the specified dice and rounds that. Is there any way to get it to round my previous result?
Roll20 has no native way to refer back to earlier rolls (even withing the same macro). You'd need to add an API script to do that, which requires that the game creator has a Pro account.
1593418573
Ziechael
Forum Champion
Sheet Author
API Scripter
Recent innovation has allowed the reuse of rolls... however not to perform math on... if you are willing to reverse your output (and have it all on a single line or part of a template) you can have this (you were also missing a } at the end of your number of sides call and I've added a default to the number of dice and a drop down for dice selection to prevent irregular or unexpected query results): /me rolls a [[round([[?{Number of Dice|1}d?{Number of Sides|4|6|8|10|12|20|100}]])/2)}]] for a successful save or $[[0]] for a failed save!
Ziechael said: Recent innovation has allowed the reuse of rolls... however not to perform math on... if you are willing to reverse your output (and have it all on a single line or part of a template) you can have this (you were also missing a } at the end of your number of sides call and I've added a default to the number of dice and a drop down for dice selection to prevent irregular or unexpected query results): /me rolls a [[round([[?{Number of Dice|1}d?{Number of Sides|4|6|8|10|12|20|100}]])/2)}]] for a successful save or $[[0]] for a failed save! Damn, nice job. Thank you so much dude.