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

Combining Macros into one - Help Required

March 09 (3 weeks ago)

I am running a system that I have designed and use macros to help the players roll the dice. When dealing damage, dice are rolled and for those with high attributes low numbers can be rerolled. For example, if you have +2 in the attribute used you can reroll any result of 1 (rerolling if it comes up 1 again, etc.). No issues so far, I have the following macro asking what dice they are rolling and applying the r<X command to the dice.

/roll ?{D4|0}d4r<1+?{D6|0}d6r<1+?{D8|0}d8r<1+?{D10|0}d10r<1+?{D12|0}d12r<1

So far I have six macros covering a normal damage roll (no rerolls) all the way to Reroll 1-5, but I want to combine them into one macro, with the question asked at the start, "What is your Reroll" and based on the answer the correct damage macro is then run. One button to push for damage, simples.

I have tried this through a macro that asks what your damage reroll is and then calls the relevant macro, but it does not work. What am I doing wrong?

?{What is you Reroll |None,#Damage |Reroll 1,#Dmg_Reroll_1 |Reroll 1-2,#Dmg_Reroll1-2 |Reroll 1-3,#Dmg_Reroll1-3 |Reroll 1-4,#Dmg_Reroll1-4 |Reroll 1-5,#Dmg_Reroll1-4 }

I have event pasted the macro codes into the one and get the same result, it appears to get confused as to what question is being asked and picks up text in a different part of the macro. Not sure if this is making sense, and I am sure it may be to do with nesting, but as this is my first few weeks on Roll20 I am not sure what I am doing wrong.

March 09 (3 weeks ago)

The issue you're running into is that the macros in your query are replaced with their content before the query is resolved, resulting in nested queries. Regardless, you can do simpler - you can just put a query for the reroll value and it'll work fine:

/roll ?{D4|0}d4r<?{reroll|1}+?{D6|0}d6r<?{reroll|1}+?{D8|0}d8r<?{reroll|1}+?{D10|0}d10r<?{reroll|1}+?{D12|0}d12r<?{reroll|1}

Also, if only one set of dice is rolled (so no combination of different dice), you can simplify this to

/roll ?{die count|1}d?{die size|4|6|8|10|12}r<?{reroll|1}

March 10 (3 weeks ago)

Thanks for the reply and I thought it may be the nested queries. The way damage works is you have a dice from your weapon (1d8 longsword) and one from proficiency (1d10 for grand-master), so you can be rolling 1d8+1d10, or 1d12+1d8, etc. depending on weapon and skill. Sneak attacks also add dice to damage as do special abilities like furious attack. So damage can be a combination of various dice.

Tested and works well, thank you!

March 10 (3 weeks ago)

So I wasn't quite satisfied with that, and wrote a little macro to save you some clicks - first, you'll need a macro mule character (just a character sheet to house macros on), then in the attributes & abilities tab add an attribute called "prefixp" on it, consisting of %{ . Then, copy over these two as abilities as is (make sure to save them under the names given where relevant):

(This one can be named whatever you like)

[[0]] [[0]] [[0]] [[0]] [[0]] [[0]] [[0]] [[0]] [[0]] [[0]] @{prefixp}@{character_name}|repeat}

repeat

&{template:default} {{storage=$[[0]]d$[[1]] $[[2]]d$[[3]] $[[4]]d$[[5]] $[[6]]d$[[7]] $[[8]]d$[[9]]
}} {{=[d4](!/&NewLine; &lbrack;&lbrack;?&lbrace;How many&vert;1&rbrace;&rbrack;&rbrack; &lbrack;&lbrack;4&rbrack;&rbrack; &lbrack;&lbrack;$[[0]]&rbrack;&rbrack;&lbrack;&lbrack;$[[1]]&rbrack;&rbrack; &lbrack;&lbrack;$[[2]]&rbrack;&rbrack;&lbrack;&lbrack;$[[3]]&rbrack;&rbrack; &lbrack;&lbrack;$[[4]]&rbrack;&rbrack;&lbrack;&lbrack;$[[5]]&rbrack;&rbrack; &lbrack;&lbrack;$[[6]]&rbrack;&rbrack;&lbrack;&lbrack;$[[7]]&rbrack;&rbrack; &lbrack;&lbrack;$[[8]]&rbrack;&rbrack;&lbrack;&lbrack;$[[9]]&rbrack;&rbrack;&percnt;{@{character_name}|repeat}) [d6](!/&NewLine; &lbrack;&lbrack;?&lbrace;How many&vert;1&rbrace;&rbrack;&rbrack; &lbrack;&lbrack;6&rbrack;&rbrack; &lbrack;&lbrack;$[[0]]&rbrack;&rbrack;&lbrack;&lbrack;$[[1]]&rbrack;&rbrack; &lbrack;&lbrack;$[[2]]&rbrack;&rbrack;&lbrack;&lbrack;$[[3]]&rbrack;&rbrack; &lbrack;&lbrack;$[[4]]&rbrack;&rbrack;&lbrack;&lbrack;$[[5]]&rbrack;&rbrack; &lbrack;&lbrack;$[[6]]&rbrack;&rbrack;&lbrack;&lbrack;$[[7]]&rbrack;&rbrack; &lbrack;&lbrack;$[[8]]&rbrack;&rbrack;&lbrack;&lbrack;$[[9]]&rbrack;&rbrack;&percnt;{@{character_name}|repeat}) [d8](!/&NewLine; &lbrack;&lbrack;?&lbrace;How many&vert;1&rbrace;&rbrack;&rbrack; &lbrack;&lbrack;8&rbrack;&rbrack; &lbrack;&lbrack;$[[0]]&rbrack;&rbrack;&lbrack;&lbrack;$[[1]]&rbrack;&rbrack; &lbrack;&lbrack;$[[2]]&rbrack;&rbrack;&lbrack;&lbrack;$[[3]]&rbrack;&rbrack; &lbrack;&lbrack;$[[4]]&rbrack;&rbrack;&lbrack;&lbrack;$[[5]]&rbrack;&rbrack; &lbrack;&lbrack;$[[6]]&rbrack;&rbrack;&lbrack;&lbrack;$[[7]]&rbrack;&rbrack; &lbrack;&lbrack;$[[8]]&rbrack;&rbrack;&lbrack;&lbrack;$[[9]]&rbrack;&rbrack;&percnt;{@{character_name}|repeat}) [d10](!/&NewLine; &lbrack;&lbrack;?&lbrace;How many&vert;1&rbrace;&rbrack;&rbrack; &lbrack;&lbrack;10&rbrack;&rbrack; &lbrack;&lbrack;$[[0]]&rbrack;&rbrack;&lbrack;&lbrack;$[[1]]&rbrack;&rbrack; &lbrack;&lbrack;$[[2]]&rbrack;&rbrack;&lbrack;&lbrack;$[[3]]&rbrack;&rbrack; &lbrack;&lbrack;$[[4]]&rbrack;&rbrack;&lbrack;&lbrack;$[[5]]&rbrack;&rbrack; &lbrack;&lbrack;$[[6]]&rbrack;&rbrack;&lbrack;&lbrack;$[[7]]&rbrack;&rbrack; &lbrack;&lbrack;$[[8]]&rbrack;&rbrack;&lbrack;&lbrack;$[[9]]&rbrack;&rbrack;&percnt;{@{character_name}|repeat}) [d12](!/&NewLine; &lbrack;&lbrack;?&lbrace;How many&vert;1&rbrace;&rbrack;&rbrack; &lbrack;&lbrack;12&rbrack;&rbrack; &lbrack;&lbrack;$[[0]]&rbrack;&rbrack;&lbrack;&lbrack;$[[1]]&rbrack;&rbrack; &lbrack;&lbrack;$[[2]]&rbrack;&rbrack;&lbrack;&lbrack;$[[3]]&rbrack;&rbrack; &lbrack;&lbrack;$[[4]]&rbrack;&rbrack;&lbrack;&lbrack;$[[5]]&rbrack;&rbrack; &lbrack;&lbrack;$[[6]]&rbrack;&rbrack;&lbrack;&lbrack;$[[7]]&rbrack;&rbrack; &lbrack;&lbrack;$[[8]]&rbrack;&rbrack;&lbrack;&lbrack;$[[9]]&rbrack;&rbrack;&percnt;{@{character_name}|repeat}) [Roll](!/&NewLine;/roll $[[0]]d$[[1]]r<&quest;{reroll|1}+$[[2]]d$[[3]]r<&quest;{reroll|1}+$[[4]]d$[[5]]r<&quest;{reroll|1}+$[[6]]d$[[7]]r<&quest;{reroll|1}+$[[8]]d$[[9]]r<&quest;{reroll|1})}}

The macro spawns a chat menu with buttons for each die type, and whenever you click one of the buttons, it asks you how many of them you want to roll, and remembers both, until you press "roll", at which point you're asked for the reroll threshold and all the saved dice are rolled.

March 12 (3 weeks ago)

Wow, thanks so much. I will have a look at this. So much to learn on Roll20, but so far I like what I see. Cheers!