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

How do I show dice roll macro results as an equation in the chat with the yellow box total, without moving the cursor over it to see the equation ?

My home-brew game rules have special effects if people roll a ''hard'' or ''natural'' 1, 2, 19, or 20, on the D20 roll. I figured out that I can write dice macros for skill checks that show the result of the D20+the modifier roll in a nice little yellow box, and if I hover my cursor over the yellow box it will show me the equation below it, though without a total result . Is there a way to write the macro so I can see the equation and result in the chat without moving my cursor over it ? this would be useful so I can quickly see what +# modifier my players added, and what their "hard roll" was before the modifier. /em :&{template:default} {{name=  Skill Check  }}{{ rolls a  [[1d20+?{modifier|0}]] =  for ?{reason|no reason|Acrobatics-Balance|Animal Handling-Farm|Blacksmith-Repair|Body Constitution|Carpentry|Charisma-Charm|Deception|Domestic Crafts-Food-Sewing|Fighting|History-Knowledge-Intelligence|Initiative|Intimidation|Medicine-Potions|Movement|Music|Perception-Investigation|Performance-Acting|religion-Magic|Ride Mount|Sailing|Stealth|Shooting-Ranged Weapons|Strength|Survival-Nature-Fishing  }.}}
Try this: &{template:default} [[ [[1d20]] + [[?{modifier|0}]] ]] {{name= Skill Check }} {{ rolls a $[[0]] + $[[1]]==$[[2]]}} {{for ?{reason|no reason|Acrobatics-Balance|Animal Handling-Farm|Blacksmith-Repair|Body Constitution|Carpentry|Charisma-Charm|Deception|Domestic Crafts-Food-Sewing|Fighting|History-Knowledge-Intelligence|Initiative|Intimidation|Medicine-Potions|Movement|Music|Perception-Investigation|Performance-Acting|religion-Magic|Ride Mount|Sailing|Stealth|Shooting-Ranged Weapons|Strength|Survival-Nature-Fishing  }.}}
1615169444
Andreas J.
Forum Champion
Sheet Author
Translator
The method Ken is using is called Reusing Rolls , if you wanna learn more about it.
Omg thank you Ken that worked great , been trying all day to research commands like this , but no guides list things like what the $ sign code means or any other characters. how come the text in your default template code is not italicized and the background is blue instead or orange? do you got a second to tell me or a link ? does this macro code only apply to roll20 or is a a generic system that works on spread sheets and coding that I never learned? 
1615170459

Edited 1615170629
Andreas J.
Forum Champion
Sheet Author
Translator
The Reusing Rolls , is an emergent property of the roll20 macro system discovered some 10 months ago, and it's unsure how long it have existed. Think the syntax have something to do with API command syntax, wouldn't be the first API-based macro syntax element that can de used outside APIs. That wiki page is the best collections of all the examples and discussions I've found on it, but there are some threads where it have been explored more that I've probably missed. <a href="https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls" rel="nofollow">https://wiki.roll20.net/Complete_Guide_to_Macros_%26_Rolls</a> is the most comprehensive collections on everything related to macros in general.
Thanks Andreas , I have been to that page but it does not have every symbols meanings , I improved on Ken's code a little more and added labels to the out comes. For some reason the TOTAL I added was not in bold so I added stars to **TOTAL** , but I still dont understand why "Rolls a D20" comes out in bold without the ** on each side. Also I still dont understand why the background was blue not orange and no longer Italicized :&amp;{template:default} [[ [[1d20]] + [[?{modifier|0}]] ]] {{name= Skill Check }} {{ Rolls a D20 $[[0]] + $[[1]] Skill Points ==$[[2]] **TOTAL** }} {{for ?{reason|no reason|Acrobatics-Balance|Animal Handling-Farm|Blacksmith-Repair|Body Constitution|Carpentry|Charisma-Charm|Deception|Domestic Crafts-Food-Sewing|Fighting|History-Knowledge-Intelligence|Initiative|Intimidation|Medicine-Potions|Movement|Music|Perception-Investigation|Performance-Acting|religion-Magic|Ride Mount|Sailing|Stealth|Shooting-Ranged Weapons|Strength|Survival-Nature-Fishing&nbsp; }.}}
1615174111

Edited 1615174455
Thanks for the link Andreas. Firewinds - I think the italics part and bold part is part of how the template is built. Anything to the right of the == sign (the $[[2]] in your case) is supposed to just be a die result; where text to the left of the == sign is the label for what is being rolled (and automatically bolded by the template)...default formatting that can't be changed. I'm not sure, but think that is it. Also, as a side note, by doing rolls like this you can refer to them multiple times in the same message. The following macro will put the result of the d20 in the "Rolls a D20" line, and at the end of the second line (after your query output). :&amp;{template:default} [[ [[1d20]] + [[?{modifier|0}]] ]] {{name= Skill Check }} {{ Rolls a D20 $[[0]] + $[[1]] Skill Points ==$[[2]] **TOTAL** }} {{for ?{reason|no reason|Acrobatics-Balance|Animal Handling-Farm|Blacksmith-Repair|Body Constitution|Carpentry|Charisma-Charm|Deception|Domestic Crafts-Food-Sewing|Fighting|History-Knowledge-Intelligence|Initiative|Intimidation|Medicine-Potions|Movement|Music|Perception-Investigation|Performance-Acting|religion-Magic|Ride Mount|Sailing|Stealth|Shooting-Ranged Weapons|Strength|Survival-Nature-Fishing&nbsp; }. $[[0]]}} But as to how it works, I think you make the rolls prior to displaying anything in the chat window roll template (i.e. prior to any template formatting), and can call the result with the $[[X]] reference at any point in the macro (so you can reuse rolls multiple times relying on a specific roll) As a note: this only works within a single macro...AFAIK it will not transfer down to nested macros, or be able to be used outside of that specific macro call for referencing those initial rolls. example: [[ [[1d20]] [[1d12]] [[1d6]] [[1d20]] ]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; would give you 4 die results - $[[0]], $[[1]], $[[2]], and $[[3]] You could do math later with those die results all in the same roll template and same macro. {{ $[[0]] + $[[2]]==$[[4]]}} {{$[[0]] + $[[1]] + $[[3]]==$[[5]]}} {{$[[4]] + $[[5]]==$[[6]]}} Lets say the results were a 13, 8, 3, 9 (for a d20, d12, d6, d20) the next line would equate to (13 + 3 = 16) where $[[4]] = 16 and the next line (13 + 8 = 21) where $[[5]] = 21 and last line (16 + 21 = 37) where $[[6]] =37
Could this be done without the API? so if i wanted to ad a text line to the bottom if the natural D20 result&nbsp; or "$[[0]]"&nbsp; was equal to 1 then display "CRITICAL FAILURE = ROLL DICE OF SHAME ",&nbsp; &nbsp;equal to 2 then display "Attack of Opportunity", equal to 3-18 then display "&nbsp; &nbsp;" , equal to 19 then display "FREE SECOND ACTION", equal to 20 then display "NATURAL 20 = GAME BONUS"&nbsp;
1615204653

Edited 1615204773
David M.
Pro
API Scripter
Ken said: [[ [[1d20]] [[1d12]] [[1d6]] [[1d20]] ]]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; ...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; would give you 4 die results - $[[0]], $[[1]], $[[2]], and $[[3]] You could do math later with those die results all in the same roll template and same macro. {{ $[[0]] + $[[2]]==$[[4]]}}&nbsp; ..etc Just a clarification: you can't actually perform math operations with roll results. Ken is using a trick to "fake" math results with clever use of syntax. @Firewinds: conditional output like that is basically impossible without use of the api. I say "basically" because there is one trick using overwriting of template fields that can provide some limited functionality. However, inline rolls can't be used as overwritten fields so I don't believe what you are describing is possible. With api access, it's not too difficult using something like the scriptcards script or a custom api script.
Thank you You guys are always welcome in one of my games if i ever get my roll20 fully set up, I animated one of the games i played with my friends and you can see it here. if you want to see what my DMing is like <a href="https://youtube.com/playlist?list=PLW8bCYO0w4Tl5MrVcV0l7UREKx05lQXC-" rel="nofollow">https://youtube.com/playlist?list=PLW8bCYO0w4Tl5MrVcV0l7UREKx05lQXC-</a>&nbsp;