Difference between revisions of "Homebrew: Meta"

From 5etools Community Wiki
Jump to: navigation, search
(Meta Tag)
(Meta Tag)
 
(2 intermediate revisions by the same user not shown)
Line 10: Line 10:
 
! Field Name !! Data Type !!  Description !! Required
 
! Field Name !! Data Type !!  Description !! Required
 
|-
 
|-
| json || String ||  An identifying string, as seen in the JSON in \"source\" fields. || True
+
| json || String ||  An identifying string, as seen in the JSON in "source" fields. || True
 
|-
 
|-
| abbreviation || String ||  v || True
+
| abbreviation || String ||  Abbreviated form of the source, to display on the site. || True
 
|-
 
|-
 
| full || String ||  Full title of the source, to display on the site. || True
 
| full || String ||  Full title of the source, to display on the site. || True
 
|-
 
|-
| authors || Array of Strings ||  A list of authors who created the homebrew source. || True
+
| authors || Array of Strings ||  A list of authors who created the homebrew source. || False
 
|-
 
|-
 
| convertedBy || Array of Strings ||  An optional list of people who contributed to converting the source to 5etools format. || False
 
| convertedBy || Array of Strings ||  An optional list of people who contributed to converting the source to 5etools format. || False
 
|-
 
|-
| url || String || A direct link to the source, if available in web form or on a store. || True
+
| url || String || A direct link to the source, if available in web form or on a store. || False
 
|-
 
|-
| version || String ||  The source version, e.g. \"1.2.3\". || True
+
| version || String ||  The source version, e.g. "1.2.3". || True
 
|-
 
|-
| targetSchema || String ||  The target schema version in 5etools, e.g. \"1.2.3\". || True
+
| targetSchema || String ||  The target schema version in 5etools, e.g. "1.2.3". || False
 
|-
 
|-
 
| color|| String ||  HTML hex color code this source should use when displayed in lists, e.g. 'ff00ff'. It defaults to white if not given || False
 
| color|| String ||  HTML hex color code this source should use when displayed in lists, e.g. 'ff00ff'. It defaults to white if not given || False
Line 42: Line 42:
 
| sense || Object || Object keys are Sense names, which can referenced using {@sense <key>} (case insensitive).
 
| sense || Object || Object keys are Sense names, which can referenced using {@sense <key>} (case insensitive).
 
|-
 
|-
| spellSchools || Object|| Object names are spell school abbreviations; values should be objects with `\"full\"`` (used in the main entry, e.g. \"Evocation\") and `\"short\"` (used in the list view, e.g. `\"Evoc.\"`) key/values.
+
| spellSchools || Object|| Object names are spell school abbreviations; values should be objects with "full" (used in the main entry, e.g. "Evocation") and "short" (used in the list view, e.g. "Evoc") key/values.
 
|-
 
|-
| spellDistanceUnits || Object || Object names are spell distance units; values should be objects with optional `\"singular\"`` (singular form of the unit, e.g. \"foot\" for the singular of \"feet\"--if unspecified, a trailing \"s\" is removed from the plural version, if it exists, and the result is used as the singular form) and `\"feetPerUnit\"` (e.g. for a \"yards\" custom unit, this would be `3`, as there are three feet in a yard) key/values.
+
| spellDistanceUnits || Object || Object names are spell distance units; values should be objects with optional "singular" (singular form of the unit, e.g. "foot" for the singular of "feet"--if unspecified, a trailing "s" is removed from the plural version, if it exists, and the result is used as the singular form) and "feetPerUnit" (e.g. for a "yards" custom unit, this would be `3`, as there are three feet in a yard) key/values.
 
|-
 
|-
| optionalFeatureTypes || Object || Object names are optional feature \"type\" shorthands (e.g. \"EI\" for \"Eldritch Invocation\" which will be displayed in the list view as a sortable column.
+
| optionalFeatureTypes || Object || Object names are optional feature "type" shorthands (e.g. "EI" for "Eldritch Invocation" which will be displayed in the list view as a sortable column.
 
|-
 
|-
| dateAdded || Integer || The epoch timestamp (in seconds) when the homebrew was added to the repository. Not guaranteed to be anywhere near accurate. See [https://en.wikipedia.org/wiki/Unix_time See UNIX Time to get the current value.]
+
| dateAdded || Integer || The epoch timestamp (in seconds) when the homebrew was added to the repository. Not guaranteed to be anywhere near accurate. [https://en.wikipedia.org/wiki/Unix_time See UNIX Time to get the current value.]
 +
|-
 +
| itemValueConversions || Array of Objects|| Features a field that contains an array of objects pertaining to how value integers are displayed based on the objects.
 
|}
 
|}
  

Latest revision as of 16:25, 30 November 2019

Meta Tag

The meta tag contains all relevant information of the homebrew file you are creating, creating a homebrew file without a meta tag will not work, hence it is important to know which fields are necessary. The meta tag contains an object array labelled "sources", and other fields.

Sources Fields List

The following is the list of fields that can be included in the object array, "sources". All fields are enclosed by quotation marks (").

Field Name Data Type Description Required
json String An identifying string, as seen in the JSON in "source" fields. True
abbreviation String Abbreviated form of the source, to display on the site. True
full String Full title of the source, to display on the site. True
authors Array of Strings A list of authors who created the homebrew source. False
convertedBy Array of Strings An optional list of people who contributed to converting the source to 5etools format. False
url String A direct link to the source, if available in web form or on a store. False
version String The source version, e.g. "1.2.3". True
targetSchema String The target schema version in 5etools, e.g. "1.2.3". False
color String HTML hex color code this source should use when displayed in lists, e.g. 'ff00ff'. It defaults to white if not given False

Other Fields

Other fields are given outside of the Sources are able to provide other additions, like new skills, spell schools and similar.

All of these additional fields are optional, note that all of these fields are enclosed in quotation marks (").

Field Name Data Type Description
skill Object Object keys are Skill names, which can referenced using {@skill <key>} (case sensitive).
sense Object Object keys are Sense names, which can referenced using {@sense <key>} (case insensitive).
spellSchools Object Object names are spell school abbreviations; values should be objects with "full" (used in the main entry, e.g. "Evocation") and "short" (used in the list view, e.g. "Evoc") key/values.
spellDistanceUnits Object Object names are spell distance units; values should be objects with optional "singular" (singular form of the unit, e.g. "foot" for the singular of "feet"--if unspecified, a trailing "s" is removed from the plural version, if it exists, and the result is used as the singular form) and "feetPerUnit" (e.g. for a "yards" custom unit, this would be `3`, as there are three feet in a yard) key/values.
optionalFeatureTypes Object Object names are optional feature "type" shorthands (e.g. "EI" for "Eldritch Invocation" which will be displayed in the list view as a sortable column.
dateAdded Integer The epoch timestamp (in seconds) when the homebrew was added to the repository. Not guaranteed to be anywhere near accurate. See UNIX Time to get the current value.
itemValueConversions Array of Objects Features a field that contains an array of objects pertaining to how value integers are displayed based on the objects.


Item Value Conversion

This is an optional addition to the meta tag, if the economy that your homebrew uses is different from the standard 5e Dungeons and Dragons system this will help to avoid incorrect currency values.

5eTools uses an numerical values based on the amount of copper an item costs and converts between the currencies, hence that is what such a table would be based on.

Enclosed inside the field of itemValueConversions can be the following:


           "SS": [
               {
                   "coin": "gp",
                   "mult": 0.0001
               },
               {
                   "coin": "sp",
                   "mult": 0.01
               },
               {
                   "coin": "cp",
                   "mult": 1
               }
           ]


In the above block of code:

  • "SS" is an example of the name of the currency conversion system, this is also what all items and similar should refer to using the valueConversion field .
  • The name of the conversion system ("SS" in this example) contains an array of objects.
  • Inside each object is two additional field and value pairs.
  • The "coin" field is a string that is what the name of the currency should be.
  • The "mult" field is a numerical value that describes how much each value is worth.

The above example uses a system called the Silver Standard, where 100cp = 1sp (hence 1/100 = 0.01) and 100sp = 1gp (hence 1/10000 = 0.0001).