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

Roll Reuse Challenge

1664643605
Pat
Pro
API Scripter
Trying to create an attack and damage macro for a Warrior in DCC. In DCC, the Warrior rolls a 'deed' die with their attack and adds the rolled value to both attack and damage. This is the 'd3' in the macro below The macro below rolls attack and damage showing the individual results correctly.&nbsp; My challenge is with getting the sum of the individual results for the Damage ( the ?? in the macro) &amp;{template:default} [[ [[d20]] + [[d3]] ]] [[ [[d10]] + $[[1]] ]] ]] {{name=Attack}} {{ Attack= $[[0]] + $[[1]] == $[[2]] }} {{ Damage:=&nbsp; $[[3]] + $[[1]] == ??&nbsp; &nbsp; &nbsp; &nbsp;}} I've played around with various ways of nesting the [[ ]] and read everything on the&nbsp; <a href="https://wiki.roll20.net/Reusing_Rolls" rel="nofollow">https://wiki.roll20.net/Reusing_Rolls</a> &nbsp;page but just can't find a way to reuse the d3's rolled result in a second sum for the Damage. Has anyone else found a solution for this?&nbsp;
There's a referenced thread Macro Curiosities that describes a number of advanced techniques. Roll Duplication being one of them that does what you need. However you may want to consider a Mod (API) such as Scriptcards which can handle such things more cleanly.
1664669732
timmaugh
Pro
API Scripter
Here's a metascript option, very close to your original syntax: !&amp;{template:default} [[ [[d20]] + [[1d3]] ]] {{name=Attack}} {{ Attack= $[[0]] + $[[1]] == $[[2]] }} {{ Damage:=&nbsp; $[[3]] + $[[1]] == [\][\] [[d10]] + $[[1]].value \]\]}}{&amp;simple} Required Scripts: ZeroFrame (which gets you libInline, too)
1664750755
Pat
Pro
API Scripter
Great answers!&nbsp; Thanks for the assist.