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

Custom Sheet question

1471028178

Edited 1471028459
Ok, sorry for possible wall of text and hope this is the right place to ask this question (new here), but I am working on a custom sheet for a custom game and I am trying to accomplish the following: My sheets have a long list of skills and stats and classes, so I am implementing them on the sheet like this: <tr><td><b>INTELLIGENCE</b></td><td><input type ="number" name="attr_Int" /></td><td><input type="checkbox" name="attr_hasInt" value="@{Int}"></td></tr> <tr><td>Aero Tech (+30)</td><td><input type="number" name="attr_aero"></td><td><input type="checkbox" name="attr_hasaero" value="@{aero}"></td></tr> <tr><td>Accounting (+20)</td><td><input type="number" name="attr_acc"></td><td><input type="checkbox" name="attr_hasacc" value="@{acc}"></td></tr> <tr><td>Anthropology (+30)</td><td><input type="number" name="attr_ant"></td><td><input type="checkbox"name="attr_hasant" value="@{ant}"></td></tr> Now, I want the roll button to ONLY accept the skills that are checked via the check boxes to roll i.e.: Int has a value of 20, Aero Tech has a value of 30, Accounting has a value of 15 and Anthropology has a value of 10, but only Int and Aero have been checked, and I only want those 2 skills to roll: <button type='roll' value='/roll 1d20! + @{Int} + @{aero} + @{acc} + @{ant}' name='roll_Check'></button>
1471028450
The Aaron
Roll20 Production Team
API Scripter
(Moved to Character Sheets)
In these cases I use radio buttons instead.  Sometimes, the radio button is a rotating image (so it takes up the same space as a single check box), some times it just two radio boxes right next to each other. When a checkbos is not check, and the sheet asks it for its input, it may send zero ("0"), which you would not want.  One of the radio buttons can be set to nothing (value="").  And then you can simply have the button reference the radio boxes.  So... <tr> <td><b>INTELLIGENCE</b></td> <td><input type ="number" name="attr_Int" /></td> <td><input type="checkbox" name="attr_hasInt" value=""><input type="checkbox" name="attr_hasInt" value="@{Int}"></td> </tr> <tr><td>Aero Tech (+30)</td> <td><input type="number" name="attr_aero"></td> <td><input type="radio" name="attr_hasaero" value=""><input type="radio" name="attr_hasaero" value="@{aero}"></td> </tr> <tr> <td>Accounting (+20)</td> <td><input type="number" name="attr_acc"></td> <td><input type="radio" name="attr_hasacc" value=""><input type="radio" name="attr_hasacc" value="@{acc}"/></td> </tr> <tr> <td>Anthropology (+30)</td> <td><input type="number" name="attr_ant"></td> <td><input type="radio" name="attr_hasant" value=""><input type="radio" name="attr_hasant" value="@{ant}"/></td> </tr> <button type='roll' value='/roll 1d20! + @{hasInt} + @{hasaero} + @{hasacc} + @{hasant}' name='roll_Check'></button> Side note: you may need to remove the plus signs from the button and add them to the proper radio buttons; meaning value="@{acc}" changes to value="+ @{acc}", with no plus signs under the button.