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

Rolling multiple dice separately in one macro

January 22 (10 years ago)
In a campaign I'm in, I'm playing a knife-thrower, who will eventually be throwing upwards of 12-15 daggers every round. Currently I use a macro with multiple lines all re-rolling the same roll. Is there any more efficient way other than placing the roll in to one macro and calling the macro over and over again? Ideally I'd like to roll 10d20 and add 5 to each seperate roll and list them all separately.
January 22 (10 years ago)
The Aaron
Pro
API Scripter
Outside of using the API (mentor level feature), I'm not aware of a good way of automating the selection of how many times to roll a particular macro.
January 22 (10 years ago)
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
Andrew you could do this:
/r ?{Number of Knives|1}d20+(?{Number of Knives|1}*5)

That would roll a d20 for each knife and add 5xKnives damage to the end.
January 22 (10 years ago)
The Aaron
Pro
API Scripter
I think he's intending to make 12-15 attack rolls:
Ideally I'd like to roll 10d20 and add 5 to each separate roll and list them all separately.
January 22 (10 years ago)

Edited January 22 (10 years ago)
I generally group multiple attacks, like rapid/multishot in PF, into condensed macros. You can't really change on the fly how many individual attack rolls to make with the Macro system.

/me juggles some knives...IN THEIR FACE!
[KnifeThrowing]
Hit1:[[1d20+5]] for [[1d4]] ♦ Hit2:[[1d20+5]] for [[1d4]]
Hit3:[[1d20+5]] for [[1d4]] ♦ Hit4:[[1d20+5]] for [[1d4]]
Hit5:[[1d20+5]] for [[1d4]] ♦ Hit6:[[1d20+5]] for [[1d4]]
Hit7:[[1d20+5]] for [[1d4]] ♦ Hit8:[[1d20+5]] for [[1d4]]

Hit9:[[1d20+5]] for [[1d4]] ♦ Hit10:[[1d20+5]] for [[1d4]]

Output looks like this:

January 23 (10 years ago)
Gen Kitty
Forum Champion
What you're asking for is something that would be easily handled by the Powercards script, or likely roll-templates when they become available (in testing on the dev servers). However, at this point in time, the native dice-handler won't do what you want.

Mark's macro approach works really well and is nicely compact and I've used it before myself.
January 23 (10 years ago)
Thanks for all the replies. It's good to know something like this is being on worked on. I think for now Mark's approach will work the best even though it's a fixed number.
January 23 (10 years ago)
Gen Kitty
Forum Champion
You asked for simple and efficient. If you want longer and more complicated, I can provide you with a macro that will let you only show as many attacks as you want to display, and it'll name the targets on top of that. Just let me know if you want it ^_^
January 23 (10 years ago)
If you want to post it, I'll try it out for sure
January 23 (10 years ago)
Gen Kitty
Forum Champion
This is a bit of a hack and takes advantage of the system-parser interpreting any line starting with ! as a call to an installed API script, and if it can't find a script that makes it happy it silently discards the line.

Here's a simple proof of concept macro you can immediately try for yourself:

/me bops ?{Number of targets?|1} target(s) on the nose!
Target 1: @{target|Target1|token_name}
?{target2|!} Target 2: @{target|Target2|token_name}
?{target3|!} Target 3: @{target|Target3|token_name}

This macro will ask you to select three targets, as that is the maximum number of targets this macro handles. It will then ask you how many targets, for the benefit of the emote. And then it will bring up prompts for target2 and target3: If you wish to bop them on the nose, remove the ! and leave the box blank. If you do not wish to bop them on the nose, leave the ! in the box. And you must be asking, "But what if I want to only bop 1 person? Who do I click for targets 2 and 3?" and my answer is, "Click on your own token to pad out the list."

Try it out a few times and you'll quickly get the hang of it.

This is an real life example from my husband's character in a Pathfinder game:

@{selected|token_name}'s dragon pistol sprays a 15' cone of pellets which engulfs ?{Number of targets?|1} target(s), potentially dealing [[d6 + @{Silva|Dragon|max} + ?{MiscBonusDamage|1} ]] damage each, [[3d6 + (3* @{Silva|Dragon|max} + ?{MiscBonusDamage}) ]] additional on a crit. (P/B damage, Misfires if ALL ATTACK DICE roll a 1 to ?{MaxMisfire|3}).
@{target|target1|token_name}: AC  [[1d20r20 + @{Silva|Dragon} -2  + ?{MiscToHitBonus?|1}  ]]
?{target2|!} @{target|target2|token_name}: AC  [[1d20r20 + @{Silva|Dragon} -2  + ?{MiscToHitBonus?}  ]]
?{target3|!} @{target|target3|token_name}: AC  [[1d20r20 + @{Silva|Dragon} -2  + ?{MiscToHitBonus?}  ]]
?{target4|!} @{target|target4|token_name}: AC  [[1d20r20 + @{Silva|Dragon} -2  + ?{MiscToHitBonus?}  ]]
?{target5|!} @{target|target5|token_name}: AC  [[1d20r20 + @{Silva|Dragon} -2  + ?{MiscToHitBonus?}  ]]
?{target6|!} @{target|target6|token_name}: AC  [[1d20r20 + @{Silva|Dragon} -2  + ?{MiscToHitBonus?}  ]]
?{target7|!} @{target|target7|token_name}: AC  [[1d20r20 + @{Silva|Dragon} -2  + ?{MiscToHitBonus?}  ]]

There is a lot going on in this macro; I have bolded the bits that are important for this discussion.

This is an attack that does an AOE that can potentially target up to 7 creatures.

When the macro goes off, first Silva is asked to click on 7 targets. If he is attacking less than 7 targets, he clicks on his own token to pad out the targeting list. Then the roll-queries start. Among the other roll-queries it asks for how many attacks he's doing. This is for the GM's benefit and helps focus his attention on the actual targets. There's other roll-queries going on, setting up other bits of information needed for the attack. And then it will prompt for target2 through target7, each time showing ! as the default option. For each attack Silva wishes to make, he deletes the ! and leaves the box blank. For each attack-target Silva does not want to hit, he leaves the ! in place. We list the number of targets for the GM's benefit.

---
As I said, not simple, not efficient, not compact. I hope these two examples help you out. :)