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

Spoiler in Roll Template

1558638738

Edited 1558792546
Loki
Sheet Author
Hi, currently the roll template for ability checks in my character sheet rolls the attack roll and the damage roll at the same time. To minimize meta-gaming (because players see: "oh that's a crappy damage roll, i will not invest in this attack roll") I want to create a "spoiler" button that some forums use that allow to only read the text inside if you click a little button and per default hides the text. I want to hide that damage roll unless the player explicitly clicks a button (or something else) to show the damage roll. I imagine it's possible because the Roll Template is basically plain HTML. But how can I achieve it? This is how my roll template looks atm: <rolltemplate class="sheet-rolltemplate-splittermond_generic"> <table class="sheet-rolltemplate-table-generic"> <tr><th colspan="2" class="sheet-header" align="center"><b>{{charactername}}</b></th></tr> <tr><td colspan="2" class="sheet-header" align="center">{{name}}</td></tr> {{#allprops() name charactername}} <tr><td width="90%"><b>{{key}}</b></td><td width="10%" align="center"><b>{{value}}</b></td></tr> {{/allprops() name charactername}} {{#rollGreater() Probe schwierigkeit}} <tr><td colspan="2" class="sheet-header" align="center" style="color:#298A08;">Gelungen!</td> {{/rollGreater() Probe schwierigkeit}} {{#rollLess() Probe schwierigkeit}} <tr><td colspan="2" class="sheet-header" align="center" style="color:#DF0101;">Misslungen!</td> {{/rollLess() Probe schwierigkeit}} {{#rollBetween() Probe schwierigkeit schwierigkeit}} <tr><td colspan="2" class="sheet-header" align="center" style="color:#298A08;">Gelungen!</td> {{/rollBetween() Probe schwierigkeit schwierigkeit}}     [...] </rolltemplate> I think I'd have to get rid of {allprops} because I want to treat the damage roll differently? And how to I achieve the CSS, if it's possible?  Something with "display:none;"? I am grateful for any hint! Loki
1558640135

Edited 1558640234
Try passing the damage to an attribute on the character sheet. Instead of displaying the damage with the attack roll place a button to another macro that posts the damage into chat. This can also be whispered to the GM so he or she knows when the damage has been displayed, sort of a attack roll confirm button.
1558640534
Gen Kitty
Forum Champion
Maaaaybe &lt;details&gt;&lt;/details&gt; would work here?&nbsp; It generates a 'click to expand/retract' area in a webpage.&nbsp; More information here: <a href="https://www.w3schools.com/tags/tag_details.asp" rel="nofollow">https://www.w3schools.com/tags/tag_details.asp</a> Please note, I have no idea if this will work.
This thread talks about a button thing in a roll template.&nbsp; Handy for putting a damage roll or more information on a roll template
The 5E OGL Sheet has an option to hide damage rolls. Why don't you emulate that?
1558792705
Loki
Sheet Author
Thank you for all your replies, I will look into this! Cheers, Loki
1559579828
Loki
Sheet Author
Hi! Now that I had time to look further into this, I have a follow up question (&lt;details&gt; sadly didn't work :-((): Currently the character have the ability called "damageroll" which holds the whole damage roll string, that is constructed via Sheet Helper because it can be a bit complex due to weapon improvements. So we have the string, e.g. {{1d6, 3},{1d6,3},{1d6,3}}k1 assigned to that attribute. Now when I try to submit the button to the roll template: {{Button=[Damage!](!&amp;#13;&amp;#37;{selected|damagerollnsc&amp;#125;)}} I get the result: Loki (GM): Immerdar|damagerollnsc .. the character name followed by the attribute to call. Am I misunderstanding something? Can I only call abilities that are added with the character editor? In the wiki it says:&nbsp; Ability Command Buttons can be used to call Abilities (or sheet button rolls ) from a clickable button in the Text Chat . I want just that: To call a sheet button roll via an Ability Button in a Roll Template. How can I achieve it? Greetings
1559658200
Wes
Sheet Author
I think that the format that you want is: {{button=[Damage!](~damagerollnsc) }} Where "button" is coded into the rolltemplate of the sheet and "damagerollnsc" is a call to the damage button . I have used this in a sheet for re rolling critical success / failure, the code is something like this. &lt;button type="roll" class="stat-roll" value="&amp;{template:darkmaster} {{character-name=@{character_name} }} {{roll-name=Blades}} {{modifier=Rolling with a Modifier of: [[ @{selected_blades_stat_value} [ Brawn or Swiftness ] + @{blades_rank} [ Blades Rank ] + @{blades_vocation_bonus} [ Blades Vocation Bonus ] + @{blades_item_bonus} [ Blades Item Bonus ] + @{blades_special_bonus} [ Blades Special Bonus ] + @{skill_help} [ Skill Assist Bonus ] - @{skill_difficulty} [ Skill Difficulty Modifier ] ]] }} {{skill-roll=Result of: [[ 1d100cs&gt;96cf&lt;5 + [[ @{blades} + @{skill_help} - @{skill_difficulty} ]] [ Total Modifier ] ]] }} {{open-ended-success=[Critical Success Roll Again](~success_roll_blades) }} {{open-ended-failure=[Critical Failure Roll Again](~failure_roll_blades) }}" name="blades" /&gt;&lt;span name="attr_blades"&gt;&lt;/span&gt;&lt;/button&gt; &lt;input type="hidden" name="attr_reroll_success_blades" value="&amp;{template:darkmaster} {{character-name=@{character_name} }} {{roll-name=Blades }} {{modifier=Previous Total of: [[ ?{Previous Roll Total|0} [ Previous Roll ] ]] }} {{skill-roll=Result of: [[ 1d100cs&gt;96cf&lt;0 + ?{Previous Roll Total|0} [ Previous Roll ] ]] }} {{open-ended-success=[Critical Success Roll Again](~success_roll_blades) }}" /&gt; &lt;input type="hidden" name="attr_reroll_failure_blades" value="&amp;{template:darkmaster} {{character-name=@{character_name} }} {{roll-name=Blades }} {{modifier=Previous Total of: [[ ?{Previous Roll Total|0} [ Previous Roll ] ]] }} {{skill-roll=Result of: [[ ?{Previous Roll Total|0} [ Previous Roll ] - 1d100cs&gt;96cf&lt;0 ]] }} {{open-ended-failure=[Critical Success Roll Again](~failure_roll_blades) }}" /&gt; &lt;button type="roll" name="roll_success_roll_blades" style="display: none" value="@{reroll_success_blades}" class="btn ui-draggable"&gt;&lt;/button&gt; &lt;button type="roll" name="roll_failure_roll_blades" style="display: none" value="@{reroll_failure_blades}" class="btn ui-draggable"&gt;&lt;/button&gt; With the template code: {{#skill-roll}} &nbsp;&nbsp;&nbsp;&nbsp;&lt;div class="template-content"&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt;{{skill-roll}}&lt;/span&gt; &lt;/div&gt; {{/skill-roll}} {{#rollWasCrit() skill-roll}} &nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt;{{open-ended-success}}&lt;/span&gt; {{/rollWasCrit() skill-roll}} {{#rollWasFumble() skill-roll}} &nbsp;&nbsp;&nbsp;&nbsp;&lt;span&gt;{{open-ended-failure}}&lt;/span&gt; {{/rollWasFumble() skill-roll}} x
1559733946
Loki
Sheet Author
Hi, Wes. First of all: Thank you for your detailed reply! I tried the syntax as you suggested, but I get: Ok, maybe it's relevant that this is inside a repeating row, but I thought it wouldn't matter. I used the following: &lt;input type="hidden" name="attr_real_damagerollstring" value="[[{{@damagerollnsc}}]]" /&gt; &lt;button type="roll" name="roll_damageroll_nsc" style="display: none" value="@{real_damagerollstring}" class="btn ui-draggable"&gt;&lt;/button&gt; &lt;button type=roll value="&amp;{template:splittermond_generic} [...] {{damage-roll=[Damage!](~damageroll_nsc)}} [...]"&gt;&lt;/button&gt; An input field, a hidden button to just calculate the damage and than I added the hidden button as an ability button to the roll. And in the template: {{#damage-roll}} &lt;tr&gt;&lt;td width="90%"&gt;&lt;b&gt;Schadenswurf&lt;/b&gt;&lt;/td&gt;&lt;td width="10%" align="center"&gt;&lt;b&gt;{{damage-roll}}&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt; {{/damage-roll}} But instead of just printing out the damage (for testing reasons I don't need a template, just the plain numbers) Roll20 prints out the ID, it seems, of the hidden input field attr_damagerollnsc that holds the value. What am I doing wrong?
1559736948

Edited 1559737092
GiGs
Pro
Sheet Author
API Scripter
Buttons cant perform calculations, and you have your first button and the hidden input both pointing to each others values, which wont work. You also mention using a sheet helped (sheet worker?) , but I'm not seeing how that fits in. If its constructed by a sheetworker, it's incompatible with the controls you've listed above (you cant set the value of buttons in code). Edit: i reread the thread from the beginning and misunderstood what you were going for so I've delted my first response here. I'll come back later if no-one else has when i have time.
1559755507

Edited 1559755551
Wes
Sheet Author
Oh the complexities that are our passions to make playing a game easier! I think what you need to do is contained in this post Link to Relevant Post . In any Case Lets do a GiGs' Style Example! HTML Test Case: &lt;div&gt; &lt;fieldset class="repeating_attacks"&gt; &lt;input type="text" name="attr_attack" value="1d20" /&gt; &lt;input type="hidden" name="attr_secret_damage" value="1d10+3" /&gt; &lt;button type="roll" value="&amp;{template:workdangit} {{character-name=@{character_name} }} {{attack=Result of: [[ @{attack} ]] }} {{damage=[Roll Damage](~repeating_attacks_show_damage) }} }}" name="attack" /&gt;Attack&lt;/button&gt; &lt;input type="hidden" name="attr_showing_damage" value="&amp;{template:workdangit} {{character-name=@{character_name} }} {{damage=[[ @{secret_damage} ]] }}" /&gt; &lt;button type="roll" name="roll_show_damage" style="display: none" value="@{showing_damage}" class="btn ui-draggable"&gt;&lt;/button&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;rolltemplate class="sheet-rolltemplate-workdangit"&gt; &lt;div&gt; {{#character-name}} &lt;span&gt;{{character-name}}&lt;/span&gt;&lt;br&gt; {{/character-name}} {{#attack}} &lt;span&gt;{{attack}}&lt;/span&gt;&lt;br&gt; {{/attack}} {{#damage}} &lt;span&gt;{{damage}}&lt;/span&gt; {{/damage}} &lt;/div&gt; &lt;/rolltemplate&gt; • First we have a repeating fieldset with our attack and secret_damage values. &lt;div&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;fieldset class="repeating_attacks"&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type="text" name="attr_attack" value="1d20" /&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;input type="hidden" name="attr_secret_damage" value="1d10+3" /&gt; • Next we add our Attack Roll button it rolls the attack and then calls the damage from a button that is hidden in this same repeating section entry. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;button type="roll" value="&amp;{template:workdangit} {{character-name=@{character_name} }} {{attack=Result of: [[ @{attack} ]] }} {{damage=[Roll Damage](~repeating_attacks_show_damage) }} }}" name="attack" /&gt;Attack&lt;/button&gt; Since we are calling a repeating_section button from outside of the repeating section eg. the chat pane, we have to be more specific in what we are looking for. Using the Syntax&nbsp; "repeating_&lt;section name&gt;_&lt;field name&gt;" or&nbsp; [Roll Damage](~repeating_attacks_show_damage) instead of just&nbsp; "&lt;field name&gt;"&nbsp; [Roll Damage](~show_damage). The parser will also fill in the unique row id in between the&nbsp; "repeating_&lt;section name&gt;_&lt;id&gt;_&lt;field name&gt;" . • Finally the button that we are calling needs to create another chat entry to display its contents this one just precedes the actual damage with the character name again.: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type="hidden" name="attr_showing_damage" value="&amp;{template:workdangit} {{character-name=@{character_name} }} {{damage=[[ @{secret_damage} ]] }}" /&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;button type="roll" name="roll_show_damage" style="display: none" value="@{showing_damage}" class="btn ui-draggable"&gt;&lt;/button&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;/fieldset&gt; &lt;/div&gt; Hope this helps out. Wes
1559820519
Loki
Sheet Author
Hi! Thank you very much - that indeed helped out. In fact I only had to change the "repeating_xy"-stuff. The linked post was very helpful to understand, why. Greetings, Loki
1559830538
GiGs
Pro
Sheet Author
API Scripter
That's very flattering, Wes. Great work :)