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

[Macros] Referencing Rolls

1386862267
Tom
Plus
Sheet Author
Can a macro reference your previous dice roll? For instance, I'd like to add a line to an attack macro that displays the successes rolled –1 as "bonus successes" they can apply to the damage roll (a different macro). So my chat display might look something like: =4 successes 3 bonus dice to damage How might I do that? CAN I do that?
[[(5d10>5)-1]] bonus dice to damage
1386863325
Tom
Plus
Sheet Author
So wait. If my macro is this: /roll [[@{Strength}+@{Melee}]]d10!10>7sd vs @{selected|Avoidance}[Avoidance] Where do I put that?
Ah well... with that macro it won't work.
Referencing rolls in other rolls is outside the capability of macros. You'd have to put it into the API.
1386869371
Tom
Plus
Sheet Author
I don't want to reference it outside of the same roll. Ideally what I'm looking to do would be something like this: /roll [[@{Strength}+@{Melee}]]d10!10>7sd vs @{selected|Avoidance}[Avoidance] ([Successes]-1) bonus dice to damage That's why I'm trying to work it into the attack roll macro as opposed to referencing it in the damage roll macro. If it can't be done, that's cool. But I thought I'd ask.
It's still referencing another roll, even if you keep it in the same macro. You'd have to roll it all into one roll line with a final, single output of how many bonus dice you get. If someone else doesn't try it, I'll see if I can do something when I get home from work this afternoon.
1386872194
Gauss
Forum Champion
Brandon is correct, at this time you cannot reference a roll elsewhere (either on another line or in the same roll) unless you use the API.
1386873098
Tom
Plus
Sheet Author
Alright. So it sounds like my players will just have to use their brains. Fair enough. ;)
1386904534

Edited 1386904708
Sam
Pro
Sheet Author
As an exercise in the API, would a mentor be willing to show how you might do this?