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] Opposing Dice Pools & Roll Templates

1497998007

Edited 1499890890
XophRA
Pro
Marketplace Creator
Sheet Author
Hey all, I am trying to figure out roll templates for my game. Can anyone give me a hand? System Free Spacer , the game I'm working on, uses two opposing dice pools: Task Dice : D10s gathered from a skill, one of its specialties, and tool rating if you spend a reactor point, and circumstantial advantage. Results of 5 to 9 are one hit; 0s are two hits. Threat Dice : D6s as assigned by the GM; Results 1 to 3 are worth 1 miss. Outcome is determined by Hits minus Misses Current functionality The macro I made with the help of Bryan looks like this: /me Performs Task with ?{Task Dice|0} Task Dice vs ?{Threat Dice|0} Threat Dice /roll ?{Task Dice}d10>10f<4+[[?{Task Dice}d1>1]]+?{Threat Dice}d6>7f<3 A sheet roll for a single Skill look like this: <button class="sheet-rollButton" type="roll" value="/roll [[@{Culture}+?{Culture Specialty|Anthropology, @{CultureAnthropology}|History, @{CultureHistory}|Lingustics, @{CultureLingustics}}+?{Advantage|0}]]d10>10f<4+[[[[@{Culture}+?{Culture Specialty|Anthropology, @{CultureAnthropology}|History, @{CultureHistory}|Lingustics, @{CultureLingustics}}+?{Advantage|0}]]d1>1]]+?{Threat Dice|3}d6>7f<3"></button> What I am trying to do I would like to make a template that would show both sheet rolls and macros to show a pretty and understandable Outcome, like this: Napoleon64 performed a task Culture: 1 History : 2 Advantage : 2 Threat: 3 Results: <1> <0> <5> <3> <6> [1] [4] [2] 2 Hits If it is negative it would be nice if it said 3 misses rather than -3 hits Can anyone help me out with this?
1499891017
XophRA
Pro
Marketplace Creator
Sheet Author
With Roll20Con and GoPlay over, I want to get back to this soon. Can someone give me a hand?
1499969185

Edited 1499969287
Zargon
Sheet Author
Well, there are 2 ways you can actually implement this neither of which will be pretty: Write up an API to prepare values for a roll template call, as you can do the needed operations in an API but not a roll template call. Hardcode all possible outputs into the Roll Template, unfortunately this will prevent you from seeing what was actually rolled on the dice. Basically your roll template would have {{#rollBetween() <rollname> X X}} statements for every expected value X and just have the output written in the HTML, and probably a pair of helpers to display the roll itself when the number goes outside your expected range The complicating factors that prevent other solutions: Sheet/Roll Template HTML is not able to modify the contents of an inline roll, once your roll comes up as -3, it is going to display as -3 or just not display at all. Roll Template HTML cannot perform math, so you can't just add it up in the template Roll Template CSS can override the display attributes of inline rolls, but cannot change the actual contents of the inline roll Inline rolls only have a single output value, there isn't a way that you can split the absolute value and the sign from a single roll. Inline rolls cannot reference one another.
1499970050

Edited 1499971203
XophRA
Pro
Marketplace Creator
Sheet Author
Thanks Zargon, but Wow! Why do I always do things the hard way. You'd think I was making sheet for the Warren with how deep this rabbit hole is. I guess, I could hardcode everything into the Roll Template and continue showing -3 hits. I'm not sure how to make a template really though, there's some stuff that seems to be missing in the wiki. The smart move seems to be to crack open the API and do it right, but that means I need to figure out the API stuff and how to put it into sheets. EDIT: Yeah, I checked it out. API is the way to do it. Now I have to remember Javascript, but that is less painful than HTML and CSS. I may even have some dice rolling code left over, but it's likely in C#. PS: Anyone know why I can't seem to change the background colours on my sheets?