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

Repeating Sections and Token Actions

1444776796

Edited 1444778239
Kiyomi N.
Sheet Author
In a further attempt to exceed my own expectations (or drive myself utterly mad) I have begun to experiment with repeating sections. I have laid out my full code below for a section that is meant to be repeatable and while it works fine up to this point is my question is, using Abilities and Token Actions, how can I get it to roll a particular macro once I begin to add multiple items to a repeatable section? How does it know which row to pull from? I can't find any details information documented on this. &{template:5eDefault} {{actionshowinfo=1}} {{title=@{action_name}}} {{subheader=@{character_name}}} {{subheaderright=@{action_type}}} {{actiontarget=@{actiontarget}}} {{actionmpcost=@{actionmpcost}}} {{actioncharge=@{actionct}}} {{actionrange=@{actionrange}}} {{actionaoe=@{actionaoe}}} {{actionvertical=@{actionvertical}}} {{target=@{target|token_name}}} {{emote=@{action_description}}} @{actionmacrooptions} This is my roll Macro.             <fieldset class="repeating_npcactions">     <div class="sheet-npc-row">         <div class="sheet-row">             <div class="sheet offset-1-12 sheet-col-1-2 sheet-center sheet-small-label sheet-vert-bottom">Name</div>             <div class="sheet-col-1-6 sheet-center sheet-small-label sheet-vert-bottom">Action Type</div>             <div class="sheet-col-1-12 sheet-offset-1-12 sheet-center sheet-small-label sheet-vert-bottom">Macro</div>         </div>                      <div class="sheet-row">             <div class="sheet offset-1-12 sheet-col-1-2 sheet-center"><input type="text" class="sheet-center" name="attr_action_name"></div>             <div class="sheet-col-1-6">                 <select name="attr_action_type">                     <option value="(Attack Action) " selected="selected">Attack Action</option>                     <option value="(Action Ability) ">Action Ability</option>                     <option value="(Job Ability) ">Job Ability</option>                     <option value="(Spell Action) ">Spell</option>                     <option value="(Support Ability) ">Support Ability</option>                     <option value="(Reaction) ">Reaction</option>                 </select>             </div>             <div class="sheet-col-1-12 sheet-offset-1-12 sheet-center"><button type="roll" class="sheet-roll" name="roll_Action" value= "&{template:5eDefault} {{actionshowinfo=1}} {{title=@{action_name}}} {{subheader=@{character_name}}} {{subheaderright=@{action_type}}} {{actiontarget=@{actiontarget}}} {{actionmpcost=@{actionmpcost}}} {{actioncharge=@{actionct}}} {{actionrange=@{actionrange}}} {{actionaoe=@{actionaoe}}} {{actionvertical=@{actionvertical}}} {{target=@{target|token_name}}} {{emote=@{action_description}}} @{actionmacrooptions}" >Use</button></div>                      </div>                  <div class="sheet-row">             <div class="sheet-col-1-6 sheet-vert-bottom sheet-small-label sheet-offset-1-6">Target</div>             <div class="sheet-col-1-12 sheet-vert-bottom sheet-center sheet-small-label">MP Cost</div>             <div class="sheet-col-1-12 sheet-vert-bottom sheet-center sheet-small-label">CT</div>             <div class="sheet-col-1-12 sheet-vert-bottom sheet-center sheet-small-label">Range</div>             <div class="sheet-col-1-12 sheet-vert-bottom sheet-center sheet-small-label">AOE</div>             <div class="sheet-col-1-12 sheet-vert-bottom sheet-center sheet-small-label">Vertical</div>         </div>                  <div class="sheet-row">             <div class="sheet-col-1-6 sheet-offset-1-6">                 <select name="attr_actiontarget">                     <option value="Not set" selected="selected">---</option>                     <option value="Self">Self</option>                     <option value="Enemy">Enemy</option>                     <option value="Ally">Ally</option>                     <option value="Unfocused">Unfocused</option>                     <option value="All">All</option>                     <option value="RandomS">Random Enemy</option>                     <option value="RandomG">Random Ally</option>                     <option value="RandomU">Random Unfocused</option>                 </select>             </div>             <div class="sheet-col-1-12"><input type="number" name="attr_actionmpcost" value="0" min="0" step="1"/></div>             <div class="sheet-col-1-12"><input type="number" name="attr_actionct" value="0" min="0" step="1"/></div>             <div class="sheet-col-1-12"><input type="number" name="attr_actionrange" value="0" min="0" step="1"/></div>             <div class="sheet-col-1-12"><input type="number" name="attr_actionaoe" value="0" min="0" step="1"/></div>             <div class="sheet-col-1-12"><input type="number" name="attr_actionvertical" value="0" min="0" step="1"/></div>         </div>                  <div class="sheet-row">             <div class="sheet-col-5-12 sheet-offset-1-12 sheet-center sheet-small-label sheet-vert-bottom">Description</div>             <div class="sheet-col-5-12 sheet-center sheet-small-label sheet-vert-bottom">Effect</div>         </div>                  <div class="sheet-row sheet-padb sheet-spell-macro-output-options">                     <div class="sheet-col-1-8 sheet-vert-middle sheet-small-label sheet-padl">Macro Display Options</div>                     <div class="sheet-col-1-12 sheet-center sheet-small-label">Attack Roll<br/><input type="checkbox" name="attr_actionshowattack" value="{{actionshowattack=1}} {{actionattack=@{actionattackroll}}}" /></div>                     <div class="sheet-col-1-12 sheet-center sheet-small-label">Threshold<br/><input type="checkbox" name="attr_actionshowthreshold" value="{{actionshowthreshold=1}} {{actionthreshold=@{actionthreshold}}}" /></div>                     <div class="sheet-col-1-12 sheet-center sheet-small-label">Healing<br/><input type="checkbox" name="attr_actionshowhealing" value="{{actionshowhealing=1}} {{actionhealing=@{healmacro}}}" /></div>                     <div class="sheet-col-1-12 sheet-center sheet-small-label">Damage<br/><input type="checkbox" name="attr_actionshowdamage" value="{{actionshowdamage=1}} {{actiondamage=@{actiondamage} @{actiondamagetype}}}" /></div>                     <div class="sheet-col-1-12 sheet-center sheet-small-label">Effect 1<br/><input type="checkbox" name="attr_actionshoweffect1" value="{{actionshoweffect1=1}} {{actioneffectname1=@{actioneffectname1}}} {{actioneffectduration1=@{actioneffectduration1}}} {{actioneffectcos1=@{actioneffect1}}} {{actioneffectroll1=[[1d100]]}}" /></div>                     <div class="sheet-col-1-12 sheet-center sheet-small-label">Effect 2<br/><input type="checkbox" name="attr_actionshoweffect2" value="{{actionshoweffect2=1}} {{actioneffectname2=@{actioneffectname2}}} {{actioneffectduration2=@{actioneffectduration2}}} {{actioneffectcos2=@{actioneffect2}}} {{actioneffectroll2=[[1d100]]}}" /></div>                     <div class="sheet-col-1-12 sheet-center sheet-small-label">Effect 3<br/><input type="checkbox" name="attr_actionshoweffect3" value="{{actionshoweffect3=1}} {{actioneffectname3=@{actioneffectname3}}} {{actioneffectduration3=@{actioneffectduration3}}} {{actioneffectcos3=@{actioneffect3}}} {{actioneffectroll3=[[1d100]]}}" /></div>                     <div class="sheet-col-1-12 sheet-center sheet-small-label">Effect 4<br/><input type="checkbox" name="attr_actionshoweffect4" value="{{actionshoweffect4=1}} {{actioneffectname4=@{actioneffectname4}}} {{actioneffectduration4=@{actioneffectduration4}}} {{actioneffectcos4=@{actioneffect4}}} {{actioneffectroll4=[[1d100]]}}" /></div>                     <div class="sheet-col-1-12 sheet-center sheet-small-label">Effect 5<br/><input type="checkbox" name="attr_actionshoweffect5" value="{{actionshoweffect5=1}} {{actioneffectname5=@{actioneffectname5}}} {{actioneffectduration5=@{actioneffectduration5}}} {{actioneffectcos5=@{actioneffect5}}} {{actioneffectroll5=[[1d100]]}}" /></div>                     <input type="hidden" name="attr_actionmacrooptions" value="@{actionshowattack} @{actionshowthreshold} @{actionshowhealing} @{actionshowdamage} @{actionshoweffect1} @{actionshoweffect2} @{actionshoweffect3} @{actionshoweffect4} @{actionshoweffect5}" />                 </div>                                  <span class="sheet-spacer"></span>                 <span class="sheet-small-label">Show :</span>                 <input type="checkbox" name="attr_spelltypeadvanced" class="sheet-spelltypetab sheet-spelltypeadvanced" value="1"/><span class="sheet-spelltypetab sheet-spelltypeadvanced">Description</span> |                 <input type="checkbox" name="attr_spelltypeattack" class="sheet-spelltypetab sheet-spelltypeattack" value="1"/><span class="sheet-spelltypetab sheet-spelltypeattack">Attack</span> |                 <input type="checkbox" name="attr_spelltypeheal" class="sheet-spelltypetab sheet-spelltypeheal" value="1"/><span class="sheet-spelltypetab sheet-spelltypeheal">Healing</span> |                 <input type="checkbox" name="attr_spelltypdamage" class="sheet-spelltypetab sheet-spelltypedamage" value="1"/><span class="sheet-spelltypetab sheet-spelltypedamage">Damage</span> |                 <input type="checkbox" name="attr_spelltypeeffects" class="sheet-spelltypetab sheet-spelltypeeffects" value="1"/><span class="sheet-spelltypetab sheet-spelltypeeffects">Effects</span>                 <span class="sheet-spacer"></span>                          <div class="sheet-spell-type-advanced">                     <div class="sheet-row">                         <div class="sheet-col-1-2 sheet-vert-bottom sheet-center sheet-small-label">Action Description/Flavour</div>                         <div class="sheet-col-1-2 sheet-vert-bottom sheet-center sheet-small-label">Action Mechanics</div>                     </div>                                          <div class="sheet-row">                         <div class="sheet-col-1-2 sheet-small-label sheet-center"><textarea class="sheet-medium-textarea" name="attr_action_description"></textarea></div>                         <div class="sheet-col-1-2 sheet-small-label sheet-center"><textarea name="attr_action_mechanics1" class="sheet-medium-textarea"></textarea></div>                     </div>                 </div>                                  <div class="sheet-spell-type-attack">                                      <div class="sheet-row">                         <div class="sheet-col-1-3 sheet-offset-1-12 sheet-vert-bottom sheet-center sheet-small-label">Attack Macro</div>                         <div class="sheet-col-1-2 sheet-vert-bottom sheet-center sheet-small-label">Threshold Macro</div>                     </div>                                                  <div class="sheet-row">                         <div class="sheet-col-1-3 sheet-offset-1-12 sheet-padr sheet-border-right"><input type="text" class="sheet-center" name="attr_actionattackroll" value="None"></div>                         <div class="sheet-col-1-2 sheet-padl"><input type="text" class="sheet-center" name="attr_actionthreshold" value="None"></div>                     </div>                 </div>                                  <div class="sheet-spell-type-heal">                     <div class="sheet-row">                         <div class="sheet-col-1-2 sheet-offset-1-4 sheet-vert-bottom sheet-center sheet-small-label">Heal Macro</div>                     </div>                                                  <div class="sheet-row">                         <div class="sheet-col-1-2 sheet-offset-1-4 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_healmacro" value="None"></div>                     </div>                 </div>                                  <div class="sheet-spell-type-damage">                     <div class="sheet-row">                         <div class="sheet-offset-1-12 sheet-col-1-12 sheet-vert-bottom sheet-center sheet-small-label">Can Crit?</div>                         <div class="sheet-col-1-2 sheet-vert-bottom sheet-center sheet-small-label">Damage Macro</div>                         <div class="sheet-col-1-4 sheet-vert-bottom sheet-center sheet-small-label">Damage Type</div>                     </div>                                                  <div class="sheet-row">                         <div class=" sheet-offset-1-12 sheet-col-1-12 sheet-checkbox-row"><input type="checkbox" name="attr_actioncancrit" value="1"/></div>                         <div class="sheet-col-1-2 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actiondamage" value="Nome"></div>                         <div class="sheet-col-1-4 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actiondamagetype" value="None"></div>                     </div>                 </div>                                      <div class="sheet-spell-type-effects">                     <div class="sheet-row">                         <div class="sheet-offset-1-12 sheet-col-1-4 sheet-vert-bottom sheet-center sheet-small-label">Name</div>                         <div class="sheet-col-1-2 sheet-vert-bottom sheet-center sheet-small-label">Effect CoS Macro</div>                         <div class="sheet-col-1-12 sheet-vert-bottom sheet-center sheet-small-label">Duration</div>                     </div>                                                  <div class="sheet-row">                         <div class="sheet-offset-1-12 sheet-col-1-4 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffectname1" value="None"></div>                         <div class="sheet-col-1-2 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffect1" value="None"></div>                         <div class="sheet-col-1-12 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffectduration1" value="∞"></div>                     </div>                     <div class="sheet-row">                         <div class="sheet-offset-1-12 sheet-col-1-4 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffectname2" value="None"></div>                         <div class="sheet-col-1-2 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffect2" value="None"></div>                         <div class="sheet-col-1-12 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffectduration2" value="∞"></div>                     </div>                     <div class="sheet-row">                         <div class="sheet-offset-1-12 sheet-col-1-4 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffectname3" value="None"></div>                         <div class="sheet-col-1-2 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffect3" value="None"></div>                         <div class="sheet-col-1-12 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffectduration3" value="∞"></div>                     </div>                     <div class="sheet-row">                         <div class="sheet-offset-1-12 sheet-col-1-4 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffectname4" value="None"></div>                         <div class="sheet-col-1-2 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffect4" value="None"></div>                         <div class="sheet-col-1-12 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffectduration4" value="∞"></div>                     </div>                     <div class="sheet-row">                         <div class="sheet-offset-1-12 sheet-col-1-4 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffectname5" value="None"></div>                         <div class="sheet-col-1-2 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffect5" value="None"></div>                         <div class="sheet-col-1-12 sheet-small-label sheet-center"><input type="text" class="sheet-center" name="attr_actioneffectduration5" value="∞"></div>                     </div>                 </div>     </div> </fieldset>
I'm no expert, but as far as I know you can't call a repeating section roll with a token action.
This is... very disheartening. There has to be a workaround for this. Does anyone have any suggestions or tips?
Please support: <a href="https://app.roll20.net/forum/post/1240016/official" rel="nofollow">https://app.roll20.net/forum/post/1240016/official</a>...
+1. Though I've read that the Pathfinder Sheet Author managed to do this somehow. I need to study his sheet I guess.
1444782352

Edited 1444783946
Kiyomi N.
Sheet Author
I don't understand what he did at all... but I figured out that we can call attributes using repeating_sectionname_X_ so at least that gives me something to work with for now.
Yes, the attributes themselves can be called @{repeatingthing|attribute} but not the roll, now if you code the functions of the roll into the attribute then you can get around the limmitaton.&nbsp;
1444804576
vÍnce
Pro
Sheet Author
Kiyomi N. said: I don't understand what he did at all... but I figured out that we can call attributes using repeating_sectionname_X_ so at least that gives me something to work with for now. You can't "pull" the sheet roll from a repeating item and you can't call any auto-calculated attributes used in a repeating item. &nbsp;You can "re-create" the auto-calculated attributes by using the individual repeating attributes in your formula/math. &nbsp;Makes for some HUGE ability/token macros since you have to include the formula and the long attribute names... ie repeating_item_X_foo_foo
1444840311

Edited 1444841109
Kiyomi N.
Sheet Author
So for example Vince, part of my repeating section includes an attr &lt;input type="hidden" name="attr_actionmacrooptions" value="@{actionshowattack} @{actionshowthreshold} @{actionshowhealing} @{actionshowdamage} @{actionshoweffect1} @{actionshoweffect2} @{actionshoweffect3} @{actionshoweffect4} @{actionshoweffect5}" /&gt; Which is later called in the roll within that repeating section. It's the only part that's not working now in my token macro &{template:5eDefault} {{actionshowinfo=1}} {{title=@{repeating_npcactions_0_action_name}}} {{subheader=@{character_name}}} {{subheaderright=@{repeating_npcactions_0_action_type}}} {{actiontarget=@{repeating_npcactions_0_actiontarget}}} {{actionmpcost=@{repeating_npcactions_0_actionmpcost}}} {{actioncharge=@{repeating_npcactions_0_actionct}}} {{actionrange=@{repeating_npcactions_0_actionrange}}} {{actionaoe=@{repeating_npcactions_0_actionaoe}}} {{actionvertical=@{repeating_npcactions_0_actionvertical}}} {{target=@{target|token_name}}} {{emote=@{repeating_npcactions_0_action_description}}} @{repeating_npcactions_0_actionmacrooptions} @{repeating_npcactions_0_actionmacrooptions} So this bit can't grab the values from @{actionshowattack}, @{actionshowthreshold}, etc? I have to put those in manually? Ugh and @{repeating_npcactions_0_actionshowattack} won't be able to calculate and pull {{actiondamage=@{actiondamage} @{actiondamagetype}}}. I'm using a macro with checkboxes that allows the player (or GM) to elect whether attack roll, threshold, damage, healing, status effect, etc are supposed to show up in chatbox. &lt;div class="sheet-col-1-12 sheet-center sheet-small-label"&gt;Damage&lt;br/&gt;&lt;input type="checkbox" name="attr_actionshowdamage" value="{{actionshowdamage=1}} {{actiondamage=@{actiondamage} @{actiondamagetype}}}" /&gt;&lt;/div&gt; This is awful. We really need this fixed somehow :/
1444852532
Kryx
Pro
Sheet Author
API Scripter
Kiyomi N. said: This is awful. We really need this fixed somehow :/ Welcome to our reality and why progress on my sheet is basically at a stand still. That and the more attributes (spells) = terrible lag issue.
1444855199
vÍnce
Pro
Sheet Author
We've added some features on the PF sheet that only work within a repeating item and have added a "limited" version of the feature for non-repeating macros. &nbsp;It's confusing for the end-user and a pain to maintain. &nbsp;Really hoping that something can be done to make repeating items behave like other attributes on the sheet.
1445020996

Edited 1445021007
Kiyomi N.
Sheet Author
Have you ever run into this problem while using repeating items? While it doesn't appear to effect any functionality as far as I can tell, whenever I click the add, modify, or done buttons I get this little popup in the top left of my screen that says " Please select a valid value. The two nearest valid values are between 1 and 2. " Again it doesn't seem to cause any actual issues, and it doesn't seem to be caused by my code because I use the exact same code in another part of my sheet and it works fine. (Also I've tried removing sections of my code to see if it was anything I wrote but after going through the entire thing the problem still occurs.) It definitely has to do with the buttons themselves, any idea what might be causing it? I'm using Firefox Version 41.0.2 if that makes a difference.
1445022004
vÍnce
Pro
Sheet Author
Never seen that. &nbsp;Does that happen in Chrome as well?
1445022792

Edited 1445024222
Kiyomi N.
Sheet Author
I haven't tried Chrome yet, one sec. Well I could only test it on my mobile but it doesn't seem to happen on other browsers. I'm going to try and clear my cache and try again. Yeah it's still happening on my desktop, weird. I just hope it doesn't cause problems for me later. I had someone else test in on their Chrome based desktop and they said they didn't see anything either. Hrmm...