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

Hide/Reveal inline roll in a roll template? (as done in the 5e D&D sheet by Roll20)

1474230836
Axel
Pro
Sheet Author
I'd really like to know how the 5e D&D sheet by Roll20 manages to hide and then reveal (with a click on the template) the damage roll of an attack. I've checked the code, but it seems to me that there are scripts involved, and I can't make heads or tails it. It that how it's done? How can I recreate that effect?
1474233583

Edited 1474233809
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
From using it, and looking at what is logged if you log the chat messages in the API, it is actually two macros. The first one uses the &{template:atk} template and then the ability command button that is created for the name of the attack calls a macro that uses &{template:dmg}. The atk template formats inline rolls so that they look like hyperlink text rather than giant pink squares of crazy. These templates have been formatted to create the appearance that you are revealing the roll when in fact you are just calling another macro. It's very apparent if someone sends a chat message in between you rolling your attack and rolling your damage or if you wind up at the end of the 5 message limit before re-outputting your chat handle