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

[HELP] Ability Command Button in Repeating Section?

1520132934
Finderski
Pro
Sheet Author
Compendium Curator
I'm trying to have a button that outputs a skill roll and a command button to roll damage for the weapon selected, and seem to be having problems and can't see why... :-/ Button: <button class="sheet-spellButton sheet-spellcaster" type='roll' name="roll_DSpellRoll" value="&{template:tr_dmg_roll} @{rolltSpellcasting} @{DSpellButton}"></button> rolltSpellcasting: <input type='hidden' name='attr_rolltSpellcasting' value='{{name=@{character_name}}} {{trait=Spellcasting}} {{skill_rank=@{spellcastingScore}}} {{skill_roll=[[@{speDiceScore}[Spellcasting] + @{ModSum}[Trait Test Modifiers, Wounds, Fatigue]]]}} {{mook=[[1d0+@{wdNum}]]}} {{wild_die=[[ [[@{wdNum}]]d@{wilddie}! + @{SpellcastingMod}[Spellcasting Rank Modifier] + @{ModSum}[Trait Test Modifiers, Wounds, Fatigue] ]] }}' /> DSpellButton <input type="hidden" name="attr_DSpellButton" value="{{DmgRoll=[Roll Damage](~DSpellDmgRoll) }}" /> When I roll the button, I get the following: The Ability button is missing information...note, it doesn't close with: "DSpellDmgRoll)" If press the up arrow in the chat window I get: &{template:tr_dmg_roll} @{Exydor the Hobbled|rolltSpellcasting} {{DmgRoll=[Roll Damage](~-L3-k6Kpgu-z5s4iuor3|repeating_dmgspells_-L64x815NKTTMWV1g6wZ_ }} When I manually edit it to be: &{template:tr_dmg_roll} @{Exydor the Hobbled|rolltSpellcasting} {{DmgRoll=[Roll Damage](~-L3-k6Kpgu-z5s4iuor3|repeating_dmgspells_-L64x815NKTTMWV1g6wZ_DSpellDmgRoll) }} everything works perfectly... So...why is the end of the command getting cut off? Any ideas what I'm doing wrong? Thanks for any help.
1520141514
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Are ability command buttons supposed to automatically parse the repeating section information and character id in? I didn't think that was how they worked, although it's obviously doing at least a partial job.
1520262807
Finderski
Pro
Sheet Author
Compendium Curator
So, apparently, all I had to do was this: <input class="sheet-hidden" type="textarea" name="attr_DSpellButton" value="{{DmgRoll=[Roll Damage](~repeating_dmgspells_DSpellDmgRoll) }}" /> I've never had to use "repeating_<section name>_<field name>" in a repeating section that refers to fields within itself before, so...that took me longer than it should have to solve, but for anyone else wanting to do something similar...there you go. :)
Finderski said: I've never had to use "repeating_<section name>_<field name>" in a repeating section that refers to fields within itself before, so...that took me longer than it should have to solve, but for anyone else wanting to do something similar...there you go. :) The reason for this is where this button will appear. Since it will be shown in the chat window, the specific reference is needed. If it were only on the character sheet, the local reference (without the repeating_<section name>) will suffice.
1520263638
vÍnce
Pro
Sheet Author
How does the button know which DSpellDmgRoll value to use?  Does it automatically add the rowID? 
1520264002

Edited 1520264011
Finderski
Pro
Sheet Author
Compendium Curator
Vince, it does.  The only way I figured that out was by using sheetworkers and console.logs.  Took forever. :-/
1520264156
vÍnce
Pro
Sheet Author
That's nice to know.  Thanks