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 Fieldset Inline "Script-call"

I have a repeating fieldset for my skills, & have the roll button configured as such: "value="@{character_name} executes their @{skill_name}, dealing [[@{skill_dicenum}d@{skill_dietype}]] damage. Since a fieldset auto-creates unique names for each skill tag (e.g. skill_name1, skill_name2, etc.), how can I call upon a specified skill tag in a line (such as the value line above)......... or is this even possible?
1539688431
Finderski
Pro
Sheet Author
Compendium Curator
Need a little clarification...where are you wanting to use these calls?  If it is within the fields itself (like in the button), then each row is self-referential, meaning, what you have above would work.  The tricky part is when you want to reference a field in a repeating set from outside of that row and/or set.
Yeah... I was looking for a method to ref. a repeating field tag outside of the repeating row... but I think I've found a work-around. I'd still be open to suggestions, if you, or anyone else, have any (save for API... trying to avoid that).
1539693116
GiGs
Pro
Sheet Author
API Scripter
First question: do you absolutely need to use a repeating fieldset? Is there a fixed list of skills in DCC? If so, you could just code them all (the way the D&D and many other sheets often do). Second question: what workaround have you found?
Yeah, GG, I need a repeating fieldsets, since my main tab is fairly lengthy as it is (I've inc. almost every function the players need, & the other tabs are for various other events &/or handlers). Using a fieldset allows the players to customize their sheet on an "as needed" basis, without useless "clutter": the game system / mechanic I use is one of my own, & it has a LOT of details. The main tab isn't as bad (e.g. lengthy / cluttered) as it sounds... at least... no worse than any other sheet... but it WOULD be if I'd used a lot of fixed lists. I've used fixed lists where I need specific calcs, & fieldsets where I can get by with inline calcs. :-) As for the "work around", instead of using outside script call-like functions to reference values within the repeating fields, I simply included all the info &/or calcs / rolls the players can use within each fieldset row, to avoid any nasty errors that might crop up later. I'd still be interested if someone knew a clever way to call / ref. tags from outside of a fieldset. ;-)
1539715141
Jakob
Sheet Author
API Scripter
I'd really like to help you, but I have no idea what a tag is. Do you mean something like @{repeating_skills_$0_skill_name} ? (where $0 means "first row", analogously for other rows).
Yeah, Jakob... that was the function I couldn't recall. I was thinking "$" was used before the index number of the row you wanted, but wasn't sure. In any event, I think I have it worked out. I really appreciate your input. As for my term "tag", it is what I've grown accustomed to calling anything which serves as a "unique identifier". I think, in Roll20's case, the correct term would be attr, or "attribute", instead.
1539715423
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Proelium Ex Deus said: Yeah, GG, I need a repeating fieldsets, since my main tab is fairly lengthy as it is (I've inc. almost every function the players need, & the other tabs are for various other events &/or handlers). Using a fieldset allows the players to customize their sheet on an "as needed" basis, without useless "clutter": the game system / mechanic I use is one of my own, & it has a LOT of details. The main tab isn't as bad (e.g. lengthy / cluttered) as it sounds... at least... no worse than any other sheet... but it WOULD be if I'd used a lot of fixed lists. I've used fixed lists where I need specific calcs, & fieldsets where I can get by with inline calcs. :-) As for the "work around", instead of using outside script call-like functions to reference values within the repeating fields, I simply included all the info &/or calcs / rolls the players can use within each fieldset row, to avoid any nasty errors that might crop up later. I'd still be interested if someone knew a clever way to call / ref. tags from outside of a fieldset. ;-) This is your only option if you don't want to use sheetworkers, although I've noticed that you are using autocalc fields in some of your other posts. I'll point out here that sheetworkers are the much preferred method. Autocalc is really only still available so that older sheets that were made from before sheetworkers will still function. Sheetworkers allow much more flexibility and control over how the sheet reacts to changes.
I see... just skimmed over this... <a href="https://wiki.roll20.net/Sheet_Worker_Scripts" rel="nofollow">https://wiki.roll20.net/Sheet_Worker_Scripts</a> Thx for the info, Scott. I'll have to look into this more in the near future.