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 section

Hello, I'm trying to build a repeating section, but I'm really bad at coding. If possible, please do enlighten me! I'm using the 5th Edition OGL by Roll20 sheet as reference! Mainly I have two issues. 1. How does that gear icon work? When you add a new item, the Roll20 sheet has a gear icon that maximizes or minimizes the details, then condenses it. I can't understand how that is being done. 2. How do I make rolls? For example, if my section is like this: Name of the Skill: Fireball Rank of the Skill: 3 Trait used by the Skill: Magic How do I make a roll if I don't know which @attr_ to use, since the player can create as many items on the list as needed? I do apologize if my questions are really dumb... but I'm trying very hard! Thank you very much for your attention!
1499274678
Lithl
Pro
Sheet Author
API Scripter
For collapsing a section with the gear icon, see:&nbsp; <a href="https://wiki.roll20.net/CSS_Wizardry#Hide_Areas" rel="nofollow">https://wiki.roll20.net/CSS_Wizardry#Hide_Areas</a> The gear icon itself is lower-case "y" in Pictos:&nbsp; <a href="https://wiki.roll20.net/CSS_Wizardry#Pictos" rel="nofollow">https://wiki.roll20.net/CSS_Wizardry#Pictos</a> For a roll button in a repeating section, you can reference the attributes in that repeating section as though they weren't in a repeating section. When the user presses the roll button, the system will grab the appropriate attributes from the same row.
I will do my best here. Thank you very much for replying!
1499275117
Zargon
Sheet Author
That is handled by some tricks in the CSS code for the sheet. &nbsp;To put it simply by default the CSS makes these pieces invisible with "display: none;" and when the Gear "checkbox" is selected a different bit of CSS triggers instead setting it to "display: inherit;" which allows you to actually see it. &nbsp;In terms of the actual HTML code those pieces are always there in the structure you just can't see them. &nbsp;If you want to take a closer look, search the CSS for ".sheet-subitem" If you place the roll button within the actual repeating section you can just write it as normal directly referencing the attributes in that particular repeating section and non repeating parts of the sheet, as the repeating section framework will handle things for you. &nbsp;If you put the roll button outside the repeating section you would need to start having your sheet figure out the correct row numbers to insert into the attribute references.
If the attribute is part of a Select, how do I make it reference the correct one? Like, let's suppose it's like this: SKILL RANK ATTRIBUTE Fireball 1 Intelligence The user will type "fireball" as a text input. Rank is a number input. And attribute is a select input. But when I make the roll, I have to roll the attribute that is set elsewhere on the sheet. So something like: /roll 1d20 + @{rank} + {@attribute} How will the sheet know which attribute to reference based on the Select?
1499286714
Lithl
Pro
Sheet Author
API Scripter
You can have the attribute reference as the value of the option. For example: &lt;input type="text" name="attr_rank"&gt; &lt;select name="attr_attribute"&gt; &lt;option value="@{strength}"&gt;Strength &lt;option value="@{constitution}"&gt;Constitution &lt;option value="@{dexterity}"&gt;Dexterity &lt;option value="@{intelligence}"&gt;Intelligence &lt;option value="@{wisdom}"&gt;Wisdom &lt;option value="@{charisma}"&gt;Charisma &lt;/select&gt; &lt;button type="roll" name="roll_example" value="/roll d20 + @{rank} + @{attribute}"&gt;&lt;/button&gt;