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] Repeating Sections and Roll Templates?

Forgive me if this is trivial and ridiculous. Reaching the end of my sheet, learning everything as I go and I've finally got my head around making Repeating Sections. Going to just try and keep this as simple as I possibly can to avoid confusion:  W hat I Want To Do:   I've made a repeating section for Spells , all I want to do is click a button (the little top right flame one, in the picture linked) and by doing that send all the information (and a roll) to the roll template I have prepared. I've successfully done this outside of Repeating Sections throughout the sheet already and had no issues linking attributes to buttons and so forth. What I Can't Work Out:   Unlike those times it has now dawned on me that i'm flying blind here. I can't see the values or attributes the Repeating Section is making as more spells/sections are added to the sheet. Not only that,  I can't get my head around how to prepare the value inside the button to receive this information when it changes each time with a new spell. I read the wiki and it mentioned an ABC123 value, and a $0 ID, but my foolish code frazzled head refuses to work out how these work. Do I need to prepare Attribute names with a space or a spot for an ID or value, or is it automatically applied? I can usually get a grip on these things once the first part of the mystery is solved. So any  help will be seriously appreciated. My Code:  <div class='sheet-grid'> <div class='sheet-grid-column'> <label class='sheet-spell-title'>SIGNS, SPELLS & INVOCATIONS</label> <fieldset class="repeating_spells" name='attr_spells'> <span class='repeating_gradient'><input class='repeating_spell_name' type="text" name="attr_spell_name" value='Sign/Spell Name Here' default/></span> <button style='margin-left: -15px; margin-right: 15px;' type='roll' class='repeating_spell_damage_roll' name= 'attr_roll_spell_damage' value='&{template:spell} {{spell-name=attr_spell_name}'></button> <input type="checkbox" checked='true' class="repeating_spell_toggle"><span></span><br /> <div class='repeating_padding_container'> <label class='repeating_spell_type_title'>TYPE</label> <select class='repeating_spell_type' type="text" name="attr_spell_type" /> <option value="Sign">SIGN</option> <option value="Novice">NOVICE</option> <option value="Journeyman">JOURNEYMAN</option> <option value="Master">MASTER</option> <option value="Arch Priest">ARCH PRIEST</option></select> <label class='repeating_spell_sta_title'>STA COST</label><input class='repeating_spell_sta' type='number' name='attr_spell_sta'> <textarea class='repeating_spell_description' name='attr_spell_description'>Spell description goes here...</textarea> <label class='repeating_spell_duration_title'>DURATION</label><input class='repeating_spell_duration' type='text' name='attr_spell_duration'> <label class='repeating_spell_range_title'>RANGE</label><input class='repeating_spell_range' type='text' name='attr_spell_range'> <label class='repeating_spell_damage_title'>DAMAGE</label><input class='repeating_spell_damage' type='text' name='attr_spell_damage'> <label class='repeating_spell_defense_title'>DEFENSE</label><input class='repeating_spell_defense' type='text' name='attr_spell_defense'> </div> </fieldset> </div> </div>
1537222410

Edited 1537222566
vÍnce
Pro
Sheet Author
You don't have to do anything different when the roll originates from within the fieldset. Just use the attribute name without the extra "repeating_spells_..." Also, you don't use attr_foo when calling an attributes value from a macro.  use @{foo}. "attr_foo" is only used to assign a name to an attribute. example; value='&{template:spell} {{spell-name=attr_spell_name}' s/b value='&{template:spell} {{spell-name= @{spell_name}}} '  Don't forget the ending "}}"  I added those as well.
1537222806

Edited 1537222867
Leothedino
Sheet Author
This is absolutely a case of overthinking this. Thanks Vince, I'll give this a go tomorrow (it's late here in the UK). I also found this thread  a half hour ago, I assume it's similar to your advice?
1537225131

Edited 1537225145
Leothedino
Sheet Author
Worked perfect, thanks Vince. I should have played around with it more before I panicked. Cheers man. 
1537232844
vÍnce
Pro
Sheet Author
cool beans