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

Creating an Icons Assembled Sheet! Having trouble with rolls

1431136570

Edited 1431137503
chatty
KS Backer
Sheet Author
Disclaimer: I'm not a programmer or web developer, even as a hobby. I'm trying to figure this stuff out during limited free time (full time job + young child!), so any help with code or design decisions would be greatly appreciated. Also, I'd pay cash money for someone to pick this up for me and do the actual work, but that seems like a lot to ask. I'm creating a sheet for the Icons Assembled game. To keep things simple and make Extras and Limitations a little easier I've decided to make Powers and Specialties freeform text even though the game includes specific lists. But I still want to create rolls on the sheet that take into account Specialties and Ability scores. To this end, I decided I wanted to create a repeating fieldset with the following fields: 1) Name of Roll; 2) Ability for Roll (drop down; value defined earlier in sheet); 3) Bonus (from Specialty, generally, but nothing will require this); 4) a Roll button that rolls a d6+the referenced ability+the bonus. I have no earthly idea how to do this. I don't know how to refer to the attributes that are part of repeating fields, and that's really throwing me off. I'd love any help, including ideas on better ways to create the rolls. Thanks Christopher
Something like this: Bob's Attributes:<br> Something Physical: <input type="number" name="attr_attribute_1_rating" value="0"/><br> Something Mystical: <input type="number" name="attr_attribute_2_rating" value="0"/><br> Something Economical: <input type="number" name="attr_attribute_3_rating" value="0"/><br> <fieldset> <input type="text" name="attr_roll_name" placeholder="Name of Roll"/> <select name="attr_roll_ability"> <option value="@{attribute_1_rating}">Something Physical</option> <option value="@{attribute_2_rating}">Something Mystical</option> <option value="@{attribute_3_rating}">Something Economical</option> </select> <input type="number" name="attr_roll_bonus" value="0"/> <button type="roll" value="/e uses @{roll_name} [[1d6 + @{roll_ability} + @{roll_bonus}]]"></button> </fieldset> ...creates this: ...and the roll turns out like this: The wiki is a great lace to start. There is a section on character sheets , input & select fields, roll buttons , and repeating fields , along with lots of other information. Believe me, I understand the huge undertaking a first time a non-programmer tries this. The longer version of what I did: I made up three number fields and made sure they were named (inside the sheet) so the rest of the sheet knows where to look when I ask for "attribute_1_rating". I then made a fieldset that had a class with "repeating_" in the beginning of it. Next came an text box for the name of the roll. Again, I named it (prefix with "attr_") so the sheet with remember it. The dropdown menu is called <select> in html. The options listed under it displays "Something Physical", etc, but the value referenced is the value. Since it should reference other parts of the sheet, I tell it where to look with the "@{ whatever }" The roll button has the value of what you want rolls. The extra text ("/e uses @{roll_name}" just helps identify name of the roll. What is actually rolled in inside the square brackets ("[[ ]]"). If you need anymore help, let me know. I am in the middle of a huge project right now, or I would jump in feet first.
1431140313
chatty
KS Backer
Sheet Author
Thanks! I've been looking at the wiki and poking at other sheets, but I couldn't find (probably didn't look hard enough) an example of this. I'll see if I can make it work, and ask questions as needed. Thanks again!
1431144274
chatty
KS Backer
Sheet Author
Huh. The +Add button isn't appearing for me. I should go to bed. But thanks! It works other than that! Perhaps in the morning it will be better.
1431147598

Edited 1431147677
chatty
KS Backer
Sheet Author
Didn't go to bed. Fixed what was wrong. Working now! Time to upload to github and see if I get approval! Thanks! (ETA: Ok need to tweak a little first. need sleep before that)
1431148983
chatty
KS Backer
Sheet Author
OK STILL didn't go to bed. But I am about to. I got Add to appear but when I use tab or enter after naming the roll, all rows after the first disappear. here's my code in case any night owls can tell me what I have done wrong. I do not really know how to put a box around it. sorry :( <div> <div>ROLL BUILDER</div> <fieldset> <input type="text" name="attr_roll_name"> <select name="attr_roll_ability" value="0"> <option value="@{Prowess}">Prowess</option> <option value="@{Coordination}">Coordination</option> <option value="@{Strength}">Strength</option> <option value="@{Awareness}">Awareness</option> <option value="@{Intellect}">Intellect</option> <option value="@{Willpower}">Willpower</option> </select> <input type="number" name="attr_roll_bonus" value="0"> <button type="roll" value='/e uses @{roll_name} [[1d6 + @{roll_ability} + @{roll_bonus}]]'> </fieldset> </div> zzz (thanks again!) zzzz
1431152752

Edited 1431152908
Lithl
Pro
Sheet Author
API Scripter
The fieldset needs to have a class that begins with "repeating_". Something like <fieldset class="repeating_rolls"> To create a code block, use the Formatting button in the top left corner of the Post Reply box. (Also, "value" is not a valid attribute for the <select> element. The value of a select is the value of the currently selected option. If you want the default value of the select to be something other than the first option, use the "selected" attribute on the option you want as the default.)
What Brian said. I like to add: <option value="0" selected> </option> As my first option to give an empty entry in the dropdown, but its a personal thing.
1431175065
chatty
KS Backer
Sheet Author
That fixed it! What's weird is I thought I had added "repeating". Perhaps I'd never saved it. It was very late. Oh well! It's working now! On to polishing the CSS! Thank you all!
1431178368

Edited 1431179159
chatty
KS Backer
Sheet Author
here's the sheet: I could not for the life of me get labels to the left of t heir input boxes without use of a table. No idea if that's normal or just me. Current things I want to do with it: 1) Put Current/Starting headers over Stamina and Determination 2) Figure out how to align "Prowess" and "Rank" 3) (Pie in the Sky) figure out a way to autocalc starting Determination 4) Make it look pretty Thanks for past, present, and future help, and to everyone whose sheet I cribbed for ways to do things!
1431181835
Finderski
Plus
Sheet Author
Compendium Curator
chatty said: 2) Figure out how to align "Prowess" and "Rank" vertical-align: text-top; :)
1431184624

Edited 1431186377
chatty
KS Backer
Sheet Author
will that work if these are two seperate tables? need to better define my div elements and classes, looks like.
1431444671
chatty
KS Backer
Sheet Author
My sheet is LIVE! Thanks all, for all your help! I welcome suggestions for making it better/nicer. Is here the best place to solicit those? thanks! Christopher
1431451021
Finderski
Plus
Sheet Author
Compendium Curator
Yeah, this is probably the best place. You may want to start a new thread, though that's not absolutely required. Congrats on on your new sheet and good luck.
Congrats!
1431462338
chatty
KS Backer
Sheet Author
Thanks!