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

Rolling binomial dice?

Hi! Years ago a friend and I came up with a house rule set using a rolling system that doesn't seem to be compatible with Roll20. I'm wondering if anyone can help me work out how to get it working here. Each die is six sided, three sides have pips and three are blank. Whenever a number of dice are rolled, the ones showing pips are counted and the blanks are discarded. So rolling 6D can have a result from 0 to 6, and the distribution of results follows a normal curve. If I roll d1 on Roll20, all results are 1. If I roll d2, all results are either 1 or 2. Neither of these work with my system.  Additionally, modifiers can be applied to a roll. For this I use different coloured dice. Say my player had a sword skill of 6 and a fine sword with a +1 modifier, they roll 6 white dice and 1 green one. The total pips equals the skill roll. The reason I use a different colour for the modifier is that if a skill roll is a critical success (all 1s) then the player's skill gains a level. It's important to tell the modifiers apart for that reason. Modifiers can pe positive or negative. Is there a way to achieve these results with the Roll20 dice rolling tool? Thank you!
1519871235
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
[[?{Number of Dice}d2 -?{Number of Dice}]] should do what you need.
Thank you. Would you mind explaining the structure of that please?
1519871603

Edited 1519871778
The core rule may be rolled with the following command: [[?{Dice Rolled|1}d2-?{Dice Rolled}]] ("2" is treated as a side with a pip, "1" as a blank) Additional rolls may be rolled separately, with modifiers. If desired, a default template may be used to output the result. That or multiple rolls could be entered on separate lines in the macro. EDIT: Beaten to it!  For an explanation, you know that the sum of your rolls would be X to 2X, or in the case of your example, 6 to 12; shifting the range of possible solutions up six. By subtracting the number of dice you rolled you shift that range back down. The ?{Dice Rolled} is prompting for how many dice you are rolling, or X in the above. So what the system is doing is Xd2-X.
Thank you! So this seems to be working for me: [[?{Dice Rolled|1}d2-?{Dice Rolled}]]+[[?{Modifier|1}d2-?{Modifier}]] That allows me to enter the skill level and the modifier. It doesn't seem possible to enter a negative symbol into the "Modifier" box. Will I need to have a different macro for rolls with negative modifiers? Also, the result as shown in the chat gives the skill result plus the modifier result. Is there a way to show the total as well? So the output might be 6+1=7. That might seem easy to do in the head, but it would be nice for more complex rolls to see the result.
1519872202

Edited 1519872864
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Sure, This uses rollqueries which act like variables in algebra. If you repeat the prompt of the query, it puts the previous response: ?{Query1|1|2|3} +?{Query1} = Query1*2 To do your modifiers, sorry missed that the first time around, you'd do: [[?{Number of Skill Dice}d2 -?{Number of Skill Dice} +?{Number of Bonus Dice}d2cf<0cs<0-?{Number of Bonus Dice}]] This sets the crit fail and crit success of the bonus dice so that it will never be triggered for those dice. This means that your roll will be highlighted red - all skill dice were null, blue - mix of null and pip skill dice, or green - all skill rolls were pips. EDIT: for the negative modifiers this should work: [[?{Number of Skill Dice}d2 -?{Number of Skill Dice} +[[?{Number of Bonus Dice}]]d2cf<0cs<0+[[?{Number of Bonus Dice}*-1]] ]]
Scott C. said: [[?{Number of Skill Dice}d2 -?{Number of Skill Dice} +?{Number of Bonus Dice}d2cf<0cs<0-?{Number of Bonus Dice}]] This sets the crit fail and crit success of the bonus dice so that it will never be triggered for those dice. This means that your roll will be highlighted red - all skill dice were null, blue - mix of null and pip skill dice, or green - all skill rolls were pips. Excellent bit of macro-fu Scott C! Neil C. Whenever you may be working with a negative number, you need to put parenthesis around it. However, using the same query for a negative number would prevent you from rolling dice; you can't roll a die with negative sides. As a potential solution, you could add another query as to whether or not you are adding or subtracting, but that makes things murkier. Scott C. might have a more elegant solution that wouldn't involve a slew of prompts.
1519872663

Edited 1519872891
So doing this works for positive modifiers: [[?{Skill|1}d2-?{Skill}]]+[[?{Modifier|1}d2-?{Modifier}]] = [[?{Skill}d2 -?{Skill} +?{Modifier}d2cf<0cs<0+?{Modifier}]] It gives results that look like: 6+1=7 Which is great! But it only works with positive modifiers. Is there a way to modify the macro so that I can enter "-2" for example in the "Modifier" popup box? [Edit] Wait, no, the above macro seems to be doing funny things to the results. So I guess I can't just stick them together!  [Edit] Thanks Bryan :) I'll see if Scott has a suggestion, otherwise I'll try and work out how to add the extra query.
Most welcome. Just don't want to be jumping on his toes since he seems to have a deeper understanding of the macros. I'll monkey around a bit and see if I can clean it up. If not, and Scott doesn't have a solution either, I'd be glad to dump my mess of a solution on you ;)
1519872913

Edited 1519873043
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Actually you can roll negative number of dice, see this macro (copied from my edit above): [[?{Number of Skill Dice}d2 -?{Number of Skill Dice} +[[?{Bonus}]]d2cf<0cs<0+[[?{Bonus}*-1]] ]] EDIT: And, no worries about stepping on toes. Competetive forum posting is a favorite past time of us itinerant Roll20 lurkers ;)
Thanks for all the help folks! I'm trying to put this all together so it shows both the result of the skill roll, the modifier and the result, but I'm obviously not understanding something because it's screwing up the results. [[?{Skill}d2 -?{Skill}]] + [[ [[?{Modifier}]]d2cf<0cs<0+[[?{Modifier}*-1]] ]] = [[?{Skill}d2 -?{Skill} +[[?{Modifier}]]d2cf<0cs<0+[[?{Modifier}*-1]] ]] I will get a result like: 2 + 0 = 4
1519873962

Edited 1519874155
"Competitive forum posting" I like that! :) Noticed an omission for the bonus die. Like the initial die, it needs to have the number of die removed as well. This would be done with the same method as for the first part. Also added the initial number of dice to the end of the check. Updating Scott's macro, it would look like this:  [[?{Number of Skill Dice|6}d2 -?{Number of Skill Dice} +[[?{Bonus|0}]]d2-(?{Bonus})cf<0cs<0+[[?{Number of Skill Dice} + ?{Bonus}*-1]] ]] As an aside, for the queries, the |# isn't strictly needed. The only reason I include it is because I've a terrible habit of rapid clicking and, in some instances, a null entry makes the macro go squirly. EDIT: "I'm trying to put this all together so it shows both the result of the skill roll, the modifier and the result, but I'm obviously not understanding something because it's screwing up the results." I believe that this is not feasible without using API; a Pro benefit. Without API you can do one or the other. If you wanted to show the rolls separately, you'd have to break up the macro.
1519874096
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You can't reuse dice rolls, so it's actually rerolling your d2's for your equal. If you don't want to use templates, you can get what you want by doing this: /r [[?{Number of Skill Dice}d2 -?{Number of Skill Dice}]][Skill] +[[ [[?{Bonus}]]d2cf<0cs<0+[[?{Bonus}*-1]] ]][Bonus]
And Scott has a better solution again! I need to work on both my macrofu and forum lurking!
1519874187
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Bryan P. said: [[?{Number of Skill Dice|6}d2 -?{Number of Skill Dice} +[[?{Bonus|0}]]d2-(?{Bonus})cf<0cs<0+[[?{Number of Skill Dice} + ?{Bonus}*-1]] ]] That would actually double the number of skill ranks that you are accounting for
1519874263
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Bryan P. said: And Scott has a better solution again! I need to work on both my macrofu and forum lurking! Heh, I'm just passing on what I learned from the true masters, like the great and powerful Arcane Scriptomancer The Aaron, and the the true Macro Guru, Silvyre.
Bryan, thanks again. The updated macro you posted only shows the final result. Can it be modified to show the skill roll result and the modifier roll result as well? So the output looks something like: 3 + 1 = 4 or 5 - 2 = 3
Scott C. said: Bryan P. said: [[?{Number of Skill Dice|6}d2 -?{Number of Skill Dice} +[[?{Bonus|0}]]d2-(?{Bonus})cf<0cs<0+[[?{Number of Skill Dice} + ?{Bonus}*-1]] ]] That would actually double the number of skill ranks that you are accounting for In which part of it?
1519874431
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Here: [[?{Number of Skill Dice|6}d2 -?{Number of Skill Dice} +[[?{Bonus|0}]]d2-( ?{Bonus} )cf<0cs<0+[[ ?{Number of Skill Dice} + ?{Bonus} *-1]] ]] And, actually, it's doubling the bonus as well.
1519874560

Edited 1519874635
Ahh thanks Scott, that's the kind of output I was looking for. This version doesn't seem to support entering a negative ( eg "-2" ) into the bonus box? [Edit] Well it does, but it just uses the negative number, it doesn't roll that many dice and subtract.
Neil C. said: Bryan, thanks again. The updated macro you posted only shows the final result. Can it be modified to show the skill roll result and the modifier roll result as well? So the output looks something like: 3 + 1 = 4 or 5 - 2 = 3 Scott's earlier solution would work for that: /r [[?{Number of Skill Dice}d2 -?{Number of Skill Dice}]][Skill] +[[ [[?{Bonus}]]d2cf<0cs<0+[[?{Bonus}*-1]] ]][Bonus] Sorry Scott, not following. Wouldn't the later instances just be applied to the CS check?
1519875018

Edited 1519875102
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Neil C. said: Ahh thanks Scott, that's the kind of output I was looking for. This version doesn't seem to support entering a negative ( eg "-2" ) into the bonus box? [Edit] Well it does, but it just uses the negative number, it doesn't roll that many dice and subtract. Ah, so it does, ok, time to use some math functions then. Try this: /r [[?{Number of Skill Dice}d2 -?{Number of Skill Dice}]][Skill] +[[ [[?{Bonus}/abs(?{Bonus})*[[abs(?{Bonus})]]d2cf<0cs<0]]+[[?{Bonus}*-1]] ]][Bonus] Bryan P. said: Neil C. said: Bryan, thanks again. The updated macro you posted only shows the final result. Can it be modified to show the skill roll result and the modifier roll result as well? So the output looks something like: 3 + 1 = 4 or 5 - 2 = 3 Scott's earlier solution would work for that: /r [[?{Number of Skill Dice}d2 -?{Number of Skill Dice}]][Skill] +[[ [[?{Bonus}]]d2cf<0cs<0+[[?{Bonus}*-1]] ]][Bonus] Sorry Scott, not following. Wouldn't the later instances just be applied to the CS check? Nope, the critical fumble/success syntax doesn't get modified, it's a tag onto the roll, not part of any arithmetic you put after it
Scott, beautiful! That seems to work like a charm! Thank you so much. I really appreciate the help from both of you. There's no way I could have figured this out alone :) Now I can play online with my friends :)
1519875476
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Glad to help, just passing on all the help I got when I first started on Roll20. Feel free to ask any questions you have on the forums, there's always somebody with an idea for a fix (or as you've seen, several).
Thank you, I will :) And it seems I have discovered a small wrinkle in your last macro: It won't accept a blank or zero value on the modifier. It simply doesn't give an output. Not all skill rolls will have a modifier.
Scott C. said: Nope, the critical fumble/success syntax doesn't get modified, it's a tag onto the roll, not part of any arithmetic you put after it Ah gotcha. Thank you! Thanks Neil, wish I could take some of the credit XD. So far as your ask, Scott will definitely need to answer that one!
1519876216
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Doh, forgot about dividing by zero (which of course isn't possible). This should work for you: /r [[?{Number of Skill Dice}d2 -?{Number of Skill Dice}]][Skill] +[[ [[?{Bonus}/({abs(?{Bonus}),1}kh1)*[[abs(?{Bonus})]]d2cf<0cs<0]]+[[?{Bonus}*-1]] ]][Bonus]
That does indeed work! Thank you so much! :D
1519876640
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Happy Rolling