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] D&D 5e Shaped NPC & Spell Importer

1450729264
Kryx
Pro
Sheet Author
API Scripter
FYI monsters have been updated for the errata.
thank you
1451348862

Edited 1451348889
Kryx said: Cameron R. said: It started with Mage, I eventually found it froze the API so I had to re-save/refresh to start it again, I tested it on archmage and druid and both had the same result. This was done via !shaped-monster. Mage and Druid worked for me. Make sure you're not using the latest sheet (default shaped should work). And ensure you're using the latest scripts as well as monsters and spells format. Lots of moving parts that can go wrong, sorry about that, but I can't make it any better in roll20. I'm having the same issue with the freezing API when attempting to import/update with !shaped-monster for creatures with spellcasting blocks. I have to restart the API after attempting these imports. Was there anything in particular that was his issue? !shaped-import works and !shaped-spell works, but something just doesn't work for spellcasters for the !shaped-monster one. Dec 21 sheet, with Dec 9 shaped scripts.
1451349284
Kryx
Pro
Sheet Author
API Scripter
What monster doesn't work for you?
Kryx said: What monster doesn't work for you? Tested several casters, including the mentioned basic Mage NPC.
1451350486
Kryx
Pro
Sheet Author
API Scripter
It's possible that either the script or monsters are setup incorrectly. Check the dist folder on my github. If that doesn't work then invite me and I can try to fix it. Though I'm on vacation until tomorrow night.
Thorsten B. said: You are right that roll20 would need a "show dim as bright" option to really make this work right. Don't bother making this a setting. I'm probably the only one who even wants it, and I fiddled your code to do that for my tokens.  No, you aren't the only one who wants this. The rule does say see dim as bright light and using the multiplier is the only way we can achieve that for now.
@Kryx/mlenser I've noticed that some spells have info duplicated in their Description and Effects fields. Is this intentional? If not I'll send a PR cleaning up a few.
1452333688
Kryx
Pro
Sheet Author
API Scripter
Description is meant to be just the plain spell text. The rest of the fields take parts of that and break it out. The other option would be to parse it in JS, but it'd be near impossible to do so as the words and syntax on spells are not consistent. Therefore I did it by hand. So you have the full text in description, some text in emote, some in the save/attack/damage, some in save fails, some in effects. This is so it imports into the sheet correctly. It's intentional.
Mark, I can't seem to get the Planetar or Solar to update using the Monster Importer. Each time I try, the script just stops working and I need to refresh my scripts. I'm wondering if it's just too much information to process at once for my internet connection. The Aboleth did work for me just fine as do the few Dragon's I've imported. Also, random question, how complicated would it be to get a macro similar to the query one for save and checks, that would add the Legendary Actions as token macros?
1452342669
Kryx
Pro
Sheet Author
API Scripter
Both worked fine for me (besides "multiattack_script" issue for Planetar, but it still worked. The issue is likely the amount of spells being imported... not sure how to fix that. query macros are a pain. Ask Silvyre to make them and I can add them to the sheet or importer. :P Or you can make them and I can add them.
Thanks, also, is there a way to just tell the importer to not import spells automatically?
1452343047
Kryx
Pro
Sheet Author
API Scripter
Not currently, no. I can add such a flag. But I'd prefer to fix the issue. How long do you wait when importing? Maybe try 2 minutes to see if it goes eventually. Unfortunately the way the scripts are setup the logging don't seem to print until the whole thing is run so I can't really debug the issue either.
I usually wait a minute to see if it resolves. I'll try waiting longer to see if it goes eventually. Don't worry about the flag, I can work around it. Fixing the root of the problem is more important. :)
One curiosity I noticed: When removing any spells *above* any imported spells, all of the imported spells get set to an action time of "longer" with a blank field. I'm guessing this is an issue with roll20 itself and not the charsheet? I know they've been doing work on the repeating sections stuff lately.
1452363144
Kryx
Pro
Sheet Author
API Scripter
Jason H. said: One curiosity I noticed: When removing any spells *above* any imported spells, all of the imported spells get set to an action time of "longer" with a blank field. So you first import a spell and then remove some and all of them have their time set to longer? Seems crazy... Can you give me a full reproduction path please?
1452373617

Edited 1452373791
Something like that ? (gif, click on image if nothing move) If so, this is an old bug (so, not related to the new stuff, see  here ), and it affects all spells, not only imported one.
1452373790
Kryx
Pro
Sheet Author
API Scripter
Wtf.... that's madness. I noticed some spells being "longer" the other day. Definitely a bug that needs to be filed with roll20. Use that Gif to show it.
Thanks for the handy gif, Alzam! Reported the issue:&nbsp; <a href="https://app.roll20.net/forum/post/2808437/radio-gr" rel="nofollow">https://app.roll20.net/forum/post/2808437/radio-gr</a>..
@Kryx/mlenser: Looks like wrapping the radio group in a &lt;fieldset&gt; may avoid this bug. Although not sure if that causes other issues. At minimum it would require some style adjustments.
1452382885
Kryx
Pro
Sheet Author
API Scripter
Hmm.. strange. I'll wait for that bug to be answered before making any changes.
Pardon the dumb question, but how do I use this script? I've used it before by copying the basic monster stat blocks from the wizard's site, but is there another way? Can I type my own plain text stat blocks in a certain format and have them work? What about spells? That is new to me. I haven't been on here in a long time...
1452417450
Kryx
Pro
Sheet Author
API Scripter
You can use either "!shaped-import" (put the info in the GM notes) or the "!shaped-monster" (put the data in a json file). Check out my github for some examples of how to use !shaped-monster.
where do I set up bar 2 to capture speed in a token?
Den G. said: where do I set up bar 2 to capture speed in a token? You probably want something like this: { name: 'HP', // Green bar max: true, link: false, show: true }, { name: 'speed', //Blue bar 'speed' max: false, link: false, show: false }, { name: 'npc_AC', // Red bar max: false, link: false, show: false },
1452660181

Edited 1452672117
I'm not getting anything in the output console edit: make sure to name them with a .js at the end.&nbsp; derp
@Kryx Question about 5e-scripts.js. &nbsp;What can I change in the script to make npc_AC and HP appear in different bars? &nbsp;My players requested that their HP appear above their tokens so it doesn't block the token image, so I have the HP set to bar 2. Also, is there something I can add that will set these to Yes? "Character Name on all roll templates" "Show Targets AC on Attacks" "Show Targets Name on Attack and Saves"
Kaelev said: @Kryx Question about 5e-scripts.js. &nbsp;What can I change in the script to make npc_AC and HP appear in different bars? &nbsp;My players requested that their HP appear above their tokens so it doesn't block the token image, so I have the HP set to bar 2. Also, is there something I can add that will set these to Yes? "Character Name on all roll templates" "Show Targets AC on Attacks" "Show Targets Name on Attack and Saves" The reply I put above to Dan G. should basically tell you what you need to know about putting it in different orders. You can put those 3 segments in any order you like. On mine, I have it HP, AC, then Speed (reversing AC and Speed from the default script) to match how I had my tokens all set up before I started using the script.&nbsp; for the rest, make these changes.&nbsp; On line 9: showCharacterNameOnRollTemplate: true, //show the character's name on their roll templates On line 20-21: attacksVsTargetAC: true, //show the target's AC when using attacks attacksVsTargetName: true, //show the target's Name when using attacks
Awesome. Is there any particular place I need to put that into the script for the bars?
1452810978
Kryx
Pro
Sheet Author
API Scripter
On lines 9, 20, and 21 like he mentioned. Just switch false to true on those lines.
Kryx said: On lines 9, 20, and 21 like he mentioned. Just switch false to true on those lines. I was talking about the code for the HP/AC bars. The one he posted a few posts up. Can it go anywhere?&nbsp;
1452814002

Edited 1452814092
Kaelev said: Kryx said: On lines 9, 20, and 21 like he mentioned. Just switch false to true on those lines. I was talking about the code for the HP/AC bars. The one he posted a few posts up. Can it go anywhere?&nbsp; check from lines 30-50. that's the area you need to modify.
So I'm having a bit of an odd problem myself. I just started using the spell importer part of the script today. I have the latest version of the script, and I believe I have the JSON set up correctly. I've been able to import several spells (magic missile, fireball, sleep, dispel magic) without incident. But other spells (hellish rebuke, absorb elements) result in a spell entry that is actually missing the fields. the fields aren't blank. They're just gone. What am I doing wrong?
Is there a database somewhere that we can use to import monsters and spells? I just got the new 5E SRD and it works well for the monsters. I haven't tried it with spells yet. What is the command for spells? !Spell-Import??? Thanks!
Wade said: Is there a database somewhere that we can use to import monsters and spells? I just got the new 5E SRD and it works well for the monsters. I haven't tried it with spells yet. What is the command for spells? !Spell-Import??? Thanks! Check the first post on page 1 for instructions on how to set it up for monster and spell importing, and what the commands are.&nbsp;
when importing monsters with spells, i am getting 3 copies of each spell, collated, in the spellbook on the character sheet. example !shaped-monster --drow priestess of lolth not sure whats going on
1452859597

Edited 1452859636
Kryx
Pro
Sheet Author
API Scripter
marty r. said: when importing monsters with spells, i am getting 3 copies of each spell, collated, in the spellbook on the character sheet. example !shaped-monster --drow priestess of lolth not sure whats going on I can not reproduce this issue. I tried with "!shaped-monster --drow priestess of lolth" which appears to have worked fine (besides conjure animals having the 2 giant spiders part). Maybe it's best to ensure you have the latest script version and monsters. If that still fails please send me an invite so I can verify.
Kryx said: marty r. said: when importing monsters with spells, i am getting 3 copies of each spell, collated, in the spellbook on the character sheet. example !shaped-monster --drow priestess of lolth not sure whats going on I can not reproduce this issue. I tried with "!shaped-monster --drow priestess of lolth" which appears to have worked fine (besides conjure animals having the 2 giant spiders part). Maybe it's best to ensure you have the latest script version and monsters. If that still fails please send me an invite so I can verify. tested twice before sending this....and of course it works fine after you reply. i must have been doing something wrong.
1452882472

Edited 1452882637
Ok, I've tried using the instructions from the first post, I've tried to find stuff on git hub and I've read through most of the forum posts. I can post a monster/npc stat block into a token's GM Notes box and use "!shaped-import" and it imports the creature fine for the most part, but I imported a spellcaster last night and it didn't do anything with the spells. Am I doing something wrong? Marty R. (the post above this one) seems to have been able to import spells in. Please help. Thanks! EDIT: If I try something like "!shaped-monster --drow priestess of lolth" I get a message that says "(From Shaped): Exception: ReferenceError: fifthMonsters is not defined". That sounds like it is looking for a data base of some sort. Is there another script I should have running that acts as a database?
Also having the same issue where spells are not going in. Comes up with&nbsp;"Finished importing spells: entangle,phantasmal force,disguise self,invisibility" but in the monster it doesnt show spells there. I'm pretty new to this and may be doing something wrong...&nbsp; I was having a problem because I wasnt linking the token with the created one but have that sorted now.&nbsp; What am I doing wrong with spells?
@Kryx Do you have an example of a monster with lair and legendary actions? &nbsp;If it's already not added, I'd like to take monsters from Out of the Aybss and other expansions and add it to the 5e-monsters script.
1452942079
Kryx
Pro
Sheet Author
API Scripter
Legendary actions - Unicorn. The parser already can import the monsters from out of the abyss. See my github dist folder for examples.
1453073966

Edited 1453083212
Hi again, I've been happily using the spell and monster importers until recently (during the last week). &nbsp;Have triple checked I have the latest versions from the dist folder on github. &nbsp;Using the current 5e shaped character sheet on the standard (non-Dev) server. Basically as others above seem to have found sometimes, monsters with lots of spells just don't import. &nbsp;API basically never comes back (I think "goes to lala land" is the technical term) and after 2 minutes or so I have to restart it. &nbsp;Over and over again. Here's just a handful that simply won't import for me: Aerisi Kalinoth Lich [This used to work fine for me] Windharrow [Kicking myself I deleted the previous version to refresh it] Mage Androsphinx I'll also paste examples of those that do work below. (Can't post anything for those that don't.) I speculate whether there are a few spells causing problems? &nbsp;But you're right, the crap logging means I can put log calls in there but since the API hangs I never get to see any debugging info. &nbsp;It would probably be good to make automatic spell importing optional for now (even though I love it). (I might do this for some of the problem entries actually and check importing their spells manually works. &nbsp;Still annoyed at losing hours to this problem last night, since I'm pretty confident it's a Roll20 issue not your scripts - which worked fine on some of the same creatures previously.) Incidentally, the spellcasting DC and attacks are frequently incorrect "out of the box" since the stat defaults to Int. &nbsp;It would be cool if the script parsed the Spellcasting field to set the caster stat. &nbsp;It would be even cooler if the spell slots were populated too. &nbsp;If you have the time and inclination. &nbsp;Also, sometimes information about grappling doesn't seem to be included in attack effects. &nbsp;Example: Giant Octopus. Thanks for all your work! 2:54AM (From Shaped): Skyweaver created 2:54AM (From Shaped): Finished importing spells: blade ward,light,message,ray of frost,shocking grasp,feather fall,mage armor,witch bolt,gust of wind,invisibility,fly,lightning bolt 2:28AM (From Shaped): Wiggan Nettlebee created 2:28AM (From Shaped): Finished importing spells: guidance,light,mending,shillelagh,thaumaturgy,animal friendship,cure wounds,healing word,inflict wounds,speak with animals,barkskin,spike growth,spiritual weapon 2:24AM (From Shaped): Hurricane created 2:24AM (From Shaped): Error setting empty value: multiattack_script 2:24AM (From Shaped): Finished importing spells: blade ward,gust,light,prestidigitation,feather fall,jump,thunderwave,gust of wind 1:31AM (From Shaped): Howling Hatred Priest created 1:31AM (From Shaped): Error setting empty value: multiattack_script 1:31AM (From Shaped): Error: cannot find a spell by the name of "featherfall". 1:31AM (From Shaped): Finished importing spells: blade ward,gust,light,prestidigitation,shocking grasp,featherfall,shield,witch bolt,dust devil,gust of wind,gaseous form 12:25AM (From Shaped): Acolyte created 12:25AM (From Shaped): Finished importing spells: light,sacred flame,thaumaturgy,bless,cure wounds,sanctuary
OK, after more testing, it seems that if the list of spells is too long it hangs. &nbsp;I disabled the auto add which created the character OK for spellcasters, but then when I used !shaped-spell to import the list, it still didn't work (hang with restart required) unless I chopped the list in half and did it in two goes or similar. &nbsp;Any idea what could be causing this all of a sudden?
Sredni Vashtar said: OK, after more testing, it seems that if the list of spells is too long it hangs. &nbsp;I disabled the auto add which created the character OK for spellcasters, but then when I used !shaped-spell to import the list, it still didn't work (hang with restart required) unless I chopped the list in half and did it in two goes or similar. &nbsp;Any idea what could be causing this all of a sudden? How did you turn off auto add for spells?
1453128413
Kryx
Pro
Sheet Author
API Scripter
Sredni Vashtar said: Any idea what could be causing this all of a sudden? This isn't new behavior. I do not know why roll20's api just dies with many spells. I will add a command to import the monster w/o spells.
Kryx said: This isn't new behavior. I do not know why roll20's api just dies with many spells. The API might have some sort of limitation on the time a single script can run (maybe as infinite loop protection?). &nbsp;I've had issues importing very large lists into a rollable table using one of Aaron's scripts. &nbsp;It works fine with 500 items, but 1000+ it dies. &nbsp;Usually in the 600-700 range.
1453135429
Kryx
Pro
Sheet Author
API Scripter
Three of Swords said: The API might have some sort of limitation on the time a single script can run (maybe as infinite loop protection?). &nbsp;I've had issues importing very large lists into a rollable table using one of Aaron's scripts. &nbsp;It works fine with 500 items, but 1000+ it dies. &nbsp;Usually in the 600-700 range. The looping isn't even big. It looks through a list of around 420 items and then takes that item and sets it to some attributes&nbsp;in roll20. Likely the issue is the amount of attributes set.
Any help for the problem I posted above where importing level 1 spells for one of the players in my group (it only seems to affect her) causes spell descriptions with all the fields after casting time missing?
1453201768
Kryx
Pro
Sheet Author
API Scripter
Clinton: if it's only happening to one player in your group I'd suggest clearing out all level 1 spells and then trying to reimport them all. If that does not fix it please invite me to your campaign.