D&D 5E MPMB's D&D 5e Character Tools


log in or register to remove this ad


Anon Doe

First Post
Thank you for sharing this! I've been using it for a while and it's kinda sad to see it removed from DM's Guild, but since it's available here, that worry is gone now.

Also, for anyone looking for Xanathar's import script, they are available at Reddit. You can either import all the materials or pick and choose the ones you want here: https://www.reddit.com/r/mpmb/
 


Yunru

Banned
Banned
So for some reason my race keeps returning an error. I'm completely lost. JSConsole says it's on line 80, but that's just before "features":

[sblock]
Code:
/*    -WHAT IS THIS?-
    The script featured here is an explanation of how to make your own custom addition to MPMB's D&D 5e Character Tools.
    To add your own content to the Character Sheet, use the syntax below and save it in a file. You can then import this file directly to the sheet using the "Import" button and "Import/Export" bookmark.
    There you can either import the file as a whole or just copy the text into a dialogue.

    -KEEP IN MIND-
    Note that you can add as many custom codes as you want, either by importing consecutive files or pasting the scripts into the dialogue.
    It is recommended to enter the code in a freshly downloaded or reset sheet before adding any other information so that there won't be any conflicts.
*/

/*    -INFORMATION-
    Subject:    Class
    Effect:        This is the syntax for adding a new race to the sheet
                Note that you will need to define the race once for every sub-race (i.e. there is a separate entry for High Elf, Wood Elf, and Dark Elf)
                For races that have variants, like the human, you can define a variant using the RaceSubList. Any variant defined like that will only be selectable through the "Racial Options" button
    Sheet:        v12.999 (2017-12-19)
*/

var iFileName = "Homebrew Race - Moonfolk.js"; // Optional; This is how the file will be named in the sheet if you import it as a file and not copy-paste its content. Only the first occurrence of this variable will be used
RequiredSheetVersion(12.998); // Optional; This is the minimum required version number of the sheet for the script to work. If the sheet being used to import the script is of an earlier version, the user will be warned

RaceList["moonfolk"] = { //Object name; Note the use of only lower case! Also note the absence of the word "var" and the use of brackets []

    regExpSearch : /^(?=.*moonfolk).*$/i, //required; regular expression of what to look for (i.e. now it looks for any entry that has both the words "something" and "catlike" in it, disregarding capitalization). If this looks to complicated, just write: /something catlike/i
    
    name : "Moonfolk", //required; the name to use for the race
    
    sortname : "Moonfolk", //optional; this is the name used to fill the drop-down boxes. If you don't include this, the 'name' will used instead
    
    source : ["HB", 0], //required; the source and the page number. "HB" stands for homebrew. See the "Complete SourceList" for an overview of sources that are already defined. Or define a new source using the "Homebrew Syntax - SourceList.js". // This can be an array of arrays to indicate the things appears in multiple sources. For example, if something appears on page 7 of the Elemental Evil Player's Companion and on page 115 of the Sword Coast Adventure Guide, use the following: [["E", 7], ["S", 115]]
    
    plural : "Moonfolk", //required; the name to use for the race when the plural form is used
    
    size : 3, //required;  the size of the race (Gargantuan = 0, Huge = 1, Large = 2, Medium = 3, Small = 4, Tiny = 5)

    speed : { //required; This sets a value for one or more speed modes, and/or a value to be added to a specific speed mode or to all speed modes // the attributes of this object can be "walk", "borrow", "climb", "fly", "swim", and "allModes"
            
        // all of the following attributes are optional and you can add more ("borrow" isn't part of this example!)
        
        walk : { spd : 30, enc : 20 } // the objects "walk", "borrow", "climb", "fly", "swim" are all the same, they are an object with two attributes, 'spd' for the speed in feet, and 'enc' for the encumbered speed in feet.
    },
    
/* SYNTAX CHANGE v12.998 >> old syntax for 'tools' and 'languages' are no longer supported!! */
    languageProfs : [[1, "Moonspeak"], [1, "Common"]], // optional; this is an array of the language proficiencies gained. An entry can either be 1) a string that represents the language learned or 2) a number which is the number of language gained that can be chosen by the player
    
    vision : ["Darkvision", 60], //optional; An array of arrays that each have a length of 2; This adds the first value of each array to the Senses field. The second value is the range in feet. If no range is needed, put a 0 there. You can also add a modifier like "+30" or "*2" to have the appropriate calculation done with the range of sense
        
    savetxt : { // Optional; this attribute defines entries to add to the field for "Saving Throw Advantages / Disadvantages"
    
        text : ["Magic can't put me to sleep"], // Optional; this is an array of strings, and each of those strings is added to the field exactly as presented here
        
        adv_vs : ["charmed"] // Optional; this is an array of things that the character has advantage on saves against. This is put in the field after the text "Adv. on saves vs. ", so in this example it would result in "Adv. on saves vs. traps and charmed"
    },
    
    skills : ["Arcana"], //optional; Skill proficiencies the race has. This line can be deleted if you don't have anything to put here. If the race doesn't give fixed proficiencies, but instead gives a choice, delete this line and use the line below, "skillstxt"
    
    age : " reach adulthood when they master a field, typically around 100", //optional; the age tooltip/mouseover text (will be displayed in combination with the "plural" entry)
    
    height : " range from 5 to over 6 feet tall (4'9" + 2d8")", //optional; the height tooltip/mouseover text (will be displayed in combination with the "plural" entry)
    
    improvements : "Moonfolk: +2 Intelligence, +1 Wisdom;", //required; the text that is displayed when listing all the ability score improvements
    
    scores : [0, 0, 0, 2, 1, 0], //required; the ability score improvements as used by the Ability Score dialog. The syntax is: [Str, Dex, Con, Int, Wis, Cha]
    
    trait : "Moonfolk (+2 Intelligence, +1 Wisdom)\nLunar Magic:\n   I know the Dancing Lights cantrip.\n   Once I reach 3rd level, I can cast the Faerie Fire spell once per long rest.\n   Once I reach 5th level, I can cast the Moonbeam spell once per long rest.\n   Intelligence is my casting stat for these spells.", //required; the racial trait as it will be put in the Racial Trait field on the second page (note that "\n" is a line break).
    
    spellcastingAbility : 4, //required for a spellcaster; the ability score to use for spellcasting. Remove this line if your race has no spellcasting. (Str=1, Dex=2, Con=3, Int=4, Wis=5, Cha=6)
    
    spellcastingBonus : { //optional; an object that adds something to the "Bonus Spells" section of the spell selection dialog //this object can have all the same attributes as the "spellcastingList" object as defined in the ClassList, but must also have a "name" defined //the other things that can be defined in this that are not in the "spellcastingList" object, are the "selection", "times" and "prepared" values
    
        name : "Lunar Magic (level 1)", //required; this is used to identify the object, so must be an unique name
        
        spells : ["dancing lights"], //Optional, but required if not including the "class" entry; If a "spells" array is present, all other objects will be ignored and only this list of spells will populate the list of available spells. each entry has to match the name of the spell in the SpellsList
        
        selection : ["dancing lights"], //optional if "spells" is defined; this is the default selection for the array specified in "spells"
        
        prepared : true,
        
        atwill : true, //optional; if set to 'true', this makes the spell selected for this/these bonus spells to get "At Will" in the first column
    },
    
    features : { //optional; the racial features. Each works the same way, so only a couple of example are given. You can add as many as you want. If the race has no level-dependent or limited features, you can just delete the whole feature entry all together
    
        "faerie fire" : { //note the use of lower case characters
        
            name : "Faerie Fire", //required; the name of the racial feature
            minlevel : 3, //required; the level at which the feature is gained
            
            usages : 1, //optional; number of times it can be used. This can be one value, but can also be an array of 20 values, one for each level
            
            recovery : "long rest", //required if "usages" is defined; way of getting the limited feature recharged. If you define either "long rest" or "short rest" (note the lower case), than the feature is also added to the limited features
            
            tooltip : " (Lunar Magic)", //optional; the tooltip added to the entry in the Limited Feature section, this example will read "Lesser Restoration is gainged from Something Catlike (Celestial Legacy)"
            
            action : ["action", ""],
            
            spellcastingBonus : { //optional; works just like the "spellcastingBonus" object defined above
                name : "Lunar Magic (level 3)",
                spells : ["faerie fire"],
                selection : ["faerie fire"],
                oncelr : true,
            },
            
        "moonbeam" : { //note the use of lower case characters
        
            name : "Moonbeam", //required; the name of the racial feature
            minlevel : 5, //required; the level at which the feature is gained
            
            usages : 1, //optional; number of times it can be used. This can be one value, but can also be an array of 20 values, one for each level
            
            recovery : "long rest", //required if "usages" is defined; way of getting the limited feature recharged. If you define either "long rest" or "short rest" (note the lower case), than the feature is also added to the limited features
            
            tooltip : " (Lunar Magic)", //optional; the tooltip added to the entry in the Limited Feature section, this example will read "Lesser Restoration is gainged from Something Catlike (Celestial Legacy)"
            
            action : ["action", ""],
            
            spellcastingBonus : { //optional; works just like the "spellcastingBonus" object defined above
                name : "Lunar Magic (level 5)",
                spells : ["moonbeam"],
                selection : ["moonbeam"],
                oncelr : true,
            },
            
        },
        
    }
    
};
[/sblock]
 
Last edited:


So for some reason my race keeps returning an error. I'm completely lost. JSConsole says it's on line 80, but that's just before "features":

[sblock]
Code:
/*    -WHAT IS THIS?-
    The script featured here is an explanation of how to make your own custom addition to MPMB's D&D 5e Character Tools.
    To add your own content to the Character Sheet, use the syntax below and save it in a file. You can then import this file directly to the sheet using the "Import" button and "Import/Export" bookmark.
    There you can either import the file as a whole or just copy the text into a dialogue.

    -KEEP IN MIND-
    Note that you can add as many custom codes as you want, either by importing consecutive files or pasting the scripts into the dialogue.
    It is recommended to enter the code in a freshly downloaded or reset sheet before adding any other information so that there won't be any conflicts.
*/

/*    -INFORMATION-
    Subject:    Class
    Effect:        This is the syntax for adding a new race to the sheet
                Note that you will need to define the race once for every sub-race (i.e. there is a separate entry for High Elf, Wood Elf, and Dark Elf)
                For races that have variants, like the human, you can define a variant using the RaceSubList. Any variant defined like that will only be selectable through the "Racial Options" button
    Sheet:        v12.999 (2017-12-19)
*/

var iFileName = "Homebrew Race - Moonfolk.js"; // Optional; This is how the file will be named in the sheet if you import it as a file and not copy-paste its content. Only the first occurrence of this variable will be used
RequiredSheetVersion(12.998); // Optional; This is the minimum required version number of the sheet for the script to work. If the sheet being used to import the script is of an earlier version, the user will be warned

RaceList["moonfolk"] = { //Object name; Note the use of only lower case! Also note the absence of the word "var" and the use of brackets []

    regExpSearch : /^(?=.*moonfolk).*$/i, //required; regular expression of what to look for (i.e. now it looks for any entry that has both the words "something" and "catlike" in it, disregarding capitalization). If this looks to complicated, just write: /something catlike/i
    
    name : "Moonfolk", //required; the name to use for the race
    
    sortname : "Moonfolk", //optional; this is the name used to fill the drop-down boxes. If you don't include this, the 'name' will used instead
    
    source : ["HB", 0], //required; the source and the page number. "HB" stands for homebrew. See the "Complete SourceList" for an overview of sources that are already defined. Or define a new source using the "Homebrew Syntax - SourceList.js". // This can be an array of arrays to indicate the things appears in multiple sources. For example, if something appears on page 7 of the Elemental Evil Player's Companion and on page 115 of the Sword Coast Adventure Guide, use the following: [["E", 7], ["S", 115]]
    
    plural : "Moonfolk", //required; the name to use for the race when the plural form is used
    
    size : 3, //required;  the size of the race (Gargantuan = 0, Huge = 1, Large = 2, Medium = 3, Small = 4, Tiny = 5)

    speed : { //required; This sets a value for one or more speed modes, and/or a value to be added to a specific speed mode or to all speed modes // the attributes of this object can be "walk", "borrow", "climb", "fly", "swim", and "allModes"
            
        // all of the following attributes are optional and you can add more ("borrow" isn't part of this example!)
        
        walk : { spd : 30, enc : 20 } // the objects "walk", "borrow", "climb", "fly", "swim" are all the same, they are an object with two attributes, 'spd' for the speed in feet, and 'enc' for the encumbered speed in feet.
    },
    
/* SYNTAX CHANGE v12.998 >> old syntax for 'tools' and 'languages' are no longer supported!! */
    languageProfs : [[1, "Moonspeak"], [1, "Common"]], // optional; this is an array of the language proficiencies gained. An entry can either be 1) a string that represents the language learned or 2) a number which is the number of language gained that can be chosen by the player
    
    vision : ["Darkvision", 60], //optional; An array of arrays that each have a length of 2; This adds the first value of each array to the Senses field. The second value is the range in feet. If no range is needed, put a 0 there. You can also add a modifier like "+30" or "*2" to have the appropriate calculation done with the range of sense
        
    savetxt : { // Optional; this attribute defines entries to add to the field for "Saving Throw Advantages / Disadvantages"
    
        text : ["Magic can't put me to sleep"], // Optional; this is an array of strings, and each of those strings is added to the field exactly as presented here
        
        adv_vs : ["charmed"] // Optional; this is an array of things that the character has advantage on saves against. This is put in the field after the text "Adv. on saves vs. ", so in this example it would result in "Adv. on saves vs. traps and charmed"
    },
    
    skills : ["Arcana"], //optional; Skill proficiencies the race has. This line can be deleted if you don't have anything to put here. If the race doesn't give fixed proficiencies, but instead gives a choice, delete this line and use the line below, "skillstxt"
    
    age : " reach adulthood when they master a field, typically around 100", //optional; the age tooltip/mouseover text (will be displayed in combination with the "plural" entry)
    
    height : " range from 5 to over 6 feet tall (4'9" + 2d8")", //optional; the height tooltip/mouseover text (will be displayed in combination with the "plural" entry)
    
    improvements : "Moonfolk: +2 Intelligence, +1 Wisdom;", //required; the text that is displayed when listing all the ability score improvements
    
    scores : [0, 0, 0, 2, 1, 0], //required; the ability score improvements as used by the Ability Score dialog. The syntax is: [Str, Dex, Con, Int, Wis, Cha]
    
    trait : "Moonfolk (+2 Intelligence, +1 Wisdom)\nLunar Magic:\n   I know the Dancing Lights cantrip.\n   Once I reach 3rd level, I can cast the Faerie Fire spell once per long rest.\n   Once I reach 5th level, I can cast the Moonbeam spell once per long rest.\n   Intelligence is my casting stat for these spells.", //required; the racial trait as it will be put in the Racial Trait field on the second page (note that "\n" is a line break).
    
    spellcastingAbility : 4, //required for a spellcaster; the ability score to use for spellcasting. Remove this line if your race has no spellcasting. (Str=1, Dex=2, Con=3, Int=4, Wis=5, Cha=6)
    
    spellcastingBonus : { //optional; an object that adds something to the "Bonus Spells" section of the spell selection dialog //this object can have all the same attributes as the "spellcastingList" object as defined in the ClassList, but must also have a "name" defined //the other things that can be defined in this that are not in the "spellcastingList" object, are the "selection", "times" and "prepared" values
    
        name : "Lunar Magic (level 1)", //required; this is used to identify the object, so must be an unique name
        
        spells : ["dancing lights"], //Optional, but required if not including the "class" entry; If a "spells" array is present, all other objects will be ignored and only this list of spells will populate the list of available spells. each entry has to match the name of the spell in the SpellsList
        
        selection : ["dancing lights"], //optional if "spells" is defined; this is the default selection for the array specified in "spells"
        
        prepared : true,
        
        atwill : true, //optional; if set to 'true', this makes the spell selected for this/these bonus spells to get "At Will" in the first column
    },
    
    features : { //optional; the racial features. Each works the same way, so only a couple of example are given. You can add as many as you want. If the race has no level-dependent or limited features, you can just delete the whole feature entry all together
    
        "faerie fire" : { //note the use of lower case characters
        
            name : "Faerie Fire", //required; the name of the racial feature
            minlevel : 3, //required; the level at which the feature is gained
            
            usages : 1, //optional; number of times it can be used. This can be one value, but can also be an array of 20 values, one for each level
            
            recovery : "long rest", //required if "usages" is defined; way of getting the limited feature recharged. If you define either "long rest" or "short rest" (note the lower case), than the feature is also added to the limited features
            
            tooltip : " (Lunar Magic)", //optional; the tooltip added to the entry in the Limited Feature section, this example will read "Lesser Restoration is gainged from Something Catlike (Celestial Legacy)"
            
            action : ["action", ""],
            
            spellcastingBonus : { //optional; works just like the "spellcastingBonus" object defined above
                name : "Lunar Magic (level 3)",
                spells : ["faerie fire"],
                selection : ["faerie fire"],
                oncelr : true,
            },
            
        "moonbeam" : { //note the use of lower case characters
        
            name : "Moonbeam", //required; the name of the racial feature
            minlevel : 5, //required; the level at which the feature is gained
            
            usages : 1, //optional; number of times it can be used. This can be one value, but can also be an array of 20 values, one for each level
            
            recovery : "long rest", //required if "usages" is defined; way of getting the limited feature recharged. If you define either "long rest" or "short rest" (note the lower case), than the feature is also added to the limited features
            
            tooltip : " (Lunar Magic)", //optional; the tooltip added to the entry in the Limited Feature section, this example will read "Lesser Restoration is gainged from Something Catlike (Celestial Legacy)"
            
            action : ["action", ""],
            
            spellcastingBonus : { //optional; works just like the "spellcastingBonus" object defined above
                name : "Lunar Magic (level 5)",
                spells : ["moonbeam"],
                selection : ["moonbeam"],
                oncelr : true,
            },
            
        },
        
    }
    
};
[/sblock]
Reading this, and finding the error, would be much easier if you post it somewhere that uses JavaScript syntax highlighting, like Gist.GitHub.com. That way, you would see that the " on line 59 are causing the issue. You removed the backslashes in front of the quotation marks that indicate feet.

You have:
Code:
height : " range from 5 to over 6 feet tall (4'9" + 2d8")",

While it should be:
Code:
height : " range from 5 to over 6 feet tall (4'9\" + 2d8\")",

Because the quotation marks signal the end of a string and when there is a backslash in front of it, they are 'escaped' as it is called, they no longer signal the end of a string.

Also, you don't have a closing curly bracket } for the "faerie fire" feature.

For making your code more readable and condensed, I suggest removing all the comments (everthing after //) and removing empty lines.

Also, you set 'prepared' to true while also setting 'atwill' to true. You can't have both, as 'prepared' adds a checkbox in the first column, while 'atwill' adds the 'At Will' text in the first column. They are mutually exclusive.

You don't need a sortname if it is the same as the name.

Your regExpSearch can be simplified to just:
Code:
/moonfolk/i,
as this will match if that one word is in the string. You only need the complex syntax if you want to match more than one word, in any order. One word can't have an order, so you can just do it like this :)

You are using languageProfs wrong. It is a one-dimensional array, not an array with arrays in it. If the language is fixed, just write the name of the language as a string. If the language is a choice, you write a number of how many choices can be used. So you should make it:
Code:
languageProfs : ["Moonspeak", "Common"],

I fixed your code and put it in a GitHub Gist here.
 

Does everybody's "inspiring leader" feat auto-fill properly?
Does everybody's "Linguist" feat auto-fill properly?
I guess you are referring to the scripts for PHB material found on the /r/mpmb subreddit? For any issues with it, contact the person who made those, which isn't me. Note that using the content of those scripts is a violation of WotC's copyright, so I can't endorse it at all!
 



Remove ads

Top