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 .
×
May your rolls be chill this holiday season!
Create a free account

Special die roll MACRO

I want to start playing "Tunnels and Trolls" on r0ll20 but there is a special die rolling convention. When you make a saving throw you roll 2d6 and add your attribute score to achieve a target number assigned by the GM ,if you roll doubles you roll again and add the result to the previous roll, if you roll double again keep adding the scores to the previous roll (The most I have ever seen rolled in game was 5 times). but if on your very first roll you roll under 5 (1,2 or 1,3) you automatically miss your save.  Cant for the life of me figure a MACRO for that!
1591060169

Edited 1591060332
Oosh
Sheet Author
API Scripter
Is this any good? It shows the total (including an @{attribute}, then the 2 d6 results in brackets. If you save this as an Ability macro in your character sheet and name it SavingThrow, the Reroll button will trigger the macro again. You could make a second macro without the "less than 5" part instead, since that is only relevant for the first roll. Code is here: &{template:default} [[ [[1d6]] + [[1d6]] + @{Attribute}[Bonus] ]] {{name=Saving Throw}} {{Roll=$[[2]] -- ($[[0]] + $[[1]])}}{{If less than 5=**FAIL!**}}{{If doubles=[Reroll](~SavingThrow)}} You will need to edit @{Attribute} to whatever your Saving bonus Attribute is called! You can also add a query to have the target number on there somewhere if you like. Is this any good or not what you wanted? Your other option is a rollable table to simulate rolling 2d6, with custom text results for each dice combination, but I don't think you can call any Attributes from within the table, so you would have to add that manually
1591060378

Edited 1591060451
GiGs
Pro
Sheet Author
API Scripter
Edit:  Ninja'd, and with a better solution. Nice work Oosh. :) The reason you cant figure it out is because its not possible. Roll20 doesnt support conditional processing, except for some very specific options listed in the dice reference. That means t here's no way to do the reroll on doubles.  The exploding system (rerolls) works only with fixed preset numbers - you cant use the result of a roll to set the number that causes a reroll. And thats what you need to do with rerolling on doubles. Rerolls also work per die, you cant do rerolls based on the total of two dice - which again is what you are doing with rerrols when two dice are equal. You can bypass these limits at pro subscription when you can use the API to create a script. The best way to do this on roll20 is to include a button in the macro result which allows users to reroll. The way I;d normally suggest is something like this Create a macro for your dice rolls, lets you call it TT-save . /roll 2d6+?{Bonus?|0}  [Reroll](!
#TT-save) When the player runs this macro, they'll be prompted for a bonus. It'll show the roll, and a button for running the macro again. So if you roll double, you can reroll and enter the new bonus. Word of Warning:  This part of the code above:  
 is a html entity. Once you save the macro, if you open it again, that bit will vanish, and the macro will break. You'll have to reenter the macro properly. So don't open  it.
1591061420
Oosh
Sheet Author
API Scripter
Your post was 100 times more informative. I forgot to mention that the intuitive way to do it isn't possible!
1591063645
GiGs
Pro
Sheet Author
API Scripter
I seem to remember that in Tunnels &amp; Trolls characters dont have individual initiative. So there's a way to simplify the rerolls by hijacking the turn tracker. It's a bit laborious to set up if you have a lot of characters, but if you're just starting a campaign, it's pretty easy. I describe it here:&nbsp;<a href="https://app.roll20.net/forum/permalink/8768261/" rel="nofollow">https://app.roll20.net/forum/permalink/8768261/</a>
Thanks guys! Very helpful to know why I was twisting in the wind! Tunnel and Trolls uses a "THERE SIDE" /&nbsp; "YOUR SIDE" damage approach with NO "to hit" feature. You count up all the damage from each side compare them and the losing side divides the damage&nbsp; among everyone in the losing side with a 10% defenders leak even if they won the round. Make battle SUPER fast!! But you lose some realism.
Oosh said: Is this any good? It shows the total (including an @{attribute}, then the 2 d6 results in brackets. If you save this as an Ability macro in your character sheet and name it SavingThrow, the Reroll button will trigger the macro again. You could make a second macro without the "less than 5" part instead, since that is only relevant for the first roll. Code is here: &amp;{template:default} [[ [[1d6]] + [[1d6]] + @{Attribute}[Bonus] ]] {{name=Saving Throw}} {{Roll=$[[2]] -- ($[[0]] + $[[1]])}}{{If less than 5=**FAIL!**}}{{If doubles=[Reroll](~SavingThrow)}} You will need to edit @{Attribute} to whatever your Saving bonus Attribute is called! You can also add a query to have the target number on there somewhere if you like. Is this any good or not what you wanted? Your other option is a rollable table to simulate rolling 2d6, with custom text results for each dice combination, but I don't think you can call any Attributes from within the table, so you would have to add that manually This MACRO wont run for me... it says TypeError: Cannot read property 'substring' of undefined
1591154125

Edited 1591154181
Oosh
Sheet Author
API Scripter
The Attribute call in there was a generic one: Where I've put @{Attribute}[Bonus] , you will need to change it to the actual name of the Attribute on the character sheet - you said there was an 'attribute score' to add to the roll? For example, if the Attribute name is save_bonus and your character is called Bob , you would replace it with @{Bob|save_bonus} The [Bonus] part in square brackets is just a label for when you mouse over the roll, you can put whatever you want in there, or leave it out completely. If you'd prefer a universal solution you would use @{selected|save_bonus} but you will have to select a token before using the macro each time. If the relevant Attribute is not stored on a character sheet you will need to use a Query instead of an Attribute reference: ?{Attribute score|0}
That explains it.... thank you so much!
1591185217
Oosh
Sheet Author
API Scripter
No problem.... is it working?
No.... not working :(
1591241860
GiGs
Pro
Sheet Author
API Scripter
Can you post the macro you are trying, Scot, exactly as it is in your campaign?
&amp;{template:default} [[ [[1d6]] + [[1d6]] + @{dexterity_base}[Bonus] ]] {{name=Saving Throw}} {{Roll=$[[2]] -- ($[[0]] + $[[1]])}}{{If less than 5=**FAIL!**}}{{If doubles=[Reroll](~SavingThrow)}}
I tried to make this a player rollable MACRO. Should I be using this in the character sheet??
Ok... it works in the character sheet but when I get doubles and hit the re-roll I get this
1591243938
GiGs
Pro
Sheet Author
API Scripter
You need to have the SavingThrow on a character sheet, in the Abilities tab.&nbsp; I just tried it and it worked for me, when launched from an Ability.
1591251723
Oosh
Sheet Author
API Scripter
Make sure you save it exactly as SavingThrow with no space in between Saving and Throw!
It all works now.... but the re-roll adds the attribute to the 2d6 . Re-rolls should just be 2d6&nbsp; is that something easy to fix??
I guess I will need to make one of these MACROS for every attribute separately
1591328171
GiGs
Pro
Sheet Author
API Scripter
If you want the reroll to be separate, the best way is to create a separate macro, that just rolls the 2d6. Call that one with the button. You can also use the same macro for multiple attributes, if you put them in a query - how many attributes are there? assuming 4 attributes named dexterity, strength, will, and charisma (just random examples) the query would look like ?{Which Stat?|Dexterity,@{dexterity}|Strength,@{Strength}|Will,@{Will}|Charisma,@{Charisma}}
1591340364

Edited 1591340576
Oosh
Sheet Author
API Scripter
So adding in what GiGs has suggested above, you would have these two macros (I think! I'm not familiar with the game as you guys are): First macro replaces the one you had, SavingThrow &amp;{template:default}&nbsp; {{name=Saving Throw}} {{Roll=[[ [[1d6]] + [[1d6]] + ?{Which Stat?|Strength,@{strength}[STR]|Intelligence,@{intelligence}[IQ]|Luck,@{luck}[LK]|Constitution,@{constitution}[CON]|Dexterity,@{dexterity}[DEX]|Charisma,@{charisma}[CHR]} ]] -- ($[[0]] + $[[1]])}}{{If less than 5=**FAIL!**}}{{If doubles=[Reroll](~SavingThrowReroll)}} SavingThrow is the one you use on your macro bar/token bar, wherever you like to run it from. The second macro is saved in the Ability section with the first one, and named SavingThrowReroll &amp;{template:default} {{name=Saving Throw}} {{Roll=[[ [[1d6]] + [[1d6]] ]] -- ($[[0]] + $[[1]])}}{{If doubles=[Reroll](~SavingThrowReroll)}} This only rolls the 2d6, adds no modifier, and links back to itself in case doubles are rolled again. You don't need this one on your macro bar or as a token action, it only runs when it's linked to by the first one (or itself). Is this getting closer? :) I just check the Wikipedia page for T&amp;T for the Attributes, no idea if these are correct for the sheet you're using - so the Query may still need some work.
&amp;{template:default}&nbsp; {{name=Saving Throw}} {{Roll=[[ [[1d6]] + [[1d6]] + ?{Which Stat?|Strength,@{strength}[STR]|Intelligence,@{intelligence}[IQ]|Luck,@{luck}[LK]|Constitution,@{constitution}[CON]|Dexterity,@{dexterity}[DEX]|Charisma,@{charisma}[CHR]} ]] -- ($[[0]] + $[[1]])}}{{If less than 5=**FAIL!**}}{{If doubles=[Reroll](~SavingThrowReroll)}} Is not working as a stand alone MACRO But&nbsp; &amp;{template:default} {{name=Saving Throw}} {{Roll=[[ [[1d6]] + [[1d6]] ]] -- ($[[0]] + $[[1]])}}{{If doubles=[Reroll](~SavingThrowReroll)}} works from the character abilities off the character sheet.
1591421701
GiGs
Pro
Sheet Author
API Scripter
That wont work as a standalone macro, because when you run it, roll20 doesnt know which character to draw the attribute values from. If you put it in a character Ability, it should work, using that characters abilities. If you want it as a standaloe macro, you'll need to tweak each attribute. For example change this: Strength,@{strength}[STR]| to this Strength,@{ selected| strength}[STR]| Convert every attribute like that. Then to run the macro, you'll need to select a token which is linked to a character. Then when you run the macro, it will use that character's abilities. You can select any token, and as long as the token represents a character, the macro will use that character's attribute values.