1. #1

    1st Edition Parser and Module Builder

    While I was working on creating a 1E Database in Fantasy Grounds, the tedium of entering so many spells got to me (it was somewhere around half-way through the Cleric spells). So, I created a Parser, allowing me to simply copy and past the spells into the program and allowing them to write out the xml code.
    When I finished entering the spells (about an hour after finishing the parser), I wrote a Monster parser as well.
    Now, for me, it wasn't a major concern just going into the data modules and copy/pasting the xml code into a module, but I'm sure most of you wouldn't like that, so I created a ModBuilder that will take the data loaded from the parser and load it into a module file, for you.

    There are a few things you should know about the parser, though. It will only take spells and monsters the way that they're coded in the PHB and Monster Manual, and since computers are extremely stupid, the formatting has to be perfect. Ideally, you should just be able to copy and paste from a pdf file or from text taken from an OCR program (I used both), but there can be formatting errors, and sometimes the wrong symbol will be copied. Unfortunately, it's on you to verify correct formatting. The parser is case-sensitive, as well.

    Now, if you're tenacious enough to load all of the spells or monsters into one monumental text file and paste it into the parser, more power to you. However, it's safer to enter them individually, so that you can make sure the formatting is correct on each one. The parser simply appends new entries to the file. Just make sure you don't have a repeat ID number. That should be fairly easy as it automatically increases with each entry, and there's room for 10,000 ID numbers.

    To enter Spells, make sure you're on the Spells tab. Choose a name for your Spell file (do not try to put spells and monsters in the same file!), and if you're entering divine (Cleric or Druid) spells, simply check the box, and it will fill the Sphere field instead of the School field.

    For both Spells and Monsters, the parser looks for carriage returns and uses them to break up the descriptions into paragraphs. Be sure that you have these formatted properly when entering them.

    Spells should be formatted as follows, they can be in either of these orders:

    Spell Name (School or Sphere) Reversible
    Level: <value>
    Components: <value>
    Range: <value>
    Casting Time: <value>
    Duration: <value>
    Saving Throw: <value>
    Area of Effect: <value>
    Explanation/Description: <Spell Description>

    Spell Name (School or Sphere) Reversible
    Level: <value>
    Range: <value>
    Duration: <value>
    Area of Effect: <value>
    Components: <value>
    Casting Time: <value>
    Saving Throw: <value>
    Explanation/Description: <Spell Description>


    If a spell is not reversible, the field will be ignored.

    Monster stats must be in this format and this order.

    Monster Name
    FREQUENCY: <value>
    NO. APPEARING: <value>
    ARMOR CLASS: <value>
    MOVE: <value>
    HIT DICE: <value>
    % IN LAIR: <value>
    TREASURE TYPE: <value>
    NO. OF ATTACKS: <value>
    DAMAGE/ATTACK: <value>
    SPECIAL ATTACKS: <value>
    SPECIAL DEFENSES: <value>
    MAGIC RESISTANCE: <value>
    INTELLIGENCE: <value>
    ALIGNMENT: Neutral (evil)
    SIZE: <value>
    PSIONIC ABILITY: <value>
    Attack/Defense Modes: <value>
    LEVEL/X.P. VALUE: VIII /4000 + 20 /hp
    Monster description goes here. If you have carriage returns separating paragraphs, the parser is smart enough to break them up in the XML Code.

    The LEVEL/X.P. VALUE: field is optional, as this was not present in the Monster Manual. In these cases, the parser calculates XP value by calculating Hit Dice and checking for key-words relating to minor and major special abilities. I've found it to be fairly accurate.

    Once you complete work with the parser, all you need to do is load up the ModBuilder and select the files containing your spells and/or monsters (They can be done separately or in a single file).

    You even have the option to choose a thumbnail, though it must be a .png file.

    One final note: While this parser will save you a great deal of time, you'll still have to handle formatting in many of the descriptions (for spell/monster descriptions that contain charts, for example). The parser, also, does not create the spell effects or monster attacks and powers.

    Download URL: https://drive.google.com/open?id=1W9...bEQjyu_ZjDgwXi

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    24,166
    Thanks for putting this together and sharing with the community.

    I assume this is for D&D 1E? As such, I’ve moved it to the Classic D&D forum so there's no confusion over which system it’s for.
    FG Con 15 Fantasy Grounds Online RPG Convention - Nov. 8-10, 2019
    Register at www.fg-con.com for all the latest info.

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    celestian's Avatar
    Join Date
    Jan 2017
    Location
    DFW, Texas
    Posts
    2,053
    Great stuff!

    You might want to look into the built in parsing in the AD&D 2E ruleset. It will parse spells, npc text (mm entries) and npc stat blocks. While not perfect since a lot of these products have varying styles and sometimes the PDF quality isn't so great it does get a lot of it.

    Here is how you can import MM style entries:



    Here is a example on stat blocks.

    https://www.youtube.com/watch?v=3L087qCL1Bg

    I don't have an example of spells I don't think but it works similarly.

    All imports will also try and do some context "markup" using bold/italic/underline where certain keywords are.
    ---
    Coding the Official AD&D Ruleset
    My Twitch Channel for AD&D and FG related streams (See schedule for live days)
    My YouTube for FG related Tutorials and AD&D Actual Plays

  4. #4
    Celestian, I have been using it successfully with 2E MM Entries, but I had a lot of trouble with 1E. The major advantage with mine is (provided you check the formatting first), you can enter multiple NPC's at once. I typically went by the letter.

    Also, I didn't find the feature until about a week ago. Really, this is just one specific to 1E with the 1E MM and Spell layout.
    Last edited by Dave0910; September 8th, 2019 at 22:05.

  5. #5
    Don't take these posts as an attack on your tools. As a programmer, I'm simply used to finding my own solutions when dealing with issues, like this. I also have a ruleset in the works. As for the 1E Extension I created (which needs an update), yours is no longer part of the standard install, so newer users don't even have them.

  6. #6
    celestian's Avatar
    Join Date
    Jan 2017
    Location
    DFW, Texas
    Posts
    2,053
    Quote Originally Posted by Dave0910 View Post
    Celestian, I have been using it successfully with 2E MM Entries, but I had a lot of trouble with 1E. The major advantage with mine is (provided you check the formatting first), you can enter multiple NPC's at once. I typically went by the letter.

    Also, I didn't find the feature until about a week ago. Really, this is just one specific to 1E with the 1E MM and Spell layout.
    That makes sense (mass bulk import). I did a lot of that externally also. I've not had the chance to check out your tool since I'm still traveling but look forward to seeing how it works.

    If you have any pointers on which part of the 1e entries did not import properly I'll see what I can do to correct them. For my own games I import 2e and 1e monsters tho there are certainly some differences between the 2 styles.

    Again great community project work, glad to see it.
    ---
    Coding the Official AD&D Ruleset
    My Twitch Channel for AD&D and FG related streams (See schedule for live days)
    My YouTube for FG related Tutorials and AD&D Actual Plays

  7. #7
    The Psionics abilities didn’t inport properly, but there are so few of those that I don’t mind editing them manually (I have to enter all of their attacks, anyway).
    The other issues I had were specifically caused by bad ORC dealing with the PDF documents. Punctuation might be missing from the end of an entry, causing it to read it as part of the next one.
    Or a letter would he incorrectly read on the header and it would skip past the entry to the mext creature or spell.
    I was okay with the spells, but I had to manually format the monster entries.
    As an FYI, it was written in C# (which I dislike, but everybody wants .NET programmers). My formal training is in C++, Java and VB .NET (which I also dislike).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Log in

Log in