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

Multiple character roll macros

I'm terrible at maths and looking through the dice rolling pages hasn't helped. Is there a method for being able to have multiple characters dice rolls, with modifiers, as a query? So a wiz drops a fireball on a group of 4 giant chickens that have a +10 fort save. I'd like to make a macro that produces a query to input the number of giant chickens and preferably another to input their for save bonus and then output them as individual results. Is this possible? And if not, what is the syntax for manually entering it, along the lines of /r 4d20 +10  =(15 + 12 + 18 + 22) or something. 
1445663947
Lithl
Pro
Sheet Author
API Scripter
There is no means (barring the API) to produce an arbitrary number of separate rolls. You could do something like this: [[d20 + ?{Save|0}]] [[d20 + ?{Save}]] [[d20 + ?{Save}]] [[d20 + ?{Save}]] I would ask you for the save once, and use it four times. You could also potentially use  nested roll queries , but that will significantly increased the workload of crafting and maintaining the macro.
1445664375

Edited 1445664941
Silvyre
Forum Champion
I wrote a similar macro for D&D 5e. First, the macro prompts for a selection of up to six targeted tokens (select any token more than once if you require less than six targets). Then, the macro prompts for each of the (unique) tokens selected to be assigned a modifier. The macro then prompts for the type of save being performed (for purposes of naming the Roll Template). Adapted for the Pathfinder Character Sheet : &{template:pf_defense} {{name=?{Save|Strength|Dexterity|Constitution|Intelligence|Wisdom|Charisma} Saving Throw}} {{@{target|1st Target|token_name}=[[d20 + ?{Modifers, @{target|1st Target|token_name}|0}]]}} {{@{target|2nd Target|token_name}=[[d20 + ?{Modifers, @{target|2nd Target|token_name}|0}]]}} {{@{target|3rd Target|token_name}=[[d20 + ?{Modifers, @{target|3rd Target|token_name}|0}]]}} {{@{target|4th Target|token_name}=[[d20 + ?{Modifers, @{target|4th Target|token_name}|0}]]}} {{@{target|5th Target|token_name}=[[d20 + ?{Modifers, @{target|5th Target|token_name}|0}]]}} {{@{target|6th Target|token_name}=[[d20 + ?{Modifers, @{target|6th Target|token_name}|0}]]}}
Something without roll templates would look something like this, you only need to select one token and just enter the number of creatures, assuming they are all the same. /em @{selected|character_name} (?{Number of targets|2} of them) attempt their saves… /em vs. Save **DC**= [[?{Save DC|10}]] with [[{?{Number of targets}d20 + ?{Save Bonus|0}}>?{Save DC|10}]] succeeding!
Ed S. said: Something without roll templates would look something like this, you only need to select one token and just enter the number of creatures, assuming they are all the same. /em @{selected|character_name} (?{Number of targets|2} of them) attempt their saves… /em vs. Save **DC**= [[?{Save DC|10}]] with [[{?{Number of targets}d20 + ?{Save Bonus|0}}>?{Save DC|10}]] succeeding! Excellent, thanks for your help people!  I think this one's going to work really best for my game, thanks Ed.
1445669518

Edited 1445669596
Wouldn't [[{?{Number of targets}d20 + ?{Save Bonus|0}}>?{Save DC|10}]]  just give you a single pass/fail result and not add the save bonus to each roll, but only to the total?  (ie:  if Number of Targets = 4, and Save Bonus = 2,  you get 4d20+2>Save DC,  which is always going to be inaccurate. Much like Silvire's example, you could use a Drop-Down Roll Query to predefine a set number of rolls ( assuming the Save bonus is going to be the same between targets ) without having to store the Save Bonus for every token.  While not as fully automated, it lets you use it on the fly for ANY DC check with a number of similar targets without having to set them up ahead of time. The following asks for the DC, Number of targets(up to ten), and what their collective Bonus is: &{template:pf_defense} {{name=Saving Throws}} {{Save DC:[[?{What's the DC?|10} ]] }} {{ ?{How Many Saves?|One, [[d20+ ?{Save Bonus:|0}]] |Two, [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] |Three, [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] |Four, [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] |Five, [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]]|Six, [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]]|Seven, [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] |Eight, [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]]|Nine, [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]]|Ten, [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]] • [[d20+ ?{Save Bonus:|0}]]} }} The trick to this is to replace each { ,  | ,  and }   in "?{Save Bonus:|0}" throughout the macro using the following: { = & #123;   ( remove the space after & ) | = & #124;   ( remove the space after & ) } = & #125;   ( remove the space after & ) The end result looks like this:   ( Save DC: 15 ,  How Many Saves: 6 ,  Save Bonus: 3 ) Note: ( This could be cleaned up a bit to be more presentable, using neat rows or template formatting;  this was just a quick example )
1445673745
Silvyre
Forum Champion
Mark G. said: Wouldn't [[{?{Number of targets}d20 + ?{Save Bonus|0}}&gt;?{Save DC|10}]]&nbsp; just give you a single pass/fail result and not add the save bonus to each roll, but only to the total? No; see: <a href="https://wiki.roll20.net/Dice_Reference#Failures_.2" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Failures_.2</a>... Mark G. said: { = & #123;&nbsp;&nbsp; ( remove the space after & ) FYI, the replacement of this character is gratuitous.
Seems to work pretty well I think from testing.
Mark G. said: Wouldn't [[{?{Number of targets}d20 + ?{Save Bonus|0}}&gt;?{Save DC|10}]]&nbsp; just give you a single pass/fail result and not add the save bonus to each roll, but only to the total?&nbsp; (ie:&nbsp; if Number of Targets = 4, and Save Bonus = 2,&nbsp; you get 4d20+2&gt;Save DC,&nbsp; which is always going to be inaccurate. The tooltip looks funny like it's adding the d20's then the bonus, but the math works out if you check it.&nbsp;