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

Help requested with dice processing in roll template

I'm currently trying to set up sheets for an in-house system centered around creating pools of dice, rolling them simultaneously, and then comparing them one by one against an opponent's set of dice. I am currently trying to figure out how to pull all of these dice (from a selection in a repeating section) through a roll format that can display them as separate inline rolls. I was hoping to do this by adding repeating arguments to the roll template, but I don't know how to do that or if it's even possible. Please help!
1739268098
Richard W.
Pro
Sheet Author
API Scripter
Compendium Curator
Hi, I have a dice pool system in one of the sheets I authored, and I am recently updated it to build a dynamic roll template string based on the selection of dice, then executing it using Custom Roll Parsing. You can find discussion of CRP in the forum and&nbsp; <a href="https://wiki.roll20.net/Custom_Roll_Parsing" rel="nofollow">https://wiki.roll20.net/Custom_Roll_Parsing</a> &nbsp;as well as&nbsp; <a href="https://help.roll20.net/hc/en-us/articles/4403865972503-Custom-Roll-Parsing-for-Character-Sheets" rel="nofollow">https://help.roll20.net/hc/en-us/articles/4403865972503-Custom-Roll-Parsing-for-Character-Sheets</a>. &nbsp; If you want to see how I did it, then have a look in the Mutant Year Zero sheet in the Roll20 github repo. Lots of what I have in there are legacy stuff and might need an update, but the roll parsing in the executeRoll function was written recently.&nbsp; Basically, I have 3 different types of dice that the player can chose up to 12 of, for each of them I add a `type-roll-${id}= [[ 1d6 ]]` to the dice roll string, this gives me a separate roll output per dice. The roll template then has an output for each, so that one grows pretty large compared to if rolls were lots of dice are all in the same roll.&nbsp; The next question might be how you want to handle the opposing roll - do each character sheet roll separately and have separate output in the chat, or would the player also input the opposing roll info in their own sheet? The former is probably what you are after and more straightforward, the latter would be more complicated but might allow you to do comparsions of the rolls before sending the result to chat.
1739371756

Edited 1739377025
GiGs
Pro
Sheet Author
API Scripter
I was thinking of Custom Roll Parsing as the solution here, too. It would be remiss of me not to mention my own posts on this topic, since I've been told its much easier to learn about CRP from there - the official documentation is confusing (as you can see from comments). <a href="https://cybersphere.me/guide-to-custom-roll-parsing/" rel="nofollow">https://cybersphere.me/guide-to-custom-roll-parsing/</a> There's a lot of articles there, but some are just examples of dice type.s Just start in the first column, and it wont be long before you grasp the topic.