Menu
News
All News
Dungeons & Dragons
Level Up: Advanced 5th Edition
Pathfinder
Starfinder
Warhammer
2d20 System
Year Zero Engine
Industry News
Reviews
Dragon Reflections
White Dwarf Reflections
Columns
Weekly Digests
Weekly News Digest
Freebies, Sales & Bundles
RPG Print News
RPG Crowdfunding News
Game Content
ENterplanetary DimENsions
Mythological Figures
Opinion
Worlds of Design
Peregrine's Nest
RPG Evolution
Other Columns
From the Freelancing Frontline
Monster ENcyclopedia
WotC/TSR Alumni Look Back
4 Hours w/RSD (Ryan Dancey)
The Road to 3E (Jonathan Tweet)
Greenwood's Realms (Ed Greenwood)
Drawmij's TSR (Jim Ward)
Community
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions, OSR, & D&D Variants
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Resources
Wiki
Pages
Latest activity
Media
New media
New comments
Search media
Downloads
Latest reviews
Search resources
EN Publishing
Store
EN5ider
Adventures in ZEITGEIST
Awfully Cheerful Engine
What's OLD is NEW
Judge Dredd & The Worlds Of 2000AD
War of the Burning Sky
Level Up: Advanced 5E
Events & Releases
Upcoming Events
Private Events
Featured Events
Socials!
EN Publishing
Twitter
BlueSky
Facebook
Instagram
EN World
BlueSky
YouTube
Facebook
Twitter
Twitch
Podcast
Features
Top 5 RPGs Compiled Charts 2004-Present
Adventure Game Industry Market Research Summary (RPGs) V1.0
Ryan Dancey: Acquiring TSR
Q&A With Gary Gygax
D&D Rules FAQs
TSR, WotC, & Paizo: A Comparative History
D&D Pronunciation Guide
Million Dollar TTRPG Kickstarters
Tabletop RPG Podcast Hall of Fame
Eric Noah's Unofficial D&D 3rd Edition News
D&D in the Mainstream
D&D & RPG History
About Morrus
Log in
Register
What's new
Search
Search
Search titles only
By:
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions, OSR, & D&D Variants
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Menu
Log in
Register
Install the app
Install
Upgrade your account to a Community Supporter account and remove most of the site ads.
Community
General Tabletop Discussion
*Geek Talk & Media
Looking for a spell database...
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="javapadawan" data-source="post: 216766" data-attributes="member: 1444"><p>That would be awesome... the more spells the better. I actually wrote a custom class to parse the information from a plain text file for when I import a lot of spells at once. The class I wrote is pretty easily modified, so I can really parse from any format you're comfortable putting the spells in. </p><p></p><p>The only thing that needs to remain constant is that each piece of spell information should be in the same format as all the other pieces. For example, some spells, like Protection From Chaos, etc., will only have Name, School, and Level, and maybe one or two other fields, and then it will say "As Protection From Good". I haven't coded the parser to be smart enough to pick up the rest of the fields from the other named spell, so all the missing fields would need to be copied. Not a big deal, but something to keep in mind. Also, because the long descriptions can span many lines, there must be a way to tell that the description is complete and the next spell block has begun. You can do this simply by starting each new spell with "Name:" like I did. Here's an example of the format I used:</p><p></p><p>Name: Acid Fog</p><p>Conjuration (Creation) [Acid]</p><p>Sor/Wiz 6, Water 7</p><p>V, S, M/DF</p><p>1 action</p><p>Medium (100 ft. + 10 ft./level)</p><p>Effect: Fog spreads 30 ft., 20 ft. high</p><p>1 round/level</p><p>None</p><p>Yes</p><p>Fog deals acid damage.</p><p></p><p>This spell's vapors are highly acidic... etc.</p><p></p><p>What the parser actually does is begin by reading in the first eleven lines. It knows that the first line is the name of the spell, the second line has the school information, the third is the components, and so on up to the eleventh line which is the short description. It knows to check for subschools in parentheses and descriptors in brackets on the school line, and it knows to separate the effect type (Area, Target, or Effect) before the colon from the actual effect (Fog, Ray, Cone, etc.) after the colon (I store these as separate fields so that you could more easily search for all Ray spells, or all Area effect spells, etc.).</p><p></p><p>After reading in the first eleven lines, the parser starts reading in each consecutive line and adding it to the spell's long description. For each line it checks to make sure that this line is part of the spell description and not the beginning of the next spell. That's where the "Name:" piece comes in handy. If that piece is there, the parser knows that it has finished reading in all the information for one spell. It then inserts that information into the database, and starts the whole process over with the next spell.</p><p></p><p>That's about it. Like I said though, the format is flexible. I can always modify the parser if you're more comfortable with a different format. Also, I plan on inputting Magic of Faerun next, so you can skip that one if you like. If you have any more questions, feel free to reply, email, or you can sometimes catch me on Yahoo or AOL instant messenger (my handle on both is javapadawan) or on ICQ (160687583). <img src="https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png" class="smilie smilie--emoji" loading="lazy" width="64" height="64" alt=":)" title="Smile :)" data-smilie="1"data-shortname=":)" /></p><p></p><p>Chris</p></blockquote><p></p>
[QUOTE="javapadawan, post: 216766, member: 1444"] That would be awesome... the more spells the better. I actually wrote a custom class to parse the information from a plain text file for when I import a lot of spells at once. The class I wrote is pretty easily modified, so I can really parse from any format you're comfortable putting the spells in. The only thing that needs to remain constant is that each piece of spell information should be in the same format as all the other pieces. For example, some spells, like Protection From Chaos, etc., will only have Name, School, and Level, and maybe one or two other fields, and then it will say "As Protection From Good". I haven't coded the parser to be smart enough to pick up the rest of the fields from the other named spell, so all the missing fields would need to be copied. Not a big deal, but something to keep in mind. Also, because the long descriptions can span many lines, there must be a way to tell that the description is complete and the next spell block has begun. You can do this simply by starting each new spell with "Name:" like I did. Here's an example of the format I used: Name: Acid Fog Conjuration (Creation) [Acid] Sor/Wiz 6, Water 7 V, S, M/DF 1 action Medium (100 ft. + 10 ft./level) Effect: Fog spreads 30 ft., 20 ft. high 1 round/level None Yes Fog deals acid damage. This spell's vapors are highly acidic... etc. What the parser actually does is begin by reading in the first eleven lines. It knows that the first line is the name of the spell, the second line has the school information, the third is the components, and so on up to the eleventh line which is the short description. It knows to check for subschools in parentheses and descriptors in brackets on the school line, and it knows to separate the effect type (Area, Target, or Effect) before the colon from the actual effect (Fog, Ray, Cone, etc.) after the colon (I store these as separate fields so that you could more easily search for all Ray spells, or all Area effect spells, etc.). After reading in the first eleven lines, the parser starts reading in each consecutive line and adding it to the spell's long description. For each line it checks to make sure that this line is part of the spell description and not the beginning of the next spell. That's where the "Name:" piece comes in handy. If that piece is there, the parser knows that it has finished reading in all the information for one spell. It then inserts that information into the database, and starts the whole process over with the next spell. That's about it. Like I said though, the format is flexible. I can always modify the parser if you're more comfortable with a different format. Also, I plan on inputting Magic of Faerun next, so you can skip that one if you like. If you have any more questions, feel free to reply, email, or you can sometimes catch me on Yahoo or AOL instant messenger (my handle on both is javapadawan) or on ICQ (160687583). :) Chris [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*Geek Talk & Media
Looking for a spell database...
Top