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
This post has been closed. You can still view previous posts, but you can't post any new replies.

Add up macro rolls

1465515424

Edited 1465515440
Is there a way to add up the total values for a specific thing in a macro. Like if you have 4 attacks it roll them and displays them separatly, but can also provide a total value of all 4 attacks.
1465518535

Edited 1465518668
Separate rolls can't interact with each other, so you can't make a roll and add it up after the fact,  but if you're OK with mousing over a result to see the breakdown, you can group separate rolls within an Inline Roll ie: [[ {1d20, 1d20, 1d20, 1d20} ]] which might display as a single totaled value like 52 , but displays the rolls  like {1d20,1d20,1d20,1d20}= {(5)+(15)+(14)+(18)} when you mouse over the total If you're GM'ing, you could certainly use the API to do each roll, assign it to a variable, display the variables, and then add them up and display that. Also, there may be a more graceful way to do this if you're using a particular Character Sheet.
1465521855
Silvyre
Forum Champion
How about something like this? /r [[ 1d20 + 1 ]] [Attack 1] + [[ 1d20 + 2 ]] [Attack 2] + [[ 1d20 + 3 ]] [Attack 3]
1465531267

Edited 1465531657
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
What magic is that silvyre and does it work with inline rolls too?
1465538086
Silvyre
Forum Champion
I placed some inline rolls within a /roll expression along with some inline labels .
1465540316
Pat S.
Forum Champion
Sheet Author
Scott C. said: What magic is that silvyre and does it work with inline rolls too? Just goofed around and did this for an example macro of inline rolls inside inline roll and it worked. [[ [[ 1d20 + 1 ]] [Attack 1] + [[ 1d20 + 2 ]] [Attack 2] + [[ 1d20 + 3 ]] [Attack 3] ]]
1465541656

Edited 1465542185
i need some help with a macro thats driving me nuts. for context, im playing a 4e barbarian and making a macro for the Swift charge power, which grants me a charge attack after i reduce an enemy to 0 hp. because it is just a charge, and i can later have several powers to use on a charge i want to use a roll query to ask what power i want to use, and in that roll query to recall other macros of the powers in question. the macro so far is as follows. note that i have several layers of macro recalls to have almost automatic updating of the stats as i level. /me charges an enemy after FELLING his target! ?{Which Attack?|Howling Strike, #Howling-Strike } and it comes out as Quinn charges at an enemy! [[1d20+9 vs AC dealing 17 damage! } for context the power in question is  /me charges at an enemy! [[#.Attack +#.Charge-Atk ]] vs AC dealing [[@{Quinn|WeaponDmg}+1d6+#.Charge-Dmg +@{Quinn|ThunderHooves}+#.Damage ]] damage! and the attack macro being recalled is  1d20+[[@{quinn|strmod}+(@{quinn|level}/2)+[[(floor((@{quinn|level}-1)/10)+1)]]+2+?{Other mods?|0}]] it gets confused right at ?{Other Mods?|0}]] and i cant figure out how to fix it. any ideas? EDIT: i should also mention that separate from the swift charge macro, all of the macros work as intended. its just when i try to put them into the swift charge macro that it falls apart.
Maybe the second question mark in ?{Other mods?|0} is throwing it off, but this isn't the right post to ask this question.
1465571978
Silvyre
Forum Champion
Hi, MichaelAB . In the future, feel free to open your own Specific Use Question thread; your post would get more attention that way. It appears that you're attempting to nest a child Roll Query (e.g. 'Other Mods') with a parent Roll Query (e.g. 'Which Attack?'). This is possible to do only if special treatment is provided to the child Roll Query. I recommend giving Advanced Usage for Roll Queries and the examples contained within a good read over. Please let me know if there's anything I can help clarify.
1465572046
Silvyre
Forum Champion
Jake W. , apologies; do you mind if we handle MichaelAB 's question within your thread? Also, were we able to help answer your question?
My question has been answered quite expertly sir. Please go ahead and aid Michael to the best of your ability.
1465572956
Silvyre
Forum Champion
Great! Happy rolling!
sorry and thank you. if i have further questions ill open a new thread