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

Calling successes and botches from a sum roll

1542672675

Edited 1542672709
I am working on a character sheet for a game that tallies successes and botches. Players always roll 5 dice. Some are d10s which represent their skill; the others are d6s that represent chaos, entropy, or general competence. For example, a player with a Storm skill at rank 4 would roll 4d10 + 1d6. A player with a Storm skill of 2 would roll 2d10 + 3d6. I can call a simple Macro from my character sheet, but I am no good at writing code past what I already know and can imagine. Here is what I have: button type='roll' value='/roll @{Storm}d10 + (5-@{Storm})d6' name='roll_StormCheck'></button> I would love to be able to: - Sort in descending order. - Highlight 6s and higher as successes. - Highlight 1s as botches. - Tally total successes (successes - botches). - Trigger a message that says, "Process a subroutine!", when there are 3 or more total successes. I apologize for my ignorance and thank you for any help you can offer. I've tried things like this that haven't worked: button type='roll' value='/roll {@{Storm}d10 + (5-@{Storm})d6}ds>6f1' name='roll_StormCheck'></button>
1542700951

Edited 1542701992
GiGs
Pro
Sheet Author
API Scripter
This will tally all successes and botches, and highlight 6+ and 1s: /roll {@{Storm}d10cs>6cf<1sd}>6 + {(5-@{Storm})d6cs>6cf<1sd}>6f1 It will also sort all d10s in descending order, and all d6s in descending order - you can't sort them in one group AFAIK. You also can't have the message triggered on 3+ successes, using the basic dice engine. It's not possible to re-use a roll, as you'd need to be able to examine how many successes you got. It might be possible to do everything you want by creating a custom rolltemplate for your sheet, since the number of dice is fixed, but that will need some involved coding logic.  Edit:  the first version of this post didnt include botches counting, That's fixed.
Got you, G G - thank you so muc h for the assist! I will mess with rolltemplates soon :)
1542725621

Edited 1542725645
Running into an issue when the attr rank is 5 and the roll consequently calls for 5d10 + 0d6. The "rolling the dice" message appears in the chat, but no results are displayed. Is there a way to script a conditional for something like: if @{Skill}==5, /roll {@{Skill}d10 cs>6cf<1sd}>6f1, else  /roll {@{Deny}d10cs>6cf<1sd}>6 + {(5-@{Deny})d6cs>6cf<1sd}>6f1 This only happens at skill rank 5, not 1, 2, 3, or 4. Also a few skills just don't return a roll at all at any skill rank between 1 and 5. <p>Deny <input type="number" name="attr_Deny" value='' max="5" min="1" /> <button type='roll' value='/roll {@{Deny}d10cs>6cf<1sd}>6 + {(5-@{Deny})d6cs>6cf<1sd}>6f1' name='roll_DenyCheck'></button></p> <p>Gel <input type="number" name="attr_Gel" value='' max="5" min="1" /> <button type='roll' value='/roll {@{Gel}d10cs>6cf<1sd}>6 + {(5-@{Gel})d6cs>6cf<1sd}>6f1' name='roll_GelCheck'></button></p> Could it be a naming problem? G G said: This will tally all successes and botches, and highlight 6+ and 1s: /roll {@{Storm}d10cs>6cf<1sd}>6 + {(5-@{Storm})d6cs>6cf<1sd}>6f1
1542727374
GiGs
Pro
Sheet Author
API Scripter
The names should be fine. Are you sure the attributes have values? Chad S. said: Running into an issue when the attr rank is 5 and the roll consequently calls for 5d10 + 0d6. The "rolling the dice" message appears in the chat, but no results are displayed. Is there a way to script a conditional for something like: if @{Skill}==5, /roll {@{Skill}d10 cs&gt;6cf&lt;1sd}&gt;6f1, else&nbsp; /roll {@{Deny}d10cs&gt;6cf&lt;1sd}&gt;6 + {(5-@{Deny})d6cs&gt;6cf&lt;1sd}&gt;6f1 This only happens at skill rank 5, not 1, 2, 3, or 4. Unfortunately there's no way to do a conditional check like that. I've just tested, and 0dice rolls in that format, with the &gt;6 test at the end, fail in this way. It's a bug, and I've raised a bug thread over here: <a href="https://app.roll20.net/forum/permalink/6980237/" rel="nofollow">https://app.roll20.net/forum/permalink/6980237/</a> By the way, I just noticed a little error in my earlier code: /roll {@{Storm}d10cs&gt;6cf&lt;1sd}&gt;6 f1 + {(5-@{Storm})d6cs&gt;6cf&lt;1sd}&gt;6f1 I overlooked the f1 on the first dice (see bolded section above). Though because of the bug, this expression isnt as useful as it should be.
1542727742

Edited 1542727981
Thank you! G G said: I've just tested, and 0dice rolls in that format, with the &gt;6 test at the end, fail in this way. It's a bug, and I've raised a bug thread over here: <a href="https://app.roll20.net/forum/permalink/6980237/" rel="nofollow">https://app.roll20.net/forum/permalink/6980237/</a> Values confirmed as there for Deny &amp; Gel. Working on sheet here , as well.
1542728934
GiGs
Pro
Sheet Author
API Scripter
Is it just those names that don't work?
Yes. No "rolling the dice" message. Wondering if I missed a bracket or quote in an element above or below, but not seeing anything (which doesn't mean it's not there). G G said: Is it just those names that don't work?
1542729156

Edited 1542729327
GiGs
Pro
Sheet Author
API Scripter
I created attributes named Deny and Gel, and tested it, and it works for me (as long as the starts aren't 0 or 5). Is it possible you have duplicate attributes? Go to the Attributes and Abilities tab and delete all Gel and Deny attributes (check if there's more than one, too), then re-enter them on the character sheet, then retest. Also create a new character, and test it in that one.
1542729315
GiGs
Pro
Sheet Author
API Scripter
Chad S. said: Yes. No "rolling the dice" message. Wondering if I missed a bracket or quote in an element above or below, but not seeing anything (which doesn't mean it's not there). G G said: Is it just those names that don't work? I cant see anything wrong with the formula you've posted, but when you're creating a custom character sheet, you can end up with faulty attributes on the sheet you're using for testing. if you have weird errors, its a good idea to create a new character, and see if the errors persist.
1542734156

Edited 1542734405
Great tip, G G - thank you. New character &amp; deleting/re-upping stats did not work, so I am going to rename them and see what happens.
I found the problem - versioning between GitHub and r20. I left an old typo here; fixed it and fixed Deny and Gel. Now we just need the 5d10 + 0d6 bug resolved.
1542734956
GiGs
Pro
Sheet Author
API Scripter
Thats good to hear! i dont know how fast roll20 will respond to the bug report, I've never reported one before.
Now some weird math is showing up on certain rolls like {@{Rush}d10cs&gt;6cf&lt;1sd}&gt;6f1 + {(5-@{Rush})d6cs&gt;6cf&lt;1sd, 0d6}&gt;6f1 For example,&nbsp; {(1 + 1 + 1)} + {(3 + 1)} Will return - 3 successes, rather than -4. Another example: {(10 + 8 + 2)} + {(3 + 3)} Will return 3 successes instead of 2. And something like&nbsp; {(9 + 2 + 1)} + {(5 + 1)} Will return 1 success instead of -1 successes. What is the weirdness happening between the brackets?