Generic 3-column character sheet.

1536731097
Author X
Pro
Sheet Author
Per True Julian's request, I've been working on a generic character sheet that can be more organized than the default attribute list. It's usable, although it 1) doesn't style headers correctly unless you change the type to something else then back to header (I can't get it to create new items with a default value set in the Select field), 2) won't let you use any of the values in macros since they're all repeating values, at least not easily (if there is a way to reference repeating values in macros, I don't feel like looking it up), and 3) still shows the add/modify buttons in "fixed" mode. However, I've been working on it for almost 3 hours and I need to sleep, so I can't fix these issues tonight. If anyone with access to custom sheets wants to try it, or just look at the code to see how it works/if you can improve it, the code is here .
1536861566
Author X
Pro
Sheet Author
So, I think problem #2 can be resolved with sheet workers creating attributes using the name field of each item. That would take a lot of coding and testing, but I can see the path to it. #3 I just fixed by adding a line of CSS. Does anyone know how to resolve problem #1? The Select for the dropdown looks like it starts at Header (or whatever I set as the top option), but the attribute isn't set until you change it. I've tried adding a selected="selected" attribute to the option tag, and adding a checked='true' attribute to a hidden checkbox that should set the attribute, but neither seems to work - the attribute isn't set until the user changes it. Is this just an issue with repeating sections?
1536865297

Edited 1536865372
Jakob
Pro
Sheet Author
API Scripter
Author X said: Does anyone know how to resolve problem #1? The Select for the dropdown looks like it starts at Header (or whatever I set as the top option), but the attribute isn't set until you change it. I've tried adding a selected="selected" attribute to the option tag, and adding a checked='true' attribute to a hidden checkbox that should set the attribute, but neither seems to work - the attribute isn't set until the user changes it. Is this just an issue with repeating sections? Not exactly sure why this is happening, but you can try one or more of the following: Give your option tags value attributes. Replace your family of checkboxes by a single hidden input with default value="Header", and replace the CSS to fit (i.e. :not([value="Header"]) and [value="header"] instead of .sheet-isHeader:not(:checked) and .sheet-isHeader(:checked). Oh, another thing, I think you want to add a column-gap, not a row-gap, for your main grid, right?
1536868209
Author X
Pro
Sheet Author
Thanks for taking a look! I'll try the 1st when I get a chance. For 2, I was researching that to see if I could just use the Select and the answer I found was that browsers don't update CSS live when using the value selector, it only uses the value from the HTML tag. I haven't actually verified that, though, so it may be outdated information. Regarding the column-gap, I had that initially as well, but I changed that to padding on the columns themselves so the border line would be pushed out.
1536869516
Jakob
Pro
Sheet Author
API Scripter
Author X said: Thanks for taking a look! I'll try the 1st when I get a chance. For 2, I was researching that to see if I could just use the Select and the answer I found was that browsers don't update CSS live when using the value selector, it only uses the value from the HTML tag. I haven't actually verified that, though, so it may be outdated information. Just to clarify, my solution would include 2 input-like elements: 1 select, and 1 input with type="hidden", both with the same name. Your CSS would key off the latter, and a hidden input in Roll20 actually changes its value attribute in the HTML if the attribute value in the backend changes. This works, I have tested it.
1536876014
Author X
Pro
Sheet Author
Okay, I didn't realize the hidden type inputs were handled differently by Roll20. That's great, that's a much simpler technique for this kind of selection in general (I picked up the thousand checkboxes technique while modifying the Apocalypse World sheets). Thank you again!
1536893428
Finderski
Pro
Sheet Author
If you wanted to get fancy, you could have a field for the roll formula and have a button point to that field...
1536901606
Author X
Pro
Sheet Author
Finderski said: If you wanted to get fancy, you could have a field for the roll formula and have a button point to that field... That's a good idea, but first I'd need make it translate the fields into actual properly-named character attributes so you can use them in roll formulas.
1536902311

Edited 1536906895
Jakob
Pro
Sheet Author
API Scripter
Author X said: Finderski said: If you wanted to get fancy, you could have a field for the roll formula and have a button point to that field... That's a good idea, but first I'd need make it translate the fields into actual properly-named character attributes so you can use them in roll formulas. Repeating attributes are  proper character attributes, they're just not visible in the attributes & abilities tab. Getting to the full name is slightly laborious, but if your button is within the repeating section, you can use them by their name from within the section. E.g. if their name is attr_foo, then using @{foo} in the value of a button within this repeating section will pull the correct attribute.
1536939053

Edited 1536939773
Author X
Pro
Sheet Author
I know they're real attributes, what I mean by "properly-named" is having a worker script translate "repeating_column1_$0_itemName=Foo" and "repeating_column1_$0_itemValue=Bar" into an attribute named Foo with value Bar. So an end-user could write a macro as expected, ie "d20 + Strength" after creating a number field "Strength".
1536973340

Edited 1536973404
G G
Pro
Sheet Author
I've thought about this problem when I was thinking about making my own setting agnostic sheet. One decent way to do it would be to have each section have an input for a group name (outside of a repeating set) - so you can name a set Weapons for instance. Then in the set, you have a name field for each item, and the player might enter, say, Sword. Then you have a sheet worker set to work each time either the group name, the item name, or the item value changes. When the item name or item value changes, the sheet worker can be simple, it doesnt need to loop through the entire repeating set: it creates an attribute named using groupName and itemName, and assigns it the proper value. This approach helps make sure attribute names will be unique, since they are pulled from two inputs and end up as things like Weapon_Sword. Changing the group name would need all items in the set recalculated, sadly. If you dint want to deal with that, you could avoid it by adding a hidden input on each row in the field set, which gets its value from the Groups Name. Then changing the group name would cascade the changes through all the attributes.  The big problem with this approach is that the number of hidden attributes will proliferate. There's no way for a script to actually delete an attribute, so if a player names their weapon Sword, then later renames it to Blade, you still have a hidden sword attribute. This can easily create confusion, people using the wrong name in macros, etc.  That said, this shouldnt be too big of a problem. And these stats will be accessible on the Attributes and Abilities tab so can be cleaned up manually.
1536974776
G G
Pro
Sheet Author
Also, you'll probably need to have some kind of text parser, to check that names people pick are not going to screw up your code. If someone enters a name with illegal characters, remove the invalid characters in the name box or change the name to a warning.