
Hi all,
Here is a script to automaticaly create a Monster character sheet from a statblock. Create a token, paste statblock text in GM notes fields, optionnaly put 2 line break to separate bio/flavor text at the end, then type !jf-parse command in chat.
The script will populate the NPC sheet (except for Lair Action) and create token action.
Git: https://github.com/jfrondeau/roll20/blob/master/statblock-import-5e.js
Update to 2.4.
Update 2.3
Update 2.1
Update 2.0
Update 1.3:
D&D 5e Statblock to Roll20.net character
This script parse the content from a token GM note to create a complete 5e monster character sheet. If the monster already exist, it will be updated. Actions are imported as inline roll, but the average value are keep too.
Usage: copy statblock from PDF to a token gmnotes. Write !jf-parse in chat and press enter!
Options: (Add those line add the end of the script to change options)
jf.createAbilityAsToken = true; //default true: Each action will be selected as token action.
The script can work arround some bad OCR pdf input, but if there is something wrong, here are the rules the script follow.
Rules:
Keyword: The script need to find the keyword from the official 5e statblock, each starting a new line. The attributes values can span on multiple line without problem.
Name: Must be the first line of statblock. Size: If included, must be the second line.
Flavor text (bio): If included, must be at the end of the statblock and separate by at least 2 empty line form the statblock.
Traits, actions and legendary action: They are detected by capitalized word at the start of a line followed by a period. If statblock include Traits, the Actions keyword must be present to separate Traits from Actions.
Ability Scores need to be include or already on the character sheet for the script to calculate the real bonus value for Skills and Saving Throw since they include ability modifier in the monster statblock.
Abilities can be each one on is line (like from OCR PDF), be one 2 lines, the first starting with STR and second containing all the abilities in right order (like official PDF), or even be all on the same line if the line start with "str".
All the token are listed below, and are case insentitive:
armor class, hit points, speed, str, dex, con, int, wis, cha, saving throws, skills, damage resistances, damage immunities, condition immunities, damage vulnerabilities, senses, languages, challenge, traits, actions, legendary actions.
Here is a script to automaticaly create a Monster character sheet from a statblock. Create a token, paste statblock text in GM notes fields, optionnaly put 2 line break to separate bio/flavor text at the end, then type !jf-parse command in chat.
The script will populate the NPC sheet (except for Lair Action) and create token action.
Git: https://github.com/jfrondeau/roll20/blob/master/statblock-import-5e.js
Update to 2.4.
- Added parameters for setting the bar max value or not.
- Gmnote are now added to the sheet (like before)
- Added basic cloning token functionnality. The token image need to be from an uploaded image to your library. This is a restriction from roll20.net. Select a token and use command !jf-clone X where X is the number of clone, or better, create a macro with this text without quote: "!jf-clone ?{Number|1}". The token name will have a random number append to it.
Update 2.3
- Add character name to token.
- Send HP roll to GM only.
- Correct setting value to token bar when value contain a inline roll recursively.
- NOTE that Bar1 (Green) set to HP, Bar2 (Blue) set to AC, Bar3 (Red) set to Speed by default. Should I disable those by default?
Update 2.1
- Corrected bug that strip first character from bio and remove some forgotten debug log.
- Added option to set token bar to any character sheet attributs. Just set the jf.parsebarX option to '' if you don't want to use that bar.
- Added option to auto roll HP when dragging character sheet to board. you can also use the !jf-rollhp command and every token selected will have their HP rolled. You need to set one of the bar option to 'npc_HP'.
- Finally another option to specify if creature random HP should not be lower than the average value from the statblock.
- Check the first line of script to find those option.
Update 2.0
- Rewrite statblock parsing engine. Now more tolerant to bad scan and power/action detection is better.
- Full compatible with Roll Template. Markdown used on trait name to separated them since line break can't be use in Roll Template. Remove support for PowerCard.
- Include Legendary action in action.
- Remove /w GM in traits since Actoba add global option in sheet for that.
- More robust trait and actions parsing.
- Multiattack is now added as an ability (and token action) that run all the attack when used.
Update 1.3:
- Skills typo and skill with space should be ok now. If wrong skill is read, the script should not crash but display the error.
- By defaut, the token used for source will represent the imported character. You still need to Edit the character and click "Use selected token", but now I save this step.
- All actions are also created as Character Ability macro. By default, they are set as token action bar, but you can set jf.createAbilityAsToken =false by uncommenting the last line.
D&D 5e Statblock to Roll20.net character
This script parse the content from a token GM note to create a complete 5e monster character sheet. If the monster already exist, it will be updated. Actions are imported as inline roll, but the average value are keep too.
Usage: copy statblock from PDF to a token gmnotes. Write !jf-parse in chat and press enter!
Options: (Add those line add the end of the script to change options)
jf.createAbilityAsToken = true; //default true: Each action will be selected as token action.
The script can work arround some bad OCR pdf input, but if there is something wrong, here are the rules the script follow.
Rules:
Keyword: The script need to find the keyword from the official 5e statblock, each starting a new line. The attributes values can span on multiple line without problem.
Name: Must be the first line of statblock. Size: If included, must be the second line.
Flavor text (bio): If included, must be at the end of the statblock and separate by at least 2 empty line form the statblock.
Traits, actions and legendary action: They are detected by capitalized word at the start of a line followed by a period. If statblock include Traits, the Actions keyword must be present to separate Traits from Actions.
Ability Scores need to be include or already on the character sheet for the script to calculate the real bonus value for Skills and Saving Throw since they include ability modifier in the monster statblock.
Abilities can be each one on is line (like from OCR PDF), be one 2 lines, the first starting with STR and second containing all the abilities in right order (like official PDF), or even be all on the same line if the line start with "str".
All the token are listed below, and are case insentitive:
armor class, hit points, speed, str, dex, con, int, wis, cha, saving throws, skills, damage resistances, damage immunities, condition immunities, damage vulnerabilities, senses, languages, challenge, traits, actions, legendary actions.