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

[Request/Suggestion] Spell Importer

1436464319

Edited 1436464333
Not sure if this sort of thing is considered okay in the API forum, but I didn't see anything in the Tips & Rules sticky post so here goes. Is it possible to build a script that would import spell data in the same general manner as the 5e shaped NPC importer script? <a href="https://app.roll20.net/forum/post/1816031/script-d" rel="nofollow">https://app.roll20.net/forum/post/1816031/script-d</a>... If it is, does it exist already and I am simply blind? Cheers, friends.
1436489549
The Aaron
Roll20 Production Team
API Scripter
Totally fine to post this kind of thing here, happens all the time! =D It would definitely be possible to write such a script. I'm not aware of any scripts that do this currently.
Good Guy The Aaron, benevolent guardian of the API forums.
1436490881

Edited 1436498326
I asked the same question recently to Mark, who makes the 5e Shaped Character Sheet & NPC Importer. Conversation on that thread is here: <a href="https://app.roll20.net/forum/post/2016392/d-and-d-5e-shaped-character-sheet#post-2135863" rel="nofollow">https://app.roll20.net/forum/post/2016392/d-and-d-5e-shaped-character-sheet#post-2135863</a> Basically, it's possible, but a lot of testing needed for such a feature EDIT: Regarding the possible JSON format idea on the other thread, I made a quick code mockup. Any suggestions appreciated Code Mockup: <a href="http://pastebin.com/2c90SnUJ" rel="nofollow">http://pastebin.com/2c90SnUJ</a>
1436509676

Edited 1436520376
Kryx
Pro
Sheet Author
API Scripter
The json format already exists. Google "spelldata.json 5e". I would highly recommend any api follows that format as it already has all the spells in it. It is not the best format (yours is better), but its all done already. This is the format they use (Fireball is in the free rules, so should be ok to post this): [ { "name":"Fireball", "desc":"&lt;p&gt;A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one.&lt;/p&gt;&lt;p&gt;The fire spreads around corners. It ignites flammable objects in the area that aren’t being worn or carried.&lt;/p&gt;", "higher_level":"&lt;p&gt;When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d6 for each slot level above 3rd.&lt;/p&gt;", "page":"phb 241", "range":"150 feet", "components":"V, S, M", "material":"A tiny ball of bat guano and sulfur.", "ritual":"no", "duration":"Instantaneous", "concentration":"no", "casting_time":"1 action", "level":"3rd-level", "school":"Evocation", "class":"Cleric, Sorcerer, Warlock, Wizard", "archetype":"Cleric: Light&lt;br/&gt; Warlock: Fiend", "domains":"Light", "patrons":"Fiend" } ]
Trust a programmer to start doing something before checking if anyone else did it first lol. Although, using text for values that should be a boolean ... You can tell a programmer did not write that json script. I would still be happy to make the basic rule spells into a list using my format if that would make building the tool easier from an API perspective, though it would take a little while to do (I'm a caregiver, so free time is limited).
1436601943
Kryx
Pro
Sheet Author
API Scripter
I agree that your format is better. However I think we should use what is already done - especially due the copyright nature of being unable to share our own.
I'm quite happy to create my own database as the spells come up in game, but a suitable method to import the spells in would be nice. Perhaps just getting rid of repeating fields and leaving a staple number of spells fields
1436615737
Kryx
Pro
Sheet Author
API Scripter
Repeating won't get removed for my sheet and likely the default as well. It would break spells for everyone who already has them.
1436616092
The Aaron
Pro
API Scripter
Also, the names of repeating fields are predictable, so an importer could check for which ones exist already and make the natural successors when it does the import. If there is a better format for spells, it could be used for all the spells that are in the freely available basic rules. Additionally, a converter could be written for any existing formats to bring them inline with the better format.
1436616628
Kryx
Pro
Sheet Author
API Scripter
I'm going to write it. I will use a more programmatic format and people can transform the other system to this.
1436617081
The Aaron
Pro
API Scripter
Post the format, I'm happy to write the converter or existing formats on one of my websites and make it available. =D
1436627610
Kryx
Pro
Sheet Author
API Scripter
Aaron, any thoughts on command format? I was thinking: !shaped-import-spell JOURNAL_NAME SPELL_NAME But I normally split the message on a space (the same as you) and many spells have spaces in the name. Any ideas?
Glad to see the ball rolling on this. @Mark Did you want to use my format suggestion? Are there any fields missing that you think might be needed? The only one that came to mind afterwards was a boolean for "materials_consumed" possibly. Also, would the EE spells list be ok to touch as well as it was released in a public supplement? Not sure on the whole legal side of things
1436635117

Edited 1436635812
Kryx
Pro
Sheet Author
API Scripter
Technically none of it is legal to use without permission from WotC. You'll notice that no sites host spells - even free ones. Check Donjon or any of the others. Here is the format I'm using so far. I may adjust once I finish the importer. { "name":"Fireball", "description":"A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one.&lt;br&gt;The fire spreads around corners. It ignites flammable objects in the area that aren’t being worn or carried.", "higherLevel":"When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d6 for each slot level above 3rd.", "source":"phb 241", "range":"150 feet", "components":{ "verbal":"true", "somatic":"true", "material":"true", "materialMaterial":"A tiny ball of bat guano and sulfur." }, "ritual":"false", "duration":"Instantaneous", "concentration":"false", "castingTime":"1 action", "level":"3", "school":"Evocation", "class":"Cleric, Sorcerer, Warlock, Wizard", "domains":[ "Light" ], "patrons":"Fiend" }
1436651382
Kryx
Pro
Sheet Author
API Scripter
Please see my 5e scripts thread for further progress on this. All the basic stuff is done. I now need to parse attack, save, damage, heal, and effects from the description. Fireball is included as an example for now - it will be removed in the future.