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

Raw roll results and result with modifiers

Hi Folks,   I did some searches and couldn't find anything relevant, although it seems like something others must have run into before. I'm running a game in which the raw roll result matters AND the modified dice roll matters. In my roll template, I'm capable of getting the result and differentiating between the dice rolls. The problem I'm having is that I want to use the raw dice roll and the modified dice roll separately. Are roll templates capable of handling this? Does this require a dip into API land? Example pseudo description: roll a 1d20 if a 1 - something special happens if a 10 - something special happens if a 20 - something special happens Now, take the 1d20 roll and add the roll modifier check the total roll against target difficulty
1459705021

Edited 1459706179
Diana P
Pro
Sheet Author
Assuming you are programming your Roll Templates, you can use the #rollTotal() helper to specify things to happen when you roll a certain value. For example, in my RMSS games (using d100s), I need something special to happen on certain rolls when a 66 is rolled so I have a section in my template set up to highlight those rolls: {{#highlight66roll}} {{#rollTotal() checkroll highlight66}} <tr class="sheet-tr-repeating"><td colspan="2"> {{highlight66roll}} </td></tr> {{/rollTotal() checkroll highlight66}} And I call that in the roll with something like: {{checkroll=[[1d100!>96cf<5cs=100 +3*@{agbonus} ]]}} {{highlight66= [[66 +3*@{agbonus} ]]}} {{highlight66roll=**Natural 66.** }} This one just tells me it was a Natural 66 since in this case I typically need to refer to a table for the result.  :)  In case you want to know what all the stuff attached to the d100 is, this particular roll has a custom critical fumble/fail range (1-5), a critical success on a natural 100, and the die is open-ended high (roll again and add to the total if the die roll is 96 or higher). You could do the same where you are doing something based on a total of (10+modifier), (20+modifier), and (1+modifier).  You could also use #rollWasCrit()   and/or #rollWasFumble() to do stuff for the 20 and the 1 respectively if you don't need to modify the crit and fumble ranges for other uses.  If you are not using/programming custom Roll Templates, you would probably need to go the API route.
1459714266

Edited 1459714693
If you don't want to use a character template, that option is available in the Powercards script on the API forum. You can show the full roll with [xpnd] and use conditionals to check for the unmodified results. Here's a quick and dirty powercard that would do what you want. !power {{ --name|Expanded Roll & Conditionals --Roll:| [[ [$Roll|xpnd] 1d20 + 5 ]] --?? $Roll.base == 1 ?? Rolled a 1:|Do something... --?? $Roll.base == 10 ?? Rolled a 10:|Do something else... --?? $Roll.base == 20 ?? Rolled a 20:|Do this instead... --?? $Roll.total >= @{target|AC} ?? Rolled Higher than @{target|AC}:|I did the thing! }}
Thanks to both of you. Thanks Diana. I think your route is closest to what I was already doing. I simply didn't think to put my targets with a bonus into a variable and kept thinking more like the API route of checking the base roll vs the total roll. I still wish I could do that in the template but since I can't, I'll use this other method.  Thanks also HoneyBadger This API route seems more natural to me. I haven't taken the dive into messing with the API yet, but it seems like it was matching where my brain went programmatically already.
Okay, just to clarify, is it impossible to do any math with the dice result in the roll template?  At this point, I've finally gotten around checking the rolls against targetnumbers shifting for bonuses to the dice roll. But, I'd like to add two different dice rolls together while keeping them as separate rolls as well. So I need a 1d10 and a 1d6 separately AND as a sum (or even doing some mult/div) for a handful of conditionals on both but as a sum and separately.
1459742313

Edited 1459742472
Diana P
Pro
Sheet Author
Yes, it is impossible.  To put the results of a roll into a 'variable' and do things with those results, you would have to use an API script.  The Roll Template is basically a fancy way of displaying the results of rolls.  You can only do the stuff in roll templates that you can do with the dice roller in general (using /roll or [[.....]]. However, you can do something like [[(d10+conditionals)*1.001 + (d6+conditional2)*1.000001]] which could give you 11.008003 where the first number is the sum of everything (the 11), the second number is the result of the d10+conditional (the 8) and the last number is the result of the d6+conditional (the 3).  That can be useful for some purposes.  But a little more difficult to read. HoneyBadger's Powercards is pretty amazing if you want to try that route.
1459745514

Edited 1459745975
Diana P said: HoneyBadger's Powercards is pretty amazing if you want to try that route. +1! <a href="https://app.roll20.net/forum/post/2165711/script-powercards-3-thread-3" rel="nofollow">https://app.roll20.net/forum/post/2165711/script-powercards-3-thread-3</a> Here's something to play with, if you're interested (documentation in the OP of the above thread): !power {{ --XPND'd results:| [[ [$Sum|XPND] [$A] d10 + [$B] d6 ]] --Inline roll boxes:| [! [^A] !] + [! [^B] !] = [! [^Sum] !] --!Referenced results:| I rolled a **[^A]** on my d10 and a **[^B]** on my d6, which sums to **[^Sum]**. -- ?? $A.base == 5 OR $B.base == 5 ?? !X| I rolled a five on one of my dice. -- ?? $Sum &gt;= 12 ?? !Y|Nice roll! }}
Alright, so I started diving into the powercards. It turns out, I can use the conditionals of the dice rolls just fine. The idea you had Diana of sticking them into decimal digits is another clever one. I haven't gone there, but it is a solid idea. With powercards,&nbsp;I don't seem to be able to output the variables values in a tag or the rhs of a tag or even to use the variable in anything but a conditional. Perhaps I'm pushing too hard with these frameworks and just need to break down and deal with the API. I've gotten both to get very close to what I consider perfect. Thanks so much for all your help everyone. The powercards definitely make things pretty more quickly, although, they're not ultimately giving me much more power than roll templates were. They're faster to mock up though and if I had seen them first, I would have preferred coding them this way due to the ease of a test macro vs writing in the html and refreshing everything.
1459857998

Edited 1459858262
Post an example of what you're trying to do and myself or someone else familiar with Powercards can help refine it for you. There's a lot you can do with powercards, but there are some limitations as well that are difficult to code around due to my limited knowledge of javascript and how little free time I have these days. As for outputting the conditionals in a tag... no, you can't do that, but you can hide the tag and create a fake tag like this: !HiddenTag|**Fake Tag:** [! [^RollID] !] The ! mark in front of a tag hides it from being displayed. Wrapping double * around text makes it bold. The [! and !] just turns anything inside it, into an inline roll like display (the yellow bow). Finally, the biggest benefit of PowerCards over Roll Templates is that powercards are built on the fly instead of being locked into a specific template. It's all done inside macros. Quicker to test as well, as you found out. Powercards are also much more flexible when it comes to editing them for special edge cases. Like if you need an extra line here and there for something, but not everything.