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

1439065634

Edited 1439065745
I tried both of these and the same issue happened: EARTH ELEMENTAL Large elemental, neutral Armor Class 17 (natural armor) Hit Points 126 (12d10 + 60) Speed 30 ft., burrow 30 ft. STR 20 (+5) DEX 8 (-1) CON 20 (+5) INT 5 (-3) WIS 10 (+0) CHA 5 (-3) Damage vulnerabilities thunder Damage Resistances bludgeoning, piercing, and slashing from nonmagical weapons Damage Immunities poison Condition Immunities exhaustion, paralyzed, petrified, poisoned, unconscious Senses darkvision 60 ft., tremorsense 60 ft., passive Perception 10 Languages Terran Challenge 5 (1800 XP) Earth Glide . The elemental can burrow through nonmagical, unworked earth and stone. While doing so, the elemental doesn't disturb the material it moves through. Siege Monster . The elemental deals double damage to objects and structures. ACTIONS Multiattack . The elemental makes two slam attacks. Slam . Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit : 14 (2d8 + 5) bludgeoning damage. Earth Elemental Large elemental, neutral Armor Class 17 (natural armor) Hit Points 126 (12d10 + 60) Speed 30ft., burrow 30ft. STR 20 (+5) DEX 8 (-1) CON 20 (+5) Damage Vulnerabilities thunder INT 5 (- 3) WIS 10 (+0) CHA 5 (- 3) Damage Resistances bludgeoning, piercing, and slashing from nonmagical weapons Damage Immunities poison Condition Immunities exhaustion, paralyzed, petrified, poisoned, unconscious Senses darkvision 60ft., tremorsense 60ft., passive Perception 10 Languages Terran Challenge 5 (1 ,800 XP) Earth Glide. The elemental can burrow through non magical, unworked earth and stone. While doing so, the elemental doesn't disturb the material it moves through. Siege Monster. The elemental deals double damage to objects and structures. ACTIONS Multiattack. The elemental makes two slam attacks. Slam. Melee Weapon Attack: +8 to hit, reach 10ft., one target. Hit: 14 (2d8 + 5) bludgeoning damage. I made the other Elementals today and a few other monsters and didn't have any issues. Only the Earth Elemental is being difficult.
DM Korgul said: I tried both of these and the same issue happened: EARTH ELEMENTAL Large elemental, neutral Armor Class 17 (natural armor) Hit Points 126 (12d10 + 60) Speed 30 ft., burrow 30 ft. STR 20 (+5) DEX 8 (-1) CON 20 (+5) INT 5 (-3) WIS 10 (+0) CHA 5 (-3) Damage vulnerabilities thunder Damage Resistances bludgeoning, piercing, and slashing from nonmagical weapons Damage Immunities poison Condition Immunities exhaustion, paralyzed, petrified, poisoned, unconscious Senses darkvision 60 ft., tremorsense 60 ft., passive Perception 10 Languages Terran Challenge 5 (1800 XP) Earth Glide . The elemental can burrow through nonmagical, unworked earth and stone. While doing so, the elemental doesn't disturb the material it moves through. Siege Monster . The elemental deals double damage to objects and structures. ACTIONS Multiattack . The elemental makes two slam attacks. Slam . Melee Weapon Attack: +8 to hit, reach 10 ft., one target. Hit : 14 (2d8 + 5) bludgeoning damage. Earth Elemental Large elemental, neutral Armor Class 17 (natural armor) Hit Points 126 (12d10 + 60) Speed 30ft., burrow 30ft. STR 20 (+5) DEX 8 (-1) CON 20 (+5) Damage Vulnerabilities thunder INT 5 (- 3) WIS 10 (+0) CHA 5 (- 3) Damage Resistances bludgeoning, piercing, and slashing from nonmagical weapons Damage Immunities poison Condition Immunities exhaustion, paralyzed, petrified, poisoned, unconscious Senses darkvision 60ft., tremorsense 60ft., passive Perception 10 Languages Terran Challenge 5 (1 ,800 XP) Earth Glide. The elemental can burrow through non magical, unworked earth and stone. While doing so, the elemental doesn't disturb the material it moves through. Siege Monster. The elemental deals double damage to objects and structures. ACTIONS Multiattack. The elemental makes two slam attacks. Slam. Melee Weapon Attack: +8 to hit, reach 10ft., one target. Hit: 14 (2d8 + 5) bludgeoning damage. I made the other Elementals today and a few other monsters and didn't have any issues. Only the Earth Elemental is being difficult. Huh? Where did you get an output like this from? Also try to paste it as only text in word. Than move it into roll20 if you face difficulties. I find sometimes characters which dont identify well through the API/script may exist but you can't really tell by the naked eye. Also Mark. I see that you are updating the spells with /more/ information in them. They don't seem to import when I use the spell importer? I mean are they supposed too? So far I just did a work around and opened it up in a word document and just did Find and Replace 1d4s, 1d6s, etc with [[1d4]] , [[1d6]] etc. Making life easier to just have it auto roll when the info/cast button are clicked and having little need to change the spells.
1439111958
Kryx
Pro
Sheet Author
API Scripter
Saevar L. "Liquid-Sonic" said: Also Mark. I see that you are updating the spells with /more/ information in them. They don't seem to import when I use the spell importer? I mean are they supposed too? So far I just did a work around and opened it up in a word document and just did Find and Replace 1d4s, 1d6s, etc with [[1d4]] , [[1d6]] etc. Making life easier to just have it auto roll when the info/cast button are clicked and having little need to change the spells. I'm not changing the spells - I just parse them into attack, damage, etc. Which spell isn't working? Did you put an array of spells into the script?
Strange, I tried magic missile and the likes. They did not parse their attack and damage infos. I'll try it again later and let you know.
1439113544
Kryx
Pro
Sheet Author
API Scripter
Well magic missile is just damage. It isn't imported to the sheet or the sheet doesn't output it? I can very it and the earth elemental when I'm back at pc - though I assume earth elemental is due to copy paste stuff.
Isn't imported to the sheet* but this could be due to me not updating the script alongside the updated spells but simply just adding in the updated spells to an old importer script. 
1439119931
Kryx
Pro
Sheet Author
API Scripter
You should always use the latest version before reporting bugs. Handling multiple versions would be a nightmare.
I have that same issue, tried fixing it 20 times and just fucking gave up and let it be called Earundefinedlemental
Puck said: I have that same issue, tried fixing it 20 times and just fucking gave up and let it be called Earundefinedlemental lol, yeah, mine is sitting to the side while he talks to the therapist and figures out who he really is.
1439146791

Edited 1439146906
Saevar L. "Liquid-Sonic" said: Huh? Where did you get an output like this from? Also try to paste it as only text in word. Than move it into roll20 if you face difficulties. I find sometimes characters which dont identify well through the API/script may exist but you can't really tell by the naked eye. Also Mark. I see that you are updating the spells with /more/ information in them. They don't seem to import when I use the spell importer? I mean are they supposed too? So far I just did a work around and opened it up in a word document and just did Find and Replace 1d4s, 1d6s, etc with [[1d4]] , [[1d6]] etc. Making life easier to just have it auto roll when the info/cast button are clicked and having little need to change the spells. The 1st stat block is from this website:&nbsp; <a href="http://www.aidedd.org/regles/bestiaire/liste/" rel="nofollow">http://www.aidedd.org/regles/bestiaire/liste/</a> I think it's french, but it has an english button you can click. From what I can tell, they are all monsters that have been published in the modules and test material. They import great. When you click on a monster to see it's stat block though, it'll appear as it is in the French version of the MM. There is a little link in the upper right corner with the English version of the stat block.
I seem to not be able to get the query macros to function. &nbsp;Using a clean import of the Bugbear I get this when selecting the token and performing the query:&nbsp; "No ability was found for %{Bugbear|save_query_macro}" "No ability was found for %{Bugbear|check_query_macro}" I am sure it is something simple and stupid on my part that I am missing but I am not sure how this was supposed to actually function.
1439152048
Kryx
Pro
Sheet Author
API Scripter
Earth Elemental: I'm debugging it. I'm close, but need more time. @Mike: You have to manually use the latest version of the sheet from github - not the one roll20 gives you. Though saves and skills are broken as of right now so that class actions will work. Going to fix soon.
@ Mark: &nbsp;Ok thanks...i thought maybe I was just blind....&nbsp;
1439201815

Edited 1439202561
Kryx
Pro
Sheet Author
API Scripter
Aug 10th 2015 (1.91) Fixed Earth Elemental Created new commands to create token macros. "!shaped-token-macro --bootstrap" for them all (initiative and query macros). "!shaped-token-macro --init" for initiative. "!shaped-token-macro --query" for the query macros. Also query macros are fixed on the sheet - see that thread.
Mark said: Aug 10th 2015 (1.91) Fixed Earth Elemental Created new commands to create token macros. "!shaped-token-macro --bootstrap" for them all (initiative and query macros). "!shaped-token-macro --init" for initiative. "!shaped-token-macro --query" for the query macros. Also query macros are fixed on the sheet - see that thread. I tried using the command:&nbsp;!shaped-token-macro --query I got the message:&nbsp;No token selected So I tried it again with a token selected and then nothing happened. This could be related to why I can't use any of the other Shaped !commands. I'm just wondering if anyone else has had this issue.
1439230623
Kryx
Pro
Sheet Author
API Scripter
DM Korgul said: I tried using the command:&nbsp;!shaped-token-macro --query I got the message:&nbsp;No token selected So I tried it again with a token selected and then nothing happened. This could be related to why I can't use any of the other Shaped !commands. I'm just wondering if anyone else has had this issue. Ya, you must have a token selected. Haven't heard of anyone else who can't run the commands. I did not put in any logging to show the user that it worked. If you look at the token(s) it should have the token macros - I never even tested, lulz. I'll check later.
1439231927

Edited 1439232008
Kryx
Pro
Sheet Author
API Scripter
@DM Korgul: Try again. I did it entirely incorrectly before. Should be good now. I tested it - works on 1 token and multiple selected tokens.
Mark said: @DM Korgul: Try again. I did it entirely incorrectly before. Should be good now. I tested it - works on 1 token and multiple selected tokens. Thanks, it works now :)
I'm having problems importing in stat blocks for mobs. &nbsp;I'm getting pretty much this exact error message every time, regardless of the stat block. evalmachine.&lt;anonymous&gt;:714 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var res = ops[0].inlinerolls["1"].results.total; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^ TypeError: Cannot read property 'results' of undefined &nbsp; &nbsp; at evalmachine.&lt;anonymous&gt;:714:50 &nbsp; &nbsp; at checkFinishedOps (
1439373623
Kryx
Pro
Sheet Author
API Scripter
@Andrew: Please verify that you're using the latest version (1.91) and latest sheet (Aug 11th).&nbsp;Also post the statblock you're importing. Everything is working on my end.
Well bah, I could have sworn I had copied the latest version of the script.&nbsp; Obviously I didn't. I think I may have still been running JF's old import script.&nbsp; Everything seems to be working now, thank you!
1439382204
Kryx
Pro
Sheet Author
API Scripter
:)
Mark, I am having a strange issue with the script. &nbsp;Essentially when importing NPCs with the following set: addSaveQueryMacroTokenAbility: true, //change to false if you do not want a macro "Save" on every token addCheckQueryMacroTokenAbility: true, //change to false if you do not want a macro "Check" on every token addSkillQueryMacroTokenAbility: true, //change to false if you do not want a macro "Skill" on every token The skills are imported as: %{undefined|save_query_macro} If you don't set those during import and run the "!shaped-token-macro --query" command, they create properly. &nbsp;It is also worth noting that the action macros are created properly. &nbsp;Thanks for any assistance.
1439390337
Kryx
Pro
Sheet Author
API Scripter
Now that you mention it I see the same - the same is true for initiative. I'll fix this asap.
1439390668
Kryx
Pro
Sheet Author
API Scripter
@Kevin: If you update the script I have fixed this.
Thanks Mark! &nbsp;I just tested the latest and it works great, appreciate the quick turnaround!
Mark, thanks for all of your hard work. I have upgraded to Pro for your sheet and api. I am still a bit new to all of this, so forgive me if I have missed a step. I cannot seem to make your spell importer work. I have your Aug 12th sheet, and 1.91 up. I have put my spell list from github in the [] in your&nbsp;5e-shaped-scripts.js file as shown. I select a token and type:!shaped-spell-import --Blindness/Deafness , but I get nothing. What am I missing?
1439453205
Kryx
Pro
Sheet Author
API Scripter
John I've renamed it to "!shaped-spell". So for example "!shaped-spell --fireball". I'll edit my posts in this thread, sorry!
Thanks! I will give that a try when I get back from work tonight.
1439484885
Kryx
Pro
Sheet Author
API Scripter
Added a settings command to change all hide gm info settings. See&nbsp; <a href="https://app.roll20.net/forum/permalink/2298213/" rel="nofollow">https://app.roll20.net/forum/permalink/2298213/</a> Main command is "!shaped-settings --npcs --gm_info --hide". I also renamed "- show_ character_name" to&nbsp;"character_name" for that setting.
MUHAHA... Works like a charm, thanks Mark.
I ended up going with the shaped 5e sheet, this script works much better with it.&nbsp; I managed to import 49+ mob types with barely a hiccup. I did notice a couple times it didn't import in a Javelin weapon action because the 'J' was lowercase in the copy over.
1439577636

Edited 1439577666
Kryx
Pro
Sheet Author
API Scripter
This script is designed to work with the Shaped sheet - I'm the creator of both. :P The regex is indded very touchy. Traits and actions must all have capital letters. That's how it knows where one ends and the other begins.
1439581329

Edited 1439581369
Kryx
Pro
Sheet Author
API Scripter
Aug 14th 2015 (1.93) Toggle higher level query output
Higher level queries seem to not work. They do not calculate into healing, damage or etc correctly. Its very strange. it seems to be rolling the standard dice given and not adding it to the number of dice pool roll. I used the importer.&nbsp; Another strange effect is how the calculations at some point turn into negatives in the formula. I can't seem to reproduce this effectively. I put down what I got as a result and i'm gonna go through it one at a time. Ignore this. Just saw its an issue with the sheet. The server didnt update it to work this this @{Female Genasi|output_option} &{template:5eDefault} {{spell=1}} {{character_name=@{Female Genasi|character_name}}} @{Female Genasi|show_character_name} {{spellfriendlylevel=Level 1}} {{title=Cure Wounds}} 0 0 0 {{spellhigherlevel=When you cast this spell using a spell slot of 2nd level or higher, the healing increases by 1d8 for each slot level above 1st.}} {{emote=cures a creature's wounds}} 0 0 0 {{can_crit=1}} {{action_crit_damage=[[0 + 0d0]]}} {{action_crit_damage_adv=[[0 + 0d0]]}} {{action_second_crit_damage=[[0 + 0d0]]}} {{action_second_crit_damage_adv=[[0 + 0d0]]}} 0 0 0 {{spellhealing=[[1d8 + @{Female Genasi|casting_stat} + ((?{Spell Level|1|2|3|4|5|6|7|8|9} + ({{spell_cast_as_level=?{Spell Level|1|2|3|4|5|6|7|8|9}}}) - 1) * 1d8) + ((?{Spell Level|1|2|3|4|5|6|7|8|9} + ({{spell_cast_as_level=?{Spell Level|1|2|3|4|5|6|7|8|9}}}) - 1) * 1)d8[higher lvl]]]}} {{effects=This spell has no effect on undead or constructs.}} 0 0 {{spellschool=Evocation}} {{spellcasttime=1 action}} {{spellduration=Instantaneous}} {{target=a creature within range}} {{aoe=}} {{range=Touch}} {{spellcomponents=}} {{spell_components_verbal=1}} {{spell_components_somatic=1}} 0 @{Female Genasi|classactionspellcast}
1439918831
Kryx
Pro
Sheet Author
API Scripter
I haven't had that issue. Damage and healing both worked for me, but I can check later if it a still an issue.
Nvm. Someone had the same issue in the Shaped Sheet thread. Its because i'm not using the absolutely latest one.
1439920022

Edited 1439920031
Kryx
Pro
Sheet Author
API Scripter
Never report bugs without being as the latest as a Pro! :)
Yeah, made the same mistake twice now lol Argh.
1439997476
Kryx
Pro
Sheet Author
API Scripter
FYI I've revamped casting times to be toggleable on the sheet. I still need to update the importer - I'll likely do so tonight. I would recommend not importing until then.
1440019143
Kryx
Pro
Sheet Author
API Scripter
Aug 19th 2015 (1.94) New spell duration Also all spells have been verified to be parsing.
1440222747
Falcon
Pro
Sheet Author
Kryx (Mark, right)?&nbsp; Ok - I got the new converter. &nbsp;How do I get the damage (and there is a few other pieces of information changed from the previous sheet to the new one. &nbsp;I tried&nbsp;!shaped-spell and that didn't seem to work.
1440233563

Edited 1440241579
Kryx
Pro
Sheet Author
API Scripter
For spells you must manually re-enter the damage. Or you can use the spell importer for which you must copy spells from another location for it to work. I assume you're getting an error on "!shaped-spell"?
Thanks Kryx, this script is amazing! &nbsp;I just spent an hour shoe horning all of the spells from a CSV site into a JSON array and now I have 409 working spells. &nbsp;My days of copy and paste finally are over.
1440367069
Kryx
Pro
Sheet Author
API Scripter
Josh said: Thanks Kryx, this script is amazing! &nbsp;I just spent an hour shoe horning all of the spells from a CSV site into a JSON array and now I have 409 working spells. &nbsp;My days of copy and paste finally are over. Ah, you should've used my examples. I spent weeks making them good.
Actually your's is much better than mine, so I'm using it :) &nbsp;I'm still glad I made my list though because now I have one definitive excel sheet I can look at and sort by class and level instead of having to page through the manual.
1440371533
Falcon
Pro
Sheet Author
Kryx said: For spells you must manually re-enter the damage. Or you can use the spell importer for which you must copy spells from another location for it to work. I assume you're getting an error on "!shaped-spell"? Yeah. &nbsp;Since it's only damage - I can deal with that.&nbsp; So you have a spreadsheet (CSV) with all the spells and then can just import them in? &nbsp;Or is there something else out there that I can use so I don't have to re-enter them in every time (for a DM - it is SO time consuming).
1440372211
Kryx
Pro
Sheet Author
API Scripter
There are examples on my github. Use them.
1440372751
Falcon
Pro
Sheet Author
Trying to use the heal with the new spells but it's not adding the caster attribute. &nbsp;It is just roll the dice.