Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Repeating Section"

From Roll20 Wiki

Jump to: navigation, search
m
m
Line 54: Line 54:
  
 
[[Category:Character Sheets]]
 
[[Category:Character Sheets]]
 +
[[Category:Repeating Section]]
 
[[Category:Macros]]
 
[[Category:Macros]]
 
</noinclude>
 
</noinclude>

Revision as of 13:43, 23 February 2022

Main Page: Character Sheet

Repeating Sections are a specific part of character sheets which works in a particular way.

Using

Example of deleting & reordering a repeating section on the D&D 5E by Roll20-sheet.


In addition to fields, your character sheet may feature one or more repeating section , where you can dynamically change a list by adding/reordering/removing entries to them.

How the Repeating sections buttons look may vary between character sheets for different systems, but this is how the buttons usually look:

  • Add: Click on the &-button in the bottom-left corner of the repeating section to add a new entry.
  • Modify: Click the ( "Modify/Lock"-button to enable deleting existing entries, or reorganizing them.
    • Reorder: Press and hold the -symbol of a specific row, and then drag it up- or downwards to change it's position. (left side)
    • Delete: Press the #-icon of of a specific row, to delete it. You get no warning, so it's deleted right away. (right side)
    • When you're done deleting/re-ordering things, click on the )(bottom right) to exit the edit mode for the rep section


Macro

Main Page: Macros#Referencing Repeating Attributes

Attributes in repeating sections can either be referenced by their row index(changes if you reorder), or by their RowID(unique ID is generated for each row when they are created, staying the same even if you reorder them)

Row Index starts from 0, so the first item is $0.

Attribute Example

repeating_inventory_$0_itemname or repeating_inventory_-MtISxbdM5dmT1rsJG96_itemname

Breakdown:

  • repeating - indicates the attribute if from a repeating section
  • _ separator between each component of the rep section attribute reference.
  • inventory Name of the Repeating section (this name cannot contain underscores)
  • $0 - row index, tells which row's attributes to check from. $0, $1, $2 etc.
    • -MtISxbdM5dmT1rsJG96 alternatively, use the unique RowID to reference same thing even if it's reordered.
  • itemname - the actual name of the attribute. (this name may contain underscores)

So, in a D&D 5E by Roll20-game, if you have a character named "Bob" with at least one item in their inventory, and you type @{Bob|repeating_inventory_$0_itemname} in the chat, it will return you the name of the item.

@{Alice|repeating_inventory_$0_itemcount}          // refers to the first row by index
@{selected|repeating_inventory_-KC0zCLum1Rq3V5wssyE_itembonus} //reference by RowID

Lists of some sheet's normal and repeating section attributes:

Sheet Coding

For info on coding rep sections for character sheets, see: Character Sheet Development/Repeating Section

Sheetworkers involving repeated sections may end up more complicated than ones mode for regular sections.