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

[Script] Statblock import for 5e character sheet

February 15 (10 years ago)

Edited April 11 (10 years ago)
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.

  • 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.
Update 1.6
  • 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.


February 16 (10 years ago)
The Aaron
Pro
API Scripter
Awesome!

I think you meant: https://github.com/jfrondeau/roll20/blob/master/st...

Also, I'd suggest just ignoring other api commands as this code will execute for any API command that isn't yours:
    if (command != "!build-monster") {
        sendChat('GM', "Commande " + command + " invalide");
        return;
    }

Thank you Aaron. Updated.
I'm already working on a cleaner version with namespacing, replace french and other optimization.
February 16 (10 years ago)
The Aaron
Pro
API Scripter
Very cool!!
February 16 (10 years ago)
@Jean-Francois R.,

This is really awesome, I can very much appreciate the time and effort required to make this. I tested a few things with it and had some trouble with it (Owlbear and Pegasus failed, while Peryton worked well). As I have many scripts in place, I couldn't figure out where the problems were, guessing that something expected was missing. I plan to setup a new Sandbox and give it a go.

One thing that I know would be nice is processing actions to include inline rolls, for example if there is a Weapon Attack that is +5 to hit, making that [[1d20+5]] would be awesome (same for damage).

Please let me know if there is anything I can help to test with!


February 16 (10 years ago)
I tried with Skeleton and it didn't work.
Stat Block Pasted: (From the Monster manual)
Skeleton
Medium undead, lawful evil

Armor Class 13 (armor scraps)
Hit Points 13 (2d8 + 4)
Speed 30 ft.
STR 10 (+0)
DEX 14 (+2)
CON 15 (+2)
INT 6 (-2)
WIS 8 (-1)
CHA 5 (-3)

Damage Vulnerabilities bludgeoning
Damage Immunities poison
Condition Immunities exhaustion, poisoned

Senses darkvision 60ft., passive Perception 9
Languages understands all languages it knew in life but
can't speak
Challenge 1/4 (50 XP)
Shortsword. Melee Weapon Attack: +4 to hit, reach 5 ft., one
target. Hit: 5 (1d6 + 2) piercing damage.
Shortbow. Ranged Weapon Attack: +4 to hit, range 80f320 ft .,
one target. Hit: 5 (1d6 + 2) piercing damage.


This is the API Error I receive...
TypeError: Cannot call method 'substring' of undefined
at splitRegex (evalmachine.<anonymous>:1979:36)
at splitSection (evalmachine.<anonymous>:2108:24)
at parse (evalmachine.<anonymous>:1991:29)
at evalmachine.<anonymous>:1962:12
at eval (
February 17 (10 years ago)

Edited February 17 (10 years ago)
The script have been updated to work even if the Actions keyword is not found.
Bobby: It will now correctly parse the skeleton stablock you post. Thank you to provide me example of statblock.
Kevin: I tested the last version with the pegasus and Owlbear. They pass now. Thank you for the feedback.

Also, my script should not interfere with other now.

February 17 (10 years ago)
Actually...Thank you for the script.

February 17 (10 years ago)
Excellent! I will test the new version of the script tomorrow! Thank you very much for this script Jean-Francois!
February 17 (10 years ago)
This is F'ing amazing mate! In terms of workflow, cleaning up the statblock from a PDF copy/paste is much faster that inputing all the data manually.
February 17 (10 years ago)

Edited February 17 (10 years ago)
I just wanted to come back, and say again, my mind is totally blown my this one.

So I thought I would help others out. This is the formatting that got me the best results, which I think will help people understand how to get the cleanest output. My comments are behind "//" and in all CAPS. If you want to try it out, just copy/paste this text, taking out all the "// CAPS"

Creature Name
Medium humanoid (sahuagin), lawful evil //NAME AND SIZE TYPE ALIGNMENT GO ON 2 LINES
Armor Class 10 (natural armor) //EACH ITEM (AC, HP, Speed) SHOULD BE SEPARATED BY A LINE BREAK
Hit Points 22 (4d8 + 4)
Speed 30ft., swim 40 ft.
STR 13 (+1) //SPACING DOESN'T SEEM TO MATTER THAT MUCH, BUT EACH STAT SHOULD BE ON ITS OWN LINE//
DEX 11 (+0)
CON 12 (+1)
INT 12 (+1)
WIS 13 (+1)
CHA 9 (- 1)
Skills Perception +5
Senses darkvision 120ft., passive Perception 15
Languages Common, Elven
Challenge 1/2 (100 XP)
Blood Frenzy. The creature has advantage on melee attack rolls against any creature that doesn't have all its hit points. //EACH ITEM IN ITS OWN LINE, AND THIS WILL GO INTO TRAITS. TRAIT NAME, PERIOD. FOLLOWED BY DESCRIPTION.
Limited Amphibiousness. The creature can breathe air and water, but it needs to be submerged at least once every 4 hours to avoid suffocating.
Shark Telepathy. The creature can magically command any shark within 120 feet of it, using a limited telepathy.
ACTIONS // THIS PART MARKS WHERE THE NPC ACTIONS START.
Multiattack. The creature makes two melee attacks: one with its bite and one with its claws or spear. //SCRIPT CORRECTLY PLACES MULTIATTACK, INTO THE MA LINE.
Bite. Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 3 (1d4 + 1) piercing damage.
Claws. Melee Weapon Attack: +3 to hit, reach 5 ft., one target. Hit: 3 (1d4 + 1) slashing damage.
Spear. Melee or Ranged Weapon Attack:+3 to hit, reach 5 ft. or range 20/60 ft., one target. Hit: 4 (1d6 + 1) piercing damage, or 5 (1d8 + 1) piercing damage if used with two hands to make a melee attack. //ONLY THING TO NOTE IS THAT MY COPY PASTELIKED TO TURN 1's into L's AND SCRIPT DOES NOT TURN ON MULTIATTACK FOR ATTACKS THAT HAVE THEM, SO YOU'LL DO THAT MANUALLY

So my workflow is to copy the monster from the PDF into a text editor. My text recognition isn't that great, and so there are usually more than a few errors, but mostly its about finding and correcting the bad line breaks. Line up all the items like the example above. Find a token for the monster, drop it onto the map. Copy/Paste the text into the GM Only box for the token. Then use !build-monster.

This script drops all relevant information into the Actoba 5e character sheet attributes. Then I quickly scan the character sheet to make sure everything is where it's suppose to be. If there's an error, I re-read my text version first back in my text editor. I make corrections, based on how I assume the script is reading or misreading my text file. To make the actual correction I re-copy/paste the edited text version back into the GM Only box on the token, then I re-run !build-monster. This way, I'll always have my correct text file, if I need to rebuild the monster somewhere else.

If I get the text version right the first time, then the whole process takes about 2 minutes. Manually inputing all the monster stats took me about 5-10.

Again, great work Jean-Francois. Merci!

February 17 (10 years ago)
One suggestion Jean-Francois.

In the traits section, can you get it to insert "/w GM" after the first line and before every entry? The way the trait box works now, everything after a hard return is sent to the general chat. But I figure that monster traits will commonly be an unknown to players, unless the GM decides otherwise.
February 17 (10 years ago)

Edited February 17 (10 years ago)
Ari K: Thank you. I should put some more detailed indications about how the script work in first place.

The script work by following the official statblock format. He can work arround some bad OCR pdf input, but he need to find the correct "official" keyword, each one starting a new line. The attributes values can span on multiple line without problem. All the token are listed on the OP, and are case insentitive.

Abilities can be each one on is line (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".

Ari K: Did you paste text on text editor only to view if your texte contain bad line break? This is a step that you shouldn't have to do.

Thank you for the suggestion.

If a statblock don't work well, post it so I can improve the script.


February 17 (10 years ago)

Jean-Francois R. said:

Ari K: Thank you. I should put some more detailed indications about how the script work in first place.

The script work by following the official statblock format. He can work arround some bad OCR pdf input, but he need to find the correct "official" keyword, each one starting a new line. The attributes values can span on multiple line without problem. All the token are listed on the OP, and are case insentitive.

Abilities can be each one on is line (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".

Ari K: Did you paste text on text editor only to view if your texte contain bad line break? This is a step that you shouldn't have to do.

Thank you for the suggestion.

If a statblock don't work well, post it so I can improve the script.



I think my scan is particularly bad, since I don't have a decent scanner.

I use the text editor, because it gives me more granular way to ensure correct text formatting. I'm also working on the Dev server, and things can go wrong, so its nice to have a back up, since I'm making a lot of corrections in my stat blocks, if I need to re upload a monster.

And thanks for explaining how the script reads ability. My OCR is bad enough that sometimes it does "STR DEX CON 10 10 10 INT 10 WIS 10 CHR 10" but knowing they can all be on one line, will speed up corrections.

Again, this is definitely the script that saves me the most amount of time, since I like to have all the monsters at my disposal during my Sandbox game.
February 17 (10 years ago)

Edited February 17 (10 years ago)
Can the script be altered so that when the attribute / abilities is populated on the character sheet I can have it customized to fit the macros that I already have set up with my characters and monsters already created.
For example:
I use Str_Mod, Dex_Mod, Int_Mod etc.. and the attack macros use these variables to perform the attack properly.
Also can the script add name into the Attributes area as well?
Macro Example:
/em Myrina Goes For A Sneak Attack!
[[{2d20KH1}+@{Sneak Attack}+@{Dex Mod}]] vs @{target|Name}'s @{target|AC}AC
[[d8+@{Dex Mod}]]+[[d6]] Damage!

If so can someone show or tell me where and how to do this?

Thanks all

February 18 (10 years ago)

Edited February 18 (10 years ago)

Bobby said:

Can the script be altered so that when the attribute / abilities is populated on the character sheet I can have it customized to fit the macros that I already have set up with my characters and monsters already created.
For example:
I use Str_Mod, Dex_Mod, Int_Mod etc.. and the attack macros use these variables to perform the attack properly.
Also can the script add name into the Attributes area as well?
Macro Example:
/em Myrina Goes For A Sneak Attack!
[[{2d20KH1}+@{Sneak Attack}+@{Dex Mod}]] vs @{target|Name}'s @{target|AC}AC
[[d8+@{Dex Mod}]]+[[d6]] Damage!

If so can someone show or tell me where and how to do this?

Thanks all


You can use the ability modifier from charater sheet like this: +@{npc_dexterity_mod}. Since the script create a NPC, all the attribut name start with npc_. That how the 5e character sheet was built. You can use your browser "inspect element" to get the name of a field, then remove the attr_ prefix to get the name to use in macro.

February 19 (10 years ago)
Jean-Francois,

This works very well, I created upwards of 15-20 monsters all imported quite nicely. Thank you for this.

One suggestion based on building an importer for Hero Labs and Pathfinder is that you should remove the text from the gmnotes of the token (keeping in the journal is fine). I don't fully understand the reasoning, but it has to do with how token gmnotes are stored, if you have a lot of tokens with a significant amount of text it can impact performance.

Also in order to improve functionality and help those who are less familiar with macros, I am wondering if you would consider making rolls in the actions section automatically setup for inline rolls, for example the attack of the Water Weird is:

Constrict. Melee Weapon Attack: +5 to hit, reach 10ft., one creature. Hit: 13 (3d6 + 3) bludgeoning damage. If the target is Medium or smaller, it is grappled (escape DC 13) and pulled 5 feet toward the water weird. Until this grapple ends, the target is restrained, the water weird tries to drown it, and the water weird can't constrict another target.

It imports nicely, but having it create the action as:
Description: Melee Weapon Attack: [[1d20+5]]|[[1d20+5]] to hit, reach 10ft., one creature.
Effect: Hit: 13 [[3d6 + 3]] bludgeoning damage.... (shortening this, but I think it illustrates the point)

This would allow the import to generate usable rolls right from the import. It's just a thought, either way thank you very much for this, helps increase content creation speed. Along with my macro creation script (for creating token actions from all rolls on the sheet) I can knock out mob creation in a couple of minutes now!

Thanks!

February 19 (10 years ago)
Another suggestion that you may want to consider is support of the 3rd party monster book from Necromancer Games called Fifth Edition Foes. The stat blocks are fundamentally different, but I think looking for some different keywords might work based on my limited understanding of your code, for example they use AC instead of Armor Class.

Anyway, if you are interested in exploring this send me a PM and I can share with you some examples.
Thank for your feedback Kevin.
Setting inline roll in action is definetly the next update I will do. Maybe even add those action to the token macro bar.
For an alternate statblock format, it will be easy if it's only the keyword that change. Just a flag on the token, a parameter on the command line or even better a word that I can detect on statblock and then switch the keyword set accordingly It's something I can put on my todo.
February 19 (10 years ago)
Jean-Francois, sounds great! I will send you an example statblock in a PM so you can evaluate the effort.

Ari K. said:

One suggestion Jean-Francois.

In the traits section, can you get it to insert "/w GM" after the first line and before every entry? The way the trait box works now, everything after a hard return is sent to the general chat. But I figure that monster traits will commonly be an unknown to players, unless the GM decides otherwise.

Included. Thank you for the suggestion.

Kevin said:



One thing that I know would be nice is processing actions to include inline rolls, for example if there is a Weapon Attack that is +5 to hit, making that [[1d20+5]] would be awesome (same for damage).

Please let me know if there is anything I can help to test with!


Done, but I don't have tested many case so if you found some actions that miss inline roll, inform me pls.

Ah this would be a god send. I already have imported 50 odd monsters manually but I didn't use Actobas Monster sheet as a base. Hopefully I can do some wiley conversions to the normal stuff. :D
February 20 (10 years ago)
Jean-Francois - Excellent! I will test these changes today as I have a few monsters to import for this weekends sessions!
February 21 (10 years ago)
Thanks for the help

This from the PDF

Acolyte
Medium humanoid (any race), any alignment
Armor Class 10
Hit Points 9 (2d8)
Speed 30 ft.
STR DEX CON INT WIS CHA
10 (+0) 10 (+0) 10 (+0) 10 (+0) 14 (+2) 11 (+0)
Skills Medicine +4, Religion +2
Senses passive Perception 10
Languages any one language (usually Common)
Challenge 1/4 (50 XP)
Spellcasting. The acolyte is a 1st-level spellcaster. Its
spellcasting ability is Wisdom (spell save DC 12, +4 to hit with
spell attacks). The acolyte has following cleric spells prepared:
Cantrips (at will): light, sacred flame, thaumaturgy
1st level (3 slots): bless, cure wounds, sanctuary
Actions
Club. Melee Weapon Attack: +2 to hit, reach 5 ft., one target.
Hit: 2 (1d4) bludgeoning damage.


This the format I tried

Acolyte
Medium humanoid (any race), any alignment
Armor Class 10
Hit Points 9 (2d8)
Speed 30 ft.
STR 10 (+0)
DEX 10 (+0)
CON 10 (+0)
INT 10 (+0)
WIS 14 (+2)
CHA 11 (+0)
Skills Medicine +4
Religion +2
Senses passive Perception 10
Languages any one language (usually Common)
Challenge 1/4 (50 XP)
Spellcasting. The acolyte is a 1st-level spellcaster. Its spellcasting ability is Wisdom (spell save DC 12, +4 to hit with spell attacks). The acolyte has following cleric spells prepared: Cantrips (at will): light, sacred flame, thaumaturgy 1st level (3 slots): bless, cure wounds, sanctuary
Actions
Club. Melee Weapon Attack: +2 to hit, reach 5 ft., one target.
Hit: 2 (1d4) bludgeoning damage.


My goal is to get all of the Monsters in from the Hoard of the Dragon Queen and Tyranny of Dragons Online Supplements.

I am thinking that if you got a stat block to work and if the monster is in one of the Online supplements then post it on send me a message. please

Thanks,



Levis Wiggins
February 21 (10 years ago)

Levis said:

My goal is to get all of the Monsters in from the Hoard of the Dragon Queen and Tyranny of Dragons Online Supplements.

I am thinking that if you got a stat block to work and if the monster is in one of the Online supplements then post it on send me a message. please

Thanks,

Levis Wiggins

Not sure if your asking for me here. Did the statblock you posted work, or not?

February 21 (10 years ago)
Jean-Francois,

Using your latest version on the DEV server I get the following error:

For reference, the error message generated was: undefined is not a function

I assume that this has to do somehow with the first line of the script, but not sure what to do to fix it.
February 21 (10 years ago)
Yes the state block above did not work.

I am not sure what i am doing wrong.

Acolyte
Medium humanoid (any race), any alignment
Armor Class 10
Hit Points 9 (2d8)
Speed 30 ft.
STR 10 (+0)
DEX 10 (+0)
CON 10 (+0)
INT 10 (+0)
WIS 14 (+2)
CHA 11 (+0)
Skills Medicine +4
Religion +2
Senses passive Perception 10
Languages any one language (usually Common)
Challenge 1/4 (50 XP)
Spellcasting. The acolyte is a 1st-level spellcaster. Its spellcasting ability is Wisdom (spell save DC 12, +4 to hit with spell attacks). The acolyte has following cleric spells prepared: Cantrips (at will): light, sacred flame, thaumaturgy 1st level (3 slots): bless, cure wounds, sanctuary
Actions
Club. Melee Weapon Attack: +2 to hit, reach 5 ft., one target.
Hit: 2 (1d4) bludgeoning damage.


Thanks,

Levis Wiggins
February 21 (10 years ago)
There is a small typo in the parseSkills function. Replace "medecine" by "medicine" in the skill list and the problem is resolved
February 21 (10 years ago)
It didn't work for me either, so I went line by line, since the formatting looked okay from a glance. I found out that for some reason the script doesn't like the skills. Take that out, and it worked for me. This is probably somethign Jean-Francois will have to look into.

Thanks for bringing this to our attention.
February 21 (10 years ago)

Skilf said:

There is a small typo in the parseSkills function. Replace "medecine" by "medicine" in the skill list and the problem is resolved

I also noticed on that same line 'persuasion' spelling did not match what would be on the US version of the monster PDF. Maybe an error, maybe french, I have no idea. Easy to miss these two though, since very few monsters have proficiency in either medicine or persuasion.
February 21 (10 years ago)
This one is not working as well

Doppelganger
Medium monstrosity (shapechanger), neutral
Armor Class 14
Hit Points 52 (8d8 + 16)
Speed 30 ft.
STR DEX CON INT WIS CHA
11 (+0) 18 (+4) 14 (+2) 11 (+0) 12 (+1) 14 (+2)
Skills Deception +6, Insight +3
Condition Immunities charmed
Senses darkvision 60 ft., passive Perception 11
Languages Common
Challenge 3 (700 XP)
Shapechanger. The doppelganger can use its action to
polymorph into a Small or Medium humanoid it has seen, or
back into its true form. Its statistics, other than its size, are the
same in each form. Any equipment it is wearing or carrying isn’t
transformed. It reverts to its true form if it dies.
Ambusher. The doppelganger has advantage on attack rolls
against any creature it has surprised.
Surprise Attack. If the doppelganger surprises a creature and
hits it with an attack during the first round of combat, the
target takes an extra 10 (3d6) damage from the attack.
Actions
Multiattack. The doppelganger makes two melee attacks.
Slam. Melee Weapon Attack: +6 to hit, reach 5 ft., one target.
Hit: 7 (1d6 + 4) bludgeoning damage.
Read Thoughts. The doppelganger magically reads the surface
thoughts of one creature within 60 feet of it. The effect can
penetrate barriers, but 3 feet of wood or dirt, 2 feet of stone,
2 inches of metal, or a thin sheet of lead blocks it. While the
target is in range, the doppelganger can continue reading its
thoughts, as long as the doppelganger’s concentration isn’t
broken (as if concentrating on a spell). While reading the
target’s mind, the doppelganger has advantage on Wisdom
(Insight) and Charisma (Deception, Intimidation, and
Persuasion) checks against the target.
February 21 (10 years ago)
Thanks for helping me the Acolyte works now

I this following do not work

Noble
Medium humanoid (any race), any alignment
Armor Class 15 (breastplate)
Hit Points 9 (2d8)
Speed 30 ft.
STR DEX CON INT WIS CHA
11 (+0) 12 (+1) 11 (+0) 12 (+1) 14 (+2) 16 (+3)
Skills Deception +5, Insight +4, Persuasion +5
Senses passive Perception 10
Languages any two languages
Challenge 1/8 (25 XP)
Actions
Rapier. Melee Weapon Attack: +3 to hit, reach 5 ft., one target.
Hit: 5 (1d8 + 1) piercing damage.
Reactions
Parry. The noble adds 2 to its AC against one melee attack that
would hit it. To do so, the noble must see the attacker and be
wielding a melee weapon.


Priest
Medium humanoid (any race), any alignment
Armor Class 13 (chain shirt)
Hit Points 27 (5d8 + 5)
Speed 25 ft.
STR DEX CON INT WIS CHA
10 (+0) 10 (+0) 12 (+1) 13 (+1) 16 (+3) 13 (+1)
Skills Medicine +7, Persuasion +3, Religion +4
Senses passive Perception 13
Languages any two languages
Challenge 2 (450 XP)
Divine Eminence. As a bonus action, the priest can expend a
spell slot to cause its melee weapon attacks to magically deal
an extra 10 (3d6) radiant damage to a target on a hit. This
benefit lasts until the end of the turn. If the priest expends a
spell slot of 2nd level or higher, the extra damage increases by
1d6 for each level above 1st.
Spellcasting. The priest is a 5th-level spellcaster. Its
spellcasting ability is Wisdom (spell save DC 13, +5 to hit
with spell attacks). The priest has the following cleric spells
prepared:
Cantrips (at will): light, sacred flame, thaumaturgy
1st level (4 slots): cure wounds, guiding bolt, sanctuary 2nd level (3 slots): lesser restoration, spiritual weapon
3rd level (2 slots): dispel magic, spirit guardians
Actions
Mace. Melee Weapon Attack: +2 to hit, reach 5 ft., one target.
Hit: 3 (1d6) bludgeoning damage.


Spy
Medium humanoid (any race), any alignment
Armor Class 12
Hit Points 27 (6d8)
Speed 30 ft.
STR DEX CON INT WIS CHA
10 (+0) 15 (+2) 10 (+0) 12 (+1) 14 (+2) 16 (+3)
Skills Deception +5, Insight +4, Investigation +5, Perception +6,
Persuasion +5, Sleight of Hand +4, Stealth +4
Senses passive Perception 16
Languages any two languages
Challenge 1 (200 XP)
Cunning Action. On each of its turns, the spy can use a bonus
action to take the Dash, Disengage, or Hide action.
Sneak Attack (1/Turn). The spy deals an extra 7 (2d6) damage
when it hits a target with a weapon attack and has advantage
on the attack roll, or when the target is within 5 feet of an ally
of the spy that isn’t incapacitated and the spy doesn’t have
disadvantage on the attack roll.
Actions
Multiattack. The spy makes two melee attacks.
Shortsword. Melee Weapon Attack: +4 to hit, reach 5 ft., one
target. Hit: 5 (1d6 + 2) piercing damage.
Hand Crossbow. Ranged Weapon Attack: +4 to hit, range 30/120
ft., one target. Hit: 5 (1d6 + 2) piercing damage.

thanks again

Levis Wiggins
February 21 (10 years ago)
Are you restructuring the abilities scores?
February 21 (10 years ago)
I did not need to do that for all of the other mods that i did, that was like 30
just a few are messing up.
I am not sure what is wrong with them I got tried of trying to fix them.


Thanks,

Levis Wiggins
February 22 (10 years ago)
I found another typo in the skill list: insight (written insigth).
So far we have spelling errors with: medicine, persuasion and insight
Yep something to do with my french speaking..:) Sorry about that. Gonna look later about those others errors.
Update 1.3:
  • Skills typo and skill with space should be ok now. If wrong skill is read, the script should not crash now.
  • 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 created as Character Ability macro. By default, they are set to be token action bar, but you can set jf.createAbilityAsToken =false by uncommenting the last line.
February 22 (10 years ago)
You sir, are a prince among men.
February 22 (10 years ago)
Great work Jean-François !

if you are interested, I have been tinkering with your script to add PowerCards Support to the ability macro which would give something like this:


I added the 2 following functions:

jf.getAttribut = function(id, name){
        if(name == undefined)
            throw("undefined attribute");
           
        var attr = findObjs({
            _type: 'attribute',
            _characterid: id,
            name: name
        })[0];
        return attr!=undefined?attr.get('current'):false;
    }

   function powercardAbility(id,npcActionNumber){
        var action_name = jf.getAttribut(id,"npc_action_name"+npcActionNumber );
        var action_desc = jf.getAttribut(id,"npc_action_description"+npcActionNumber );
        var action_effect = jf.getAttribut(id,"npc_action_effect"+npcActionNumber );
        var action_multi = jf.getAttribut(id,"npc_action_multiattack"+npcActionNumber );
        var action_type = jf.getAttribut(id,"npc_action_type"+npcActionNumber );
       
        if (action_type!==false){
            action_type=action_type.substring(action_type.indexOf("(")+1, action_type.lastIndexOf(")")).trim().toLowerCase();
            if (action_type.indexOf(" ")!=-1){action_type=action_type.substring(0, action_type.lastIndexOf(" ")).trim();}
        } else { action_type="normal"; }
        if (action_multi!==false){multi_str=" --Multiattack|Yes "; } else { multi_str=""; }
       
        var attack_type = action_desc.substring(0,action_desc.indexOf(":"));
        var attack_bonus = action_desc.substring(action_desc.indexOf(":")+1, action_desc.lastIndexOf(":")).trim();
        var attack_desc = action_desc.substring(action_desc.indexOf(","));
        var attack_string = "[[d20"+attack_bonus+"]]|[[d20"+attack_bonus+"]]";
       
        var hit_value =  action_effect.substring(action_effect.indexOf("(")+1, action_effect.indexOf(")")).trim();
        var hit_desc =  action_effect.substring(action_effect.indexOf(")")+1);
       
        var powertext = "!power --charid|"+id+" --emote|"+section.title+" uses "+ action_name +"  --format|"+action_type+" --name|"+ action_name +"  --leftsub|"+action_type+" --rightsub|"+attack_type+multi_str+" --Attack|"+attack_string+" "+attack_desc+" --Hit|"+hit_value+" "+hit_desc;
		if (jf.whisperTraitsToGm==true) {
		    powertext=powertext+" --whisper|GM";
		}
        return powertext;
    }


You can then use

jf.setAbility(id, key, "", powercardAbility(id,cpt), jf.createAbilityAsToken);

instead of

jf.setAbility(id, key, "", "%{selected|NPCAction"+cpt+"}", jf.createAbilityAsToken);

to create the ability macro.



February 22 (10 years ago)

Edited February 22 (10 years ago)
@Jean-Francois - This script is really awesome, fantastic job! The additions are really, really great!

@Skilf - If you (or anyone interested) I have a fully "Powercarded" 5e Character Sheet (which I will update when Actoba adds his planned improvements in), along with a very simple (read as ugly, but effective) script that creates token action macros for pretty much all the rolls on the sheet (as well as several custom Powercard macros and Powercard cantrips). Just send me a PM if you are interested.
February 25 (10 years ago)
The Aaron
Pro
API Scripter
Hi! I was helping debug a problem in another thread where Unexpected token s kept popping up and halting the API from running. Eventually, we narrowed it down to this script, and it seems to have gone away after removing the unicode characters and replacing them with String.fromCharCode() calls.

I'm curious if anyone else has had this issue.

This is the fix we applied. I'm not sure if the functionality is preserved, but I'll be testing tonight (Line numbers in the first column):
80	            throw("Attribut non d"+String.fromCharCode(0xc3a9)+"fini pour la valeur " + currentVal);
161	            statblock = unescape(statblock).trim().replace(/
]*>/g, '#').replace(/(<([^>]+)>)/ig,"").replace(String.fromCodeChar(0x2013), '-');
Thanks!
Update to 1.4.
Add the suggestion from Skilf about powercard but by default it 's set to false in case you want to use Roll Template instead. Juste check completely at the end of the scritp to change options.
I translate the french message in english and character '–' to prevent encoding error.

Update 1.6
More robust trait and actions parsing.
Multiattack is now added as an ability (and token action) that run all the attack when used.
Very stupid question from a newbie: Do I copy the script to a macro? Or where do I put the code? Thanks a lot!
Take a look at this tutorial on youtube https://www.youtube.com/watch?v=o69_BXjPnew
March 10 (10 years ago)
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator

Bernhard B. said:

Very stupid question from a newbie: Do I copy the script to a macro? Or where do I put the code? Thanks a lot!

The API is a Mentor level subscription benefit.
March 10 (10 years ago)
Kind of a strange issue and I have no idea why it is doing it but... No matter what I try every time I use the resulting character sheet the macro buttons whisper the results to me. I can't see to ever get them to actually just send them through chat. It works very well for creating sheets but at the moment it is next to useless for me because it is using all the fancy roll templates that no one but me can see. And yes, I did change the whisper gm to false...
Any help would be appreciated, this looks like a great script!
(note: I may be missing something obvious, and if so, I apologize)
March 10 (10 years ago)

Edited March 10 (10 years ago)
Actoba
Pro
Sheet Author
@Alice - You may want to read this post (and thread). https://app.roll20.net/forum/post/1420775/#post-16...

The NPC sheet was always designed to send the output only to the GM but people found a way around that in the previous version. That workaround will no longer work so the next update of the sheet (sitting waiting to go live when the next set of sheet updates go out will add an option at the top of the NPC sheet section to allow GM's to select whether that particular sheet should output the NPC rolls publicly or keep them private to the GM. By default they will be private.

Edit : And what I meant to say is that this is nothing to do with Jean-Francois script which seems pretty cool...and everything to do with the update the sheet got today.
March 10 (10 years ago)
Ahhh, I see. I couldn't find anything wrong with the script when I took a look at it... I guess I'll just have to eagerly await that new update for now, then. Still, this does an excellent job of putting together sheets as is.. I just want to use it to throw fancy dice rolls at my players already. D: