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 .
×

Help for a new sheet creator (Repeating sections and macro rolls)

Hi there. I've been a member of roll20 for about 2 years now, and I've been a Pro player for a year.  One of the reasons I upgraded is because I've been working on a custom game system and wanted to try it out, and to be able to make a custom sheet, so my players spend less time worrying about the specific math of how to roll and more time playing.  I have a (very crude) sheet here:  <div> <h4>Character Info</h4> <label>Name:</label><input type="text" name="attr_Name" /><br /> <label>Level:</label><input type="text" name="attr_Level" /><br /> <label>Race: </label><input type="text" name="attr_Race" /><br /> <h4>Stats</h4> <label>Strength:</label><input type="text" name="attr_Strength" /><br /> <label>Agility:</label><input type="text" name="attr_Agility" /><br /> <label>Vitality:</label><input type="text" name="attr_Vitality" /><br /> <label>Intelligence:</label><input type="text" name="attr_Intelligence" /><br /> <label>Power: </label><input type="text" name="attr_Power" /><br /> <h4>Life and Defenses</h4> <label>Life:</label><input type="text" value="Base" name="attr_Baselife" /><input type="text" value="Misc" name="attr_Bonuslife" /><input type="text" name="attr_Totallife" value="total" /><br /> <label>Essence: </label><input type="text" name="attr_Essence" /><br /> <label>Move/Free Move: </label><input type="text" name="attr_Move" /><br /> <label>Resist: </label><input type="text" name="attr_Resist" /><br /> <label>Vulnerable: </label><input type="text" name="attr_Vulnerable" /><br /> </div> <div> <h3>Skills</h3> <div> <fieldset> <input type="text" value="Category" name="attr_Skillcategory" /><input type="text" value="Skill Name" /> <input type="text" value="Rank" /><button type="roll" name="roll_testskill1" value=''></button><br /> </fieldset> </div> <h3>Combat Skills</h3> <fieldset> <input type="text" value="Weapon Skill Name" name="attr_Wpnskillnm" /><input type="text" value="Weapon Skill Rank" name="attr_Wpnsklilrn" /><button type="button">Roll</button><br /> </fieldset> <h3>Features</h3> <fieldset> <input type="text" value="Feat Name" name="attr_Ftname" /><input type="text" value="Feat Description" name="attr_Ftdescp" /><br /> </fieldset> <h3>Weapons</h3> <fieldset> <input type="text" value="Weapon Name" name="attr_Wpn" /><input type="text" value="Weapon Description" name="attr_Wpndesc" /><button type="button">Roll</button><br /> </fieldset> <h3>Spells</h3> <fieldset> <input type="text" value="Spell Name" name="attr_Spellname" /><input type="text" value="Spell Description" name="attr_Spelldesc" /><button type="button">Roll</button><br /> </fieldset> </div> <div> <h3>Encumberance</h3> <input type="text" name="attr_Encumberance" /> <h3>Spell Slots</h3> <input type="text" name="Spell Sots" /> <h3>Equipment</h3> <textarea></textarea> </div> One of the biggest issues I've been having is trying to add multiple skills, so players can roll their skill rolls. The skills are just single values from 0 - 10 (and can have an item bonus or a feature bonus) and don't scale off of the core stats at all. I want to be able to let the players add a Skill, Weapon, or Spell, and then click a roll button to just output the text. Can anyone help me out? 
1493774839
Finderski
Pro
Sheet Author
Compendium Curator
Your fieldset tags need a class. The class should be something like: class='repeating_spells' then you build out the section just like you would if it weren't a repeating section, including roll buttons. 
Finderski said: Your fieldset tags need a class. The class should be something like: class='repeating_spells' then you build out the section just like you would if it weren't a repeating section, including roll buttons.  So I would just make like one entry with a roll after adding the class? I apologize if I sound noobish, but I barely understand HTML, and this is pretty complex to me.
1493778041

Edited 1493778627
Zargon
Sheet Author
There are a number of things that you need to fix to get it working: As previously mentioned you need to set a class on the fieldset which should be "repeating_<insert name>" Your buttons should be set to a type of "roll", if you don't do this it won't realize you are trying to trigger a roll Buttons should have a value set as this is what you actually want it to do in the chat.  This is essentially just a normally formatted Macro except as an advantage you can ignore the fact that this is a repeating attribute as it will handle it automatically. An example for your spell section: <fieldset class="repeating_spell">     <input type="text" value="Spell Name" name="attr_Spellname"  /><input type="text" value="Spell Description" name="attr_Spelldesc" /><button type="roll" value="@{Spellname} - @{Spelldesc}" >Roll</button><br /> </fieldset> Edit: Was looking through and noticed a few other issues you may want to fix:  Your Spell Slots attribute isn't named correctly, it should start with "attr_" The Equipment textarea doesn't have a name so it will clear every time you close the sheet.
1493780114
Finderski
Pro
Sheet Author
Compendium Curator
Zargon points out a bunch of stuff to be aware of and correct.  I was writing from my phone before and didn't look closely at the code.  However, if it helps, here's a repeating section I use in my sheet (to serve as an example): <fieldset class="repeating_fightingspec"> <div class='sheet-row' style='margin: 0px; padding: 0px;'> <div class='sheet-col' style='width:280px;'> <div class="sheet-col" style='width:102px;'>   </div> <input class="sheet-standard" type="text" name="attr_fightingSpecName" title="@{repeating_fightingSpec_$#_SpecName}" placeholder="Specialization" style='width:152px; font-size: 12px; font-weight: normal;'/> </div> <div class='sheet-col' style='width:377px; text-align: center;'>   </div> <div class='sheet-col' style='width:120px;'> <button class="sheet-templatebutton" type='roll' name='roll_tFightingSpecRoll' title="@{tFightingSpecRoll}" value='@{skillrt} @{defsTemplate} {{skill_nameHeader=@{fightingSpecName}}} @{rolltFighting}'></button><button class="sheet-templatebutton sheet-GM-button" type='roll' name='roll_tgmFightingRoll' title="@{tgmFightingRoll}" value='/w gm @{skillrt} @{defsTemplate} @{rolltFighting}'></button> <button class="sheet-normalbutton" type='roll' name='roll_FightingSpecRoll' title="@{FightingSpecRoll}" value='/em @{character_name} attempts to hit something and rolls @{rollFighting}!'></button><button class="sheet-normalbutton sheet-GM-button" type='roll' name='roll_gmFightingRoll' title="@{gmFightingRoll}" value='/w gm @{character_name} attempts to hit something and rolls @{rollFighting}!'></button> </div> </div> </fieldset> I hope this helps.
Thank you both of you for the help! I'm pretty sure I can figure it out from those excellent examples. : )  Again, thank you!
Hi guys--I am trying to do a roll button like this as well, within a repeating section, and I have that part working (or rather, since I am just modding an existing sheet for my game's house rules, the original author has it working). What I was wondering, though, is...is there any way to get a roll button within a repeating section to call a value from outside the repeating section? For instance, if the roll needs to reference the character's STR score, which is stored outside the repeating section, is there a way to do that?
1494075264
Zargon
Sheet Author
Robert M. said: Hi guys--I am trying to do a roll button like this as well, within a repeating section, and I have that part working (or rather, since I am just modding an existing sheet for my game's house rules, the original author has it working). What I was wondering, though, is...is there any way to get a roll button within a repeating section to call a value from outside the repeating section? For instance, if the roll needs to reference the character's STR score, which is stored outside the repeating section, is there a way to do that? Yes, Just use an @{name} reference to it as normal, assuming you don't go doing something silly like using the same attribute name in different scope levels or referencing a second repeating section from the first. If you are actually having troubles with that make sure that you aren't using the same name for an attribute in your repeating section.  If you do such a thing the data will save properly due to the specifics of how Roll20 supports repeating section attributes, but when making a roll from a button inside a repeating section the attributes within the repeating section essentially blocks any identically named attributes outside the scope of the repeating section.
Thank you--I will give it a shot.