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] What is the best workaround to make a repeating field semi-accessible?

1444905416

Edited 1444960063
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
I know that the real answer is that repeating fields are not accessible in any meaningful way. I am hoping somebody could point me towards the best work-arounds. First let me describe what I am trying to do. My Earthdawn character sheet is coming along nicely, but I am finding that during combat we are jumping around way to much. We jump to the Core tab and hit the Initiative button, then we jump to the Talents or the Skills, or Spell tabs to make our attack. Then we jump to the Equipment tab to click the damage button on our Weapon. If somebody attacks us we jump back to the Core tab to check our Physical Defense, our Armor, and our Wound threshold. I would like to put all of this information on one "Combat" tab. This would be duplicate information, I want the information to also be where it currently is, but I also want it to be on the Combat tab. This is no problem, I have almost all the information copied to my new Combat tab. The problem is repeating sections. I can't figure out how to gracefully make this information appear both in a repeating section, and also outside of it. What I want are selected items from my repeating section to also display on my Combat tab. Maybe the 5 or 6 most common actions a player takes in combat. These would need to be chosen by the player. Two things that I tried were <input name="attr_value2test" type="number" value="@{test@{test3test}test}" disabled > <input name="attr_test@{test3test}test" type="number" value="0" disabled > I did not really expect ether to work, since nobody had mentioned using anything like this before, but I did try hopefully. By the way, having one or both of these work would be my A #1 pick for a feature request if they worked with the index number of repeating sections. IE: if you set @{ind} to 5, then @{repeating_group_@{ind}_field} would give you access to @{repeating_group_5_field}. Anyway, that did not work, so now I am looking for a workaround. Idea number two is just have the user enter the information in a 2nd place manually. If worst comes to worst, I guess that is what I will have to do. The combat tab would just be 6 items coded in without a repeating section. The roll buttons could then be moved to the macro bar, etc. My third idea is to have the API copy if for the user. When entering skills and talents, the user could check a box (within a repeating section) if this talent should be copied to the combat tab. On the combat tab would be a button that would give the API the character sheet ID and tell it to look through the repeating section and copy the marked items to the combat screen. It would just be a snapshot of the characters talents when he told it to copy. I have done zero accessing a character sheet from the API, so if anybody can point me towards a particularly good example I would appreciate it. So anyway, those are my ideas. Could somebody please tell me how people solve things like this in the past and what might be suggested? And maybe the best example to learn from? Thank you. 
1444945429

Edited 1444948505
vÍnce
Pro
Sheet Author
Chris D. said: I know that the real answer is that repeating fields are not accessible in any meaningful way.  LOL Anyway, as you have found out, repeating items can be a real pain.  We can't help but be lured by their Siren's call however.   You should be able to display any non-auto-calculated repeating item attribute by using it's long attribute name. ie @{repeating_items_X_foo}  Auto-calc attributes from within a repeating item do not appear to exist outside of the fieldset, so you'll have to recreate any auto-calc formula you need using the long attribute names and doubling the math.  This can cause other issues since you are trying to code for attributes that may not exist yet.  Chicken and Egg quandary. I've been down this path and have had to settle with allowing different levels of functionality on the sheet that hinge on repeating item limitations as well as it's strengths.
1444947910

Edited 1444948373
vÍnce
Pro
Sheet Author
quick example to go with above <div>     <h3>Fieldset Output Test</h3>     <span><input title="{@foo-display}" name="attr_foo-display" type="number" value="@{repeating_items_0_foo}" disabled/><br>Foo</span>     <br>     <span><input title="{@foo2-display}" name="attr_foo2-display" type="number" value="@{repeating_items_0_foo2}" disabled/><br>Foo2</span>     <br>     <span><input title="{@foo3-display}" name="attr_foo3-display" type="number" value="@{repeating_items_0_foo3}" disabled/><br>Foo3</span>     <br>     <span><input title="{@foo-total-display}" name="attr_foo-total-display" type="number" value="@{repeating_items_0_foo-total}" disabled/><br>Foo Total (nothing is displayed because the value is a repeating item auto-calc attribute)</span>     <br>     <span><input title="{@foo-total-manual-display}" name="attr_foo-total-manual-display" type="number" value="(@{repeating_items_0_foo}+@{repeating_items_0_foo2}+@{repeating_items_0_foo3})" disabled/><br>Foo Total Manual (formula redone outside of fieldset)</span>     <br>     <span><input title="{@foo-total_1-manual-display}" name="attr_foo-total_1-manual-display" type="number" value="(@{repeating_items_1_foo}+@{repeating_items_1_foo2}+@{repeating_items_1_foo3})" disabled/><br>Foo Total Manual for next repeating item (nothing displayed because nothing exists until another repeating item is added)</span> </div> <hr> <div>     <fieldset class="repeating_items">         <h3>Repeating Items Input</h3>         <span><input title="@{repeating_items_X_foo}" name="attr_foo" type="number" value="0" /><br>Foo</span>         <br>         <span><input title="@{repeating_items_X_foo2}" name="attr_foo2" type="number" value="0" /><br>Foo2</span>         <br>         <span><input title="@{repeating_items_X_foo3}" name="attr_foo3" type="number" value="0" /><br>Foo3</span>         <br>         <span><input title="@{repeating_items_X_foo-total}" name="attr_foo-total" type="number" value="(@{foo}+@{foo2}+@{foo3})" disabled /><br>Foo Total</span>     </fieldset> </div>
1444961803

Edited 1444962456
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
Thanks for the reply, but I don't see how the solution of using the long attribute name can work, because as a sheet author I have no idea which options of any particular character I am going to want on the combat tab. The Thief might want talents #1 and #4 (because the other talents are not combat talents). The Warrior might want talents #1, #2 and #5. Then the warrior learns two more talents and might want Talent #7 added to his combat tab also. That is why it would be really great if we could somehow supply the repeating index number. IE: <span><input title="@{index} Which repeating foo do you want?" name="attr_index" type="number" value="0" /><br>index</span> <input title="{@foo-display}" name="attr_foo-display" type="number" value="@{repeating_items_@{index}_foo}" disabled/>Foo <input title="{@foo2-display}" name="attr_foo2-display" type="number" value="@{repeating_items_@{index}_foo2}" disabled/>Foo2 That way, if the user sets attr_index to 0, then @{repeating_items_0_foo} and @{repeating_items_0_foo2} appear, but if the user sets attr_index to 1, then @{repeating_items_1_foo} and @{repeating_items_1_foo2} display instead. Like I said, it would be wonderful if it did work like that, but it does not. The two workarounds that I can think of are to have the user enter these talents a 2nd time, which I dislike because of the extra effort and the likelihood for confusion as one area gets updated and the user forgets to update the other. And to give a button where the API copies the information from one section of the character sheet to the other, which I assume will be an acceptable workaround if I can figure out how to do it. So is there any way that I can get a user selected subset of repeating section to appear elsewhere? And if not (as I suspect there is no way), what other workarounds are there, and which work-around would people recommend? Thank you
Chris D. said: So is there any way that I can get a user selected subset of repeating section to appear elsewhere? And if not (as I suspect there is no way), what other workarounds are there, and which work-around would people recommend? If you have a vote, go here.... Check out the Savage Worlds (tabbed).  It uses a super slick "configuration" area that allows the user to select which skills are shown and which are not.  It took me a while, but I figured it out; the short version is that a selector check box is used to determine if a particular is shown in one part of the sheet, and (using a similar technique as Brian's hiding areas found in  this post ) a hidden check box with the same name & value as the selector right close to the area that is being hidden.  Really, just make a test campaign and try that sheet out; its amazing.   Other ideas:  On the Cthulutech sheet I am (still) working on, I have all the skills on one tab.  On the combat tab, I have a "Defense" button next to a drop down.  The button rolls the drop down value, which pulls from the skills.   On the vehicle tab, I have a duplicate of the piloting skill button, so they don't have to switch to another tab just to make a piloting roll.   I also have whole sections of the sheet that are swapped out for when the heroes turn into monsters, using a trick I stole from one of the Vampire sheets.   You can also just have a hide/show button for each talent, but that's not a clean. None of these are repeating sections.
1445013441
Kryx
Pro
Sheet Author
API Scripter
Coal Powered Puppet said: Check out the Savage Worlds (tabbed).  It uses a super slick "configuration" area that allows the user to select which skills are shown and which are not. Nice strategy. I'll move my configuration to my first page on 5e shaped. That'll help a lot.