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

How to have a specified range on a die roll be considered a specific result?

In this case, I'm trying to specify that a roll of 2-7 on a d20 is treated as a result of 8. I'm sure there's a way to do it, but it's hurting my brain to figure it out.
1707037051
Finderski
Plus
Sheet Author
Compendium Curator
Is this for a macro, or are you creating a character sheet and this needs to be button behavior? Or is this for a roll on a table?  Depending on the answer, to this question, the answer to the problem is likely going to be different. If it's a macro...may need an API If you're creating a character sheet, then the roll template can use built-in functions like rollTotal, etc. If it's for a roll on a table, and the roll isn't modified at all, then a rollable table would be the easiest solution, but if the roll on a table can be modified, then that rollable table gets a bit harder and possible impossible, so it may be easier to build it as part of the character sheet and/or use an API.
There is an open suggestion for custom dice syntax that would work here, something  to vote for. However it seem like a rollable table would work fine since it can act as a drop-in replacement for a d20; so it can work with modifiers. There are macro possibilities that don't rely on rollable tables or Mods/API if you require more flexibility than a table.
1707060227

Edited 1707060256
GiGs
Pro
Sheet Author
API Scripter
Mike said: In this case, I'm trying to specify that a roll of 2-7 on a d20 is treated as a result of 8. I'm sure there's a way to do it, but it's hurting my brain to figure it out. This is not something you can do with the standard dice rolls. It might be possible to do this (and as a Pro subscriber you have access to scripts that can certainly do this, but we'd need to know more about how you are using it), but you should be aware that the dice roll and macro mechanics do have limitations and there are some things they cannot do.
Finderski said: Is this for a macro, or are you creating a character sheet and this needs to be button behavior? Or is this for a roll on a table?  Depending on the answer, to this question, the answer to the problem is likely going to be different. It would indeed be for a macro. 
1707100329

Edited 1707100354
Gauss
Forum Champion
Mike, what is the full macro? Everything please, modifiers, etc, the entire thing. 
Gauss said: Mike, what is the full macro? Everything please, modifiers, etc, the entire thing.  There currently is no macro. It's based around a Star Wars Saga Edition talent that treats a skill roll of 2-7 on a d20 as if an 8 were rolled. All other results (1, and 8-20) would remain unchanged.
1707123404

Edited 1707123685
Gauss
Forum Champion
So there are no modifiers? Nothing else being added to the d20? For future reference, it is generally a good idea to assume people don't know anything about the game you are trying to build a macro for.  Treat them like you would someone playing for the first time. "First you roll a d20, then you add X, then divide by Y, multiply by Z, dance around,  stand on your head, and then finally you get your answer" (semi-humor) Everything from start to finish factors into the answer that people can give you about a Macro. If something is added, substracted, multiplied, divided, rounded up, or rounded down it will affect the answer people can give you. It isn't just the d20 that matters. :)
It works very much like something between 3.5 and 4.0 D&D versions, with the addition of a Condition Track modifier (which eliminates tracking many Conditions from those editions). So for ranged attacks it's: 1d20 + Base Attack Bonus + Dexterity modifier + Condition Track modifier (always at 0, -1, -2, -5, or -10), + Armor penalty + misc  The sheet also prompts you to enter any additional miscellaneous modifiers on the fly before the attack resolves. Here are the two actual formulas cut and pasted directly from the sheet: Attack Modifier total formula: @{BAB}[BAB] + @{attackMod}[Mod] + @{attackModMisc}[Misc] +@{CT}[CT] +@{ArmorType|max}[Armor Penalty] Attack Roll formula: 1d20cs>@{WeaponCrit}[Critical Range] + @{attackTotal} + ?{Other Modifiers (Attack)|0}[Other]
1707157160

Edited 1707157907
Gauss
Forum Champion
So to clarify:  1d20 + or - various numbers? And a critical calculation?  Unless RainbowEncoder has some magic, I think you are going to be using an API script for this one. If it was a lonely 1d20 it probably could do what you are asking, but adding values to it limits what can be done (barring Rainbow's magic).  Edit: Earlier RainbowEncoder suggested using a table, and while you could use a table for that, you'd lose the "cs>@{WeaponCrit}" element. 
I'm gonna plug the suggestion for custom dice syntax again because it turns out a custom d20 with a custom crit range is rather large. You can replace 1d20cs>@{WeaponCrit} with {d1cs0 + [[{8+0d0,d(@{WeaponCrit}-2)+1}k1]]*{ {1d20cs0cf0>2f>@{WeaponCrit}*21} }/21 + [[@{WeaponCrit}+d(21-@{WeaponCrit})-1]]*(1-floor(1/(1+1d(22-@{WeaponCrit})cs>2)))}k1 It utilises what I called gatekeeper dice