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 with predefined entries?

I'm looking to populate a skill list, where the skill are predefined along with predefined skill bases and progression. I can manually input each and create separate attributes of course, but it's a large list of skills and it seems like it would be easier to use a repeating section. I'm just not aware of a way to populate the data before hand. I want players to use check boxes to indicate the skills they have. Everyone can use most skills untrained so I still want the base percentages. Does anyone have insight in a good way (if possible) to handle this inside of roll20? Thank you for your insight.
1609361201
David
Sheet Author
add them in during a sheet open on('sheet:opened',function(){ } var newrowid = generateRowID (); var newrowattrs = {}; newrowattrs[ "repeating_inventory_" + newrowid + "_weight" ] = "testnewrow" ; setAttrs (newrowattrs);
1609372363

Edited 1609372429
GiGs
Pro
Sheet Author
API Scripter
You can  do this with a repeating section, but IMO its a bad idea. Players who like to make their own macros will have more trouble than if you just manually create the list - the syntax of attribute names is much simpler. I would recommend generating the html code for the skills with some external program and then pasting it into the html. There are programs (like pug or handlebars) that can do this, but if you aren't a programmer, they will be tricky to set up. But its a task you can do very easily with excel or google sheets. It's hard to describe the method without seeing the code you need created. But if you can post what the lines for a complete skill (include the checkbox, the inputs needed to skill values and related values, the skill name, etc) I can show you how to do it. The advantage of this method is you effectively only need to create the code for one skill (which you have to do with a repeating section too), and then simply dragging down a few lines on the spreadsheet gives you the code for all of them.
Thanks for the replies! Yes, much easier to assemble them with other software. Obviously, I'd have to create a unique attribute for each skill, but not too difficult. Still learning the limitations of roll20. <h4>Communication</h4>     <div class="body"><button type="roll" value="&{template:custom} {{color=orange}} {{title=@{character_name}'s @{skillname_AEW}}} {{[[1d100]]/@{skill_rating_AEW}%}}"></button>     <input class="sheet-input-center-aligned" type="text" value="Advanced Electronic Warfare" name="attr_skillname_AEW" disabled="true"/>     <input class="sheet-input-center-aligned" type="number" value="88" name="attr_skillbase_AEW" disabled="true"/><b>%</b>     <input class="sheet-input-center-aligned" type="number"  value="1" name="attr_skillprog_AEW" disabled="true"/><b>%</b>     <input class="sheet-input-center-aligned" type="number"  value="1" name="attr_skillacquiredlvl_AEW" />     <input class="sheet-input-center-aligned" type="number" value="@{skillbase_AEW}+((@{level}-@{skillacquiredlvl_AEW})*@{skillprog_AEW})" name="attr_skillrating_AEW" disabled="true"/><b>%</b> </div>
1609393392
GiGs
Pro
Sheet Author
API Scripter
Before I show how to do this via excel, I have a couple of questions and observation. You have the skill name as a disabled input  <input class="sheet-input-center-aligned" type="text" value="Advanced Electronic Warfare" name="attr_skillname_AEW" disabled="true"/> I'd recommend doing that as a span, like <span class="skill-name">Advanced Electronic Warfare</span> Then you can apply whatever formatting you need via the span.sheet-skill-name css tag. That way you don't need a separate attribute for it. How does that sound? Your skillbase and skillprog attributes are also disabled. Do players enter values for these attributes. How do users (player or gm) change the values?  Finally, can you list the names of the other skills on top of Advanced Electronic Warfare?
1609426390

Edited 1609429855
GM
Pro
Here is the skill list. The number following the name is the base number. The percentage in parenthesis is the progression. I disabled input as I started to build this as a static list. Then it made me wonder if there was a way to use repeating with predefined input. There are 8 other skill sections, similar in size to this one. The base value and progression are static. Only level and IQ bonus (which I hadn't included in this yet) change the end skill rating. Good call on the span. I was too locked in to the existing format. I appreciate your help on this. I had looked at sheet workers briefly, but not sure it would do the job. Advanced Electronic Warfare 30% (+5%) Barter 30% (+4%) Creative Writing 25% (+5%) Cryptography 25% (+5%) Electronic Countermeasures 30% (+5%) Laser Communications 30% (+5%) Linguistics 30% (+6%) Optic Systems 30% (+5%) Performance 30% (+5%) (s) * Public Speaking 30% (+5%) (s) Radio: Basic 45% (+5%) (s) Sensory Equipment 30% (+5%) (s) Sign Language 25% (+5%) (s) Sing 35% (+5%) + Surveillance 30% (+5%) T.V./Video 25% (+5%)
1609466336
GiGs
Pro
Sheet Author
API Scripter
What do the symbols mean at the start of each skill like (s), +, * ? Are they relevant in some way or can they be ignored? Also for each of those skills you are showing the display name, but what would you use for the actual roll20 attribute name? Like with the first one, you jave attr_skillbase_AEW - what should be the suffix for each of those? Personally, I'd probably use the actual skill with special characters (like spaces and /) replace by underscores, then add a suffix for base, prog, aquiredlvl, something like: tv_video_base, tv_video_prog, tv_video_level. The goal with attribute names should be to come up with something that follows a pattern (and always the same pattern) players can reasonably guess, so they can make their own macros using the names. Also, its best to avoid alternating cases-  sticking entirely to lower case works best.