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

See hits AND fails for each roll

1561901682

Edited 1561962652
This probably has been discussed before, I just couldn't find it. We're playing Shadowrun and since we're from Germany, all the Sheets don't match our needs and are mostly even more complicated than the game itself. So we're playing with PDF-Sheets and I tried to make life easier for my players by using a roll template to at least display the rolls nicely. Since the game needs to count hits and misses, I tried all I could think of to display the following info for each roll: Charakter name Dice pool No. of hits No. of fails I've been successful with the first three but Roll20 seems to be unable to display a fail count from the same roll the hit count was from. Am I doing something wrong? Is there a workaround?
1561902058

Edited 1561902117
GiGs
Pro
Sheet Author
API Scripter
There's no way to do this without either (a) modifying the rolltemplate and rollbuttons for your sheet, or (b) using a custom API script. Macros arent capable of returning two bits of information from the same roll - you get no. hits or no. misses, not both. If you show your rolltemplate code, and what a standard roll looks like, we can probably suggest how  to tweak it to get both bits of data.
1561902886

Edited 1561903278
&{template:default} {{name=@{selected|token_name}}}{{Würfelpool: ?{Würfelpool}}}{{Erfolge: [[?{Würfelpool|0}d6>6]]}} This is what I have so far. It uses the default template, as we can't use any available sheet. I got the characters name shown in the header. I got the number of dice rolled, so we can see if someone mistyped I got the number of hits, meaning any roll that is 5 or 6. This is the result I get: I would need a third line telling me the no of fails. Always checking with a mouseover is so very inconvenient. (In case you wonder: "Würfelpool" is "Dice Pool" and "Erfolge" is "Hits" in German.) We do not use any kind of Sheet in Roll20! We use PDFs created by the Chummer5a Software. All available Sheets I could find so far were not in German or way to complex.
1561904171

Edited 1561904200
GiGs
Pro
Sheet Author
API Scripter
If you're using the default rolltemplate, it cant be done. I mentioned a rolltemplate because character sheets can include custom code that allows you to manipulate the dice roll in various ways that you cant do with the custom template. Since you're not using a sheet, your only option is a custom API script. It isn't a complicated one, I've done similar scripts before. I'll try to find time to post one later if no-one else does.
1561905592

Edited 1561906649
I never used any API scripts. Hell, I don't even have any clue how to create sheets as I have very limited knowledge of HTML and none about CSS. Looking forward to what you guys have to show to make the impossible the normal! ;) BTW, what kind of language do you need for API scripts?
1561906942
GiGs
Pro
Sheet Author
API Scripter
Scripts use javascript, though more complex scripts can benefit from also knowing some html and css. Does your game always have a fixed difficulty of 5? Back when i played first edition shadowrun, difficulty varied from 4 up to 12 or even higher (meaning you needed to account for dice rolling above 6). Does your system need that?
1561907160

Edited 1561907406
Rolls of 5 or higher are hits in the official rulebook. But it's also important how many 1 you roll, as they determine fumbles and crit fails. There seem to be some rules about rolls made with edge but I will handle this separately, I only want some convenience for the standard rolls. Just to make this clear: I was only asking for convenience , as checking manually by moseover sucks, especially if you have to roll that many dice as in SR. If you need to put effort into it, just tell me it can't be done and I will try to think of something else, maybe have the rolls shown in a sorted order or whatever Roll20 can do!
1561908631
GiGs
Pro
Sheet Author
API Scripter
Don't worry, its pretty easy to do, and I'll find it fun once I can get around to it. I was just asking for details before i started doing any work so that i did it correctly. So you need to know: how many hits (roll 5+), how many misses, and if any 1s rolled, how many of those. You use the label  Erfolge for hits, what would you use for  misses and rolls of 1? Does that cover everything?
1561909390

Edited 1561910661
Not exactly... The label for Hits is "Erfolge" and every roll on a D6 that is 5+. The label for misses is "Patzer" and every roll of 1 on a D6 counts as a miss. All rolls of 2, 3 or 4 can simply be ignored Basically, SR5 works like this: If you rolled more 5s and 6s than the difficulty set by the GM, it's a success. If you rolled more than half of the dice as 1s, you have a failure. If you rolled no 5s or 6s but some 1s, it's a critical failure . And, weird as it may sound, if you roll enough 5s and 6s to beat the difficulty but still rolled more than half 1s, it's both a success and a failure. That's Shadowrun for you, we can only hope 6th Edition makes it better. Thanks in advance, I really appreciate it.
1561914331
GiGs
Pro
Sheet Author
API Scripter
That's a weird failure rule. It seems like Critical Failure would be more common that Failure. The script is below, with install instructions. To use it, just use this macro: !srdice @{selected|token_name} [[?{Würfelpool}d6]] 1 It will give output like this   If you leave off that 1 at the end, it wont show the dice line. So  !srdice @{selected|token_name} [[?{Würfelpool}d6]] instead of !srdice @{selected|token_name} [[?{Würfelpool}d6]] 1 There's a section at the start of the script you can alter to change the labels. This section:             const HITS = 'Erfolge'; const FUMBLES = 'Patzer'; const DICE = 'dice'; const RESULT = 'result'; const CRITICALFAIL = 'Critical Failure'; const FAILURE = 'Failure'; const POSSIBLE = ''; By default, the result line shows only when it is a Failure or Critical Failure, and not its neither a Failure ot Crit Fail. If you want to show something like "Possible Success", just enter that label on the POSSIBLE line, like, say const POSSIBLE = 'Possible Success'; Here's the script. To install it, go to your campaign launch page, click the settings button, select API Scripts, and paste this into the New Script page. give the script a name and save it: // !srdice @{selected|token_name} [[?{Würfelpool}d6]] showdice on('ready', () => { on('chat:message', (msg) => { if ('api' === msg.type && msg.content.startsWith('!srdice')) { const HITS = 'Erfolge'; const FUMBLES = 'Patzer'; const DICE = 'dice'; const RESULT = 'result'; const CRITICALFAIL = 'Critical Failure'; const FAILURE = 'Failure'; const POSSIBLE = ''; const args = msg.content.split(/\s+/); const token = args[1] || ''; const showdice = args[3] || 0; let hits = 0; let fumbles = 0; let dice = []; (msg.inlinerolls || []).forEach(r => { ((r.results || {}).rolls || []).forEach(r2 => { (r2.results || []).forEach(r3 => { hits += ((r3.v || 0) >= 5 ? 1 : 0); fumbles += ((r3.v || 0) === 1 ? 1 : 0); dice.push(r3.v || 0); }); }); }); //const result = (hits === 0 && fumbles > 0) ? CRITICALFAIL : (fumbles > (dice.length/2) ? FAILURE : POSSIBLE); let result = POSSIBLE; if(hits === 0 && fumbles > 0) result = CRITICALFAIL; else if(fumbles > (dice.length/2)) result = FAILURE; let output = `&{template:default} {{name=${token}}} `; if(showdice) output += `{{${DICE}=${dice.join(' ')} }} `; output += `{{${HITS}=${hits}}} `; if(fumbles > 0) output += `{{${FUMBLES}=${fumbles} }} `; if(result) output += `{{${RESULT}=${result}}} `; sendChat('', output); } }); }); Credit goes to The Aaron for the dice counting part of the script. If you want the script tweaked, let me know.
1561918222

Edited 1561918343
Dude, you're awesome! (Assuming you're a dude?) But there seems to be a bit of a misunderstanding... But it was I who had it wrong when explaining it! A failure (or glitch, as they call it in the rule book) only occurs when more than half the dice rolled a 1. The failure only get a crit fail when there are no hits in addition to more than half failures. if(hits === 0 && fumbles > (dice.length/2)) result = CRITICALFAIL; else if(fumbles > (dice.length/2)) result = FAILURE; But I think I managed to understand and alter your code, so now it should work. Again, thank you for your kindness. Whenever there are dice rolled while Beauty, Geist, Eis, Rotor, Noise, Malenky and Saint are roaming the shadows of Frankfurt Megaplex, your name will be praised! Did I mentoin that you're awesome?
1561923398
GiGs
Pro
Sheet Author
API Scripter
Hehe, thank you! I did think those failure odds were a little weird, that way sounds much more reasonable. I''m glad you got it sorted! 
1561925960
vÍnce
Pro
Sheet Author
Werner said: Dude, you're awesome! (Assuming you're a dude?) ... Did I mentoin that you're awesome? Understatement.  ;-)