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

button in character sheet template

Hello, now I'm doing modify public sheet,  and I just need button in character sheet template, but I can't do this. <div class="sheet-tbody sheet-txt-small"> <fieldset class="repeating_combo"> <div class="sheet-table-item"> <input type="hidden" class="sheet-chk-flip" name="attr_combo_eff_view" value="" /> <div class="sheet-row sheet-row-side"> <div class="sheet-flip"><input type="checkbox" class="sheet-effect-eff-view" name="attr_combo_eff_view" value="1" /></div> <div class="sheet-dic"> <button type="roll" class="sheet-dice" value="&{template:Dx3Dice} @{template_name} {{title=@{combo_repeat_tit}}}{{tim=@{combo_repeat_tim}}} {{subtitle=[ROLL](~act_diceroll)}} {{func=@{combo_repeat_spe}}} {{f_dicetxt=@{combo_repeat_spe}}}{{har=@{combo_repeat_har}}} {{tar=@{combo_repeat_tar}}} {{dis=@{combo_repeat_dis}}} {{reu=@{combo_repeat_reu}}} {{limit=@{combo_repeat_limit}}} {{attack=@{combo_repeat_attack}}} {{material=@{combo_repeat_material}}} {{effect=@{combo_repeat_eff}}}"></button> </div> <div><input type="text" name="attr_combo_repeat_tit" value="" /></div> <div class="sheet-tim"><input type="text" name="attr_combo_repeat_tim" value="" class="sheet-tac"/></div> <div class="sheet-spe"><input type="text" name="attr_combo_repeat_spe" value="" class="sheet-tac"/></div> <div class="sheet-har"><input type="text" name="attr_combo_repeat_har" value="" class="sheet-tac"/></div> <div class="sheet-target"><input type="text" name="attr_combo_repeat_tar" value="" class="sheet-tac"/></div> <div class="sheet-dis"><input type="text" name="attr_combo_repeat_dis" value="" class="sheet-tac"/></div> <div class="sheet-reu"><input type="text" name="attr_combo_repeat_reu" value="" class="sheet-tac" placeholder="0"/></div> <div class="sheet-lim"><input type="text" name="attr_combo_repeat_limit" value="" class="sheet-tac" /></div> <div class="sheet-attack"><input type="text" name="attr_combo_repeat_attack" value="" class="sheet-tac" /></div> </div> <div class="sheet-row-side"> <div class="sheet-th">dice</div> <div class="sheet-custom"> <input type="hidden" name="attr_combo_dice" value="(@{combo_dice_count}+@{add_dice})" disabled="true" readonly/> <input type="number" name="attr_combo_dice_count" value="0" placeholder="0" class="sheet-tac sheet-modify" title="다이스 갯수"> <span>dx</span> <input type="number" name="attr_combo_dice_ciri" value="10" placeholder="10" class="sheet-tac sheet-modify" /> <span>+</span> <input type="number" name="attr_combo_dice_mod" value="0" placeholder="0" class="sheet-tac sheet-modify"/> <button type="action" name="act_diceroll" class="sheet-dice" style="margin-top: 5px !important;" value="&{template:Dx3Dice} @{template_name} {{dxroll=[[(@{rowid-combo_dice}+?{버프값(없을 시 0)})dx@{rowid-combo_dice_ciri}+@{rowid-combo_dice_mod}]]}}"></button> </div> </div> <div class="sheet-flip-item-content"> <input type="text" name="attr_combo_repeat_material" value=""/> <textarea name="attr_combo_repeat_eff"></textarea> </div> </div> </fieldset> </div> </div> </div> </div> this is the code, and I I want to add a button to the template in italics, {{subtitle=[roll](~)}} and when click, the button act_diceroll appears. But I have no idea what to do. How can I make a button?
1689456293

Edited 1689456567
GiGs
Pro
Sheet Author
API Scripter
It looks like you might be confusing the two types of button. There are roll buttons, which print to chat (and run macros), and action buttons, which trigger sheet workers. You have named yours as an action button, but it looks like a roll button. Try this: <button type="roll" name="roll_diceroll" class="sheet-dice" style="margin-top: 5px !important;" value="&{template:Dx3Dice} @{template_name} {{dxroll=[[(@{rowid-combo_dice}+?{버프값(없을 시 0)})dx@{rowid-combo_dice_ciri}+@{rowid-combo_dice_mod}]]}}"></button> You also have a call to your button which has an error in it. You have this: {{subtitle=[ROLL](~act_diceroll)}} That includes the act_ part of the name. Thats like attr_ - it should never be included. So it should be: {{subtitle=[ROLL](~diceroll)}} But also that's going to be printed to chat, and when someone clicks the button, it is going to fail because it doesn't include a character name. It should probably be something like {{subtitle=[ROLL](~@{character_name}|diceroll)}} character_name is an attribute on every character that contains the character sheet's name.
1689456595
vÍnce
Pro
Sheet Author
Question GiGs, can you even activate an action button outside of the character sheet?
1689456644
GiGs
Pro
Sheet Author
API Scripter
This part of your template does raise a question though: &{template:Dx3Dice} @{template_name} Is the @{template_name} part necessary. Should it just be &{template:Dx3Dice} ?
1689456688

Edited 1689456871
GiGs
Pro
Sheet Author
API Scripter
vÍnce said: Question GiGs, can you even activate an action button outside of the character sheet? Good question, but yes you can. You always need to supply a character name. You can't drag an action button to the macro bar, though. There is a work around to have roll buttons that launch action buttons (created by Scott, i think), so you can drag the roll button to the macro bar. That doesn't matter in this case, though, since it's really a roll button.
1689456998
GiGs
Pro
Sheet Author
API Scripter
I just notice an error with that first button. You need to include a name. You have this: <button type="roll" class="sheet-dice" value= It should be <button type="roll" name="roll_something" class="sheet-dice" value=
I did as instructed and the button works. thank you!  And I Fixed everything else too! Thanks again.  TT GiGs said: I just notice an error with that first button. You need to include a name. You have this: <button type="roll" class="sheet-dice" value= It should be <button type="roll" name="roll_something" class="sheet-dice" value=