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

How to add default attributes to my custom character sheet

February 23 (3 years ago)

Title says it all. I'm trying to add default attributes to the custom character sheet I'm creating. I've looked around to try and find relevant answers but I'm still having a hard time understanding. From what I gather, you can do this through useroptions in the sheet.json file though I seem to be doing something wrong. Below is an excerpt including the useroptions portion of my sheet.json. Any help is appreciated

"useroptions": [

"attribute": "attr_prof_mod",

        "displayname": "Profession",

        "type": "text",

        "value": "",

        "description": "The profession of the character, if one should apply.",

]

February 23 (3 years ago)
GiGs
Pro
Sheet Author
API Scripter

There might be a misocmmunication here, but the easiest way to add default attributes is in the html itself. say

<input type="text" name="attr_prof_mod" value=""">

Whatever you put in the value will be its default value.


For your method, the error your making is likely in the attribute: you only ever use the attr_ part when initially creating an attribute in the sheet html. Every other place you refer to the attribute, leave it off, so

"attribute": "prof_mod",


In your above example, you seem to be setting a default value of "" - there's no reason to use the JSON for that.

The JSON file is meant for a sheet's default settings, not general attributes. For those, set them in the HTML as per my example at the start of this post.

February 23 (3 years ago)

Done and sorted. Thanks a bunch!