
First of all, the code works.
Second I don't understand how and I need some help here. Hopefully, it will be helpful for others cause I didn't see this feature explained in any wiki or documentation.
I am working on fixing someone else table, but they already did an incredible job. I understand in general how the code works (and I've been able to change it) but now why.
They created a nested table. In practice you roll for see if the roll succeded, and then you can roll on the damage.
The button html
<!-- Button you see --> <button class="dicefontd10" name="weapon" type="roll" title="weapon roll" value="@{gm_toggle} &{template:rolls} {{header=@{weapons}}} {{subheader=@{skill_percent}}} {{dice=[[1d100]]}} {{damage=^{damage} [@{damage}](~repeating_weapons_damage)}} {{lethality=^{lethality} [@{lethality}](~repeating_weapons_lethality)}} {{lethality_rating=^{lethality_percent} [@{lethality_percent}](~repeating_weapons_lethality_percent)}}">k</button> <!-- Nested button for both normal and lethal damage --> <button class="none" name="roll_damage" type="roll" value="@{gm_toggle} &{template:damage} {{header=@{weapons}}} {{subheader=@{damage}}} {{damage=[[@{damage}]]}}"></button> <button class="none" name="roll_lethality" type="roll" value="@{gm_toggle} &{template:lethality} {{header=@{weapons}}} {{lethality_rating=@{lethality_percent}}} {{lethality=[[@{lethality}]]}}"></button>The rolltemplate code
<!-- Template of the rolls --> <div class="rolltemplates"> <rolltemplate class="sheet-rolltemplate-rolls"> <div class="sheet-template-container">{{#header}} <div class="sheet-template-header"> <h1>{{header}} </h1> <h2>{{#subheader}}({{subheader}}%){{/subheader}}</h2> </div>{{/header}} <div class="sheet-template-body">{{#dice}} <div class="sheet-template-row"><span class="inlinerollresult">{{dice}}</span><span class="percent">%</span></div>{{/dice}} <!-- if damage exists, show the damage button --> {{#damage}} <div class="sheet-template-row"> <span class="inlinerollresult">{{damage}}</span></div>{{/damage}} <!-- if lethality exists, show the lethality button --> {{#lethality_rating}} <div class="sheet-template-row"> <span class="inlinerollresult">{{lethality}}</span></div>{{/lethality_rating}} {{#desc}} <div class="sheet-template-row"><span class="sheet-template-desc">{{desc}}</span></div>{{/desc}} </div> </div> </rolltemplate> </div>
<!-- template for damage, I need to make some comparison so it uses a different template <div class="rolltemplates"> <rolltemplate class="sheet-rolltemplate-damage"> <div class="sheet-template-container">{{#header}} <div class="sheet-template-header"> <h1>{{header}} </h1> <h2>{{#subheader}}({{subheader}}){{/subheader}}</h2> </div>{{/header}} <div class="sheet-template-body">{{#dice}} <div class="sheet-template-row"><span class="inlinerollresult">{{dice}}</span><span class="percent">%</span></div>{{/dice}} {{#damage}} <div class="sheet-template-row"> <span class="inlinerollresult">{{damage}}</span></div>{{/damage}} {{#desc}} <div class="sheet-template-row"><span class="sheet-template-desc">{{desc}}</span></div>{{/desc}} </div> </div> </rolltemplate> </div>
<!-- template for lethality --> <div class="rolltemplates"> <rolltemplate class="sheet-rolltemplate-lethality"> <div class="sheet-template-container">{{#header}} <div class="sheet-template-header"> <h1>{{header}} </h1> <h2>({{lethality_rating}}%)</h2> </div>{{/header}} <div class="sheet-template-body"> <div class="sheet-template-row"><span class="inlinerollresult">{{lethality}}</span><span class="percent">%</span></div> </div> </div> </rolltemplate>The sheet

The output
I suspect it has to do with this command in the roll template:
{{damage=^{damage} [@{damage}](~repeating_weapons_damage)}}
But I never seen it before so I'm not sure what it is supposed to do. In particular
1) what ^{<attribute_name} is supposed to do in this call?
2) do I need the (~repeating_weapons_damage) in the call? What is it supposed to do3) notice the single bracket to pass it as a variable to roll instead of a roll
4) Why the other two buttons don't show up?
Thanks for the help