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

Macro producing additional output based on the higher of two rolls?

November 08 (2 years ago)

Edited November 08 (2 years ago)

Hey folks, just now starting to implement macros. I was wondering if anyone could help me with a particular idea.

I'm running a game of Fabula Ultima and am trying to use a macro for attacks and spells. Attacks in that game work as follows: To hit a target, you roll two dice based on your stats and add them up. Then, if you hit, damage is based on the higher of those two rolls + a fixed amount.

The super basic macro I have right now covers the hit check, but not the damage. As an example for a dagger attack (with an unrelated accuracy mod of +1):

/roll @{Dexterity}+@{Insight}+1

Dexterity and Insight are set to dice types like 1d10 and 1d8. What I would need now is something that takes the higher of the two rolls, adds a fixed value (4 in the case of a dagger) and puts it out as damage. It would also have to show both the rolls to determine the hit AND the damage value on hit. Is this possible?

Thanks in advance.

November 08 (2 years ago)

Edited November 08 (2 years ago)
Gauss
Forum Champion

To clarify here: 
1d10+1d8 = check to see if you hit?
same roll of 1d10 and 1d8 (highest of the two) is then used for damage? 

Example: 
to hit: 1d10+1d8 = 5+6 = 11 to hit
damage: (5, 6)+1 = 6+1 = 7 damage

November 08 (2 years ago)

Edited November 08 (2 years ago)


Gauss said:

To clarify here: 
1d10+1d8 = check to see if you hit?
same roll of 1d10 and 1d8 (highest of the two) is then used for damage? 


Example: 
to hit: 1d10+1d8 = 5+6 = 11 to hit
damage: (5, 6)+1 = 6+1 = 7 damage


The first part is correct, the example not quite. I think the confusion stems from the +1 in the macro, which is actually an accuracy modifier I neglected to mention since it's not relevant to my immediate problem. My bad, clarified in the original post. The damage mod is separate, in this case 4 for a dagger. In this example, it's:


To hit: 1d10+1d8+1 = 5+6+1 = 12 to hit

Damage: (5, 6)+4 = 6+4 = 10 damage


As a different example, a theoretical weapon that has no accuracy mod but a damage mod of +10 would be:


To hit: 1d10+1d8 = 5+6 = 11 to hit

Damage: (5, 6)+10 = 6+10 = 16 damage


The game refers to the higher of the two to-hit rolls as High Roll (HR), and any given weapon will have its damage listed as HR+X, where X could be anything from 0 to ~20.

November 08 (2 years ago)
Gauss
Forum Champion

Short version,  you cannot reuse rolls. 
Long version....well basically you still cannot reuse rolls unless you have a Pro account and an Mod (API script) for it, or unless RainbowEncoder comes along and works some magic. 

November 09 (2 years ago)


Gauss said:

Short version,  you cannot reuse rolls. 
Long version....well basically you still cannot reuse rolls unless you have a Pro account and an Mod (API script) for it, or unless RainbowEncoder comes along and works some magic. 


That's what I'd feared. Thank you anyway.

November 09 (2 years ago)

Edited November 09 (2 years ago)
Gauss
Forum Champion

I can come up with a thing for you though...moment. 

Part 1: Create an Ability Macro that says this:
Name: whatever you want
Macro: 
&{template:default} {{name=Spell Macro Damage}} {{Attack=[[[[1d10]]+[[1d8]]]]}} {{Dice rolls=$[[0]] and $[[1]]}} {{Damage=[Push Me!](~Damage Roll)}}

Part 2: Create an Ability Macro that says this: 
Name: Damage Roll     (make sure it is exactly that name, or change the bolded part of part 1 to match)
Macro: 
&{template:default} {{name=Spell Macro Damage}} {{Damage=[[?{Best of the Dice Rolls}]]}}

You can rename things to suit your needs, and you can build in bonuses normally, this is just the basic format. 
You hit the macro, then hit the button, then enter the best damage roll. 

As I said earlier, RainbowEncoder can probably do some magic here to combine it better, but most people don't understand the sorcery involved, I certainly don't. :)

November 09 (2 years ago)

Edited November 09 (2 years ago)

Thank you very much! I just tried this and it works, and while I really appreciate you writing the macro, I think it might not actually be worth the effort in this configuration. Since the damage modifiers are always static numbers, it seems like it'd be easier to just have a basic macro display the to-hit rolls and then manually add the damage modifier to the higher roll in your head. Should be faster and less of a hassle than clicking a separate button and manually inputting a number.