FG Spreadshirt Swag
Page 1 of 2 12 Last
  1. #1
    Zeus's Avatar
    Join Date
    Mar 2009
    Location
    Olympus
    Posts
    2,658
    Blog Entries
    2

    Lightbulb Guide: Using the 4E Parser to create a Module

    Here's an example guide to using the Parser to first scrape functional rules from the DDI compendium (requires a DDI account) and then secondly to compile the scraped files into a useable module. Its not a complete guide and will not include all the text content from the module, just the basic functional rules like powers, feats etc. Well enough to get you started with.

    NOTE: At present there is a current and known problem with scraping Item data from DDI using the Parser. Advise unticking the Item options for scraping until a fix and new relase of the Parser is made available.

    Scraping.

    For the example, I've chosen the new Player's Handbook Races: Dragonborn module.

    1. Create a Folder somewhere on your machine (anywhere will do) and call it something like PHBRaces-Dragonborn
    2. Next create two subfolders in the new folder you just created and call them input and output
    3. Download the latest 4EParser (v4.0.20) and Open the 4EParser.exe
    4. Click on the Compendium Menu at the top and select the menu option Switch to Compendium Mode
    5. Click Yes to the Warning but note you WILL need a DDI account to continue
    6. The main page of the 4EParser will refresh with new configuration options, double-click the folder at the top of the page to set the location of where we want the scrape files (text files) to be generated to. Choose the input subfolder you created earlier

    e.g. C:\Users\<your name>\Desktop\PHBRaces-Dragonborn\input

    7. Next double-click the Login Name icon and enter your account name details for DDI. Click OK
    8. Next double click the Source book Title icon and choose the Players Handbook Races - Dragonborn module from the pull down list
    9. The remaining options should auto-set so next select Compendium -> Scrape from the menu at the top.
    10. The 4EParser will now open a dialogue prompting you for your DDI account password, enter it and click OK.
    11. The 4EParser will now open a processing output window and will login to the compendium and begin the scrape process, it should take a few minutes as its not a particularly large module. When its complete it will post a message to the processing window.
    12. Now we have the source files for the module you can examine them if you wish by navigating to the input folder you created earlier. You can use these to gain a better understanding of the syntax options the 4EParser uses for the input of the various rules and options. The 4EParser Document that is bundled with the 4EParser program details all syntax options.

    Parsing

    Now we can take the source files we scraped earlier and input them to the 4EParser to output a useable 4E module in FGII. This is known as the Parsing process.

    1. Select Parse -> Switch to Parse Mode fromt the menu
    2. Double-Click the Name icon at the top and enter the name of our module, something like:

    Players Handbook Races - Dragonborn

    3. If you have a Thumbnail for the module you can assign it by double-clicking the Thumbnail icon and navigating to the appropriate path. As creating one of these is a process in iteself I am going to skip it, you can check the forums and videos for a guide on creating these but essentially any 100x100 png will suffice.
    4. Next Double-Click the Category icon and enter the name of the category you want the module to be listed under in the Library in FGII, perhaps something like:

    4E Supplement

    5. Next Double-Click the Modestring icon and enter a unique name for the module. This option is being phased out in a future release however for now will ensure duplicate lists are not created within FGII:

    4EPHBRDB

    6. Double-Click the Temporary Directory icon and navigate to the output folder you created earlier e.g.

    e.g. C:\Users\<your name>\Desktop\PHBRaces-Dragonborn\output

    7. Modules Directory should auto point to your FGII App data modules path. No need to change

    8. Output Format allows you to choose the type of module, client.xml (requires all players to have a local copy), common.xml (players can access via server) or db.xml (host only). As this is a players guide module we will choose client.xml.

    9. We want the content to be listed in the Library of FGII so leave Output to Library selected as 'Yes'. Note if you were creating an adventure module you would likely select 'No' opting to have the content listed under the Book Icon windows (e.g. Story, Encounters, Personalities etc. etc.)

    10. Now we need to tell the Parser which options we want to include, the previous scrape produced the following files:

    a. armor.txt - The PHBRDB does not contain any Armor Items but the 4EParser
    still produces any empty file - we can ignore it.
    b. class.txt - contains necessary PC Class information for the Powers
    detailed in PHBRDB
    c. equip.txt - The PHBRDB does not contain any Equipment Items but the
    4EParser still produces any empty file - we can ignore it.
    d. mi.txt - contains all the Magical Items detailed in the module
    e. powers.txt - contains all the Powers data in the module
    f. race.txt - contains necessary PC Race information for the Powers
    detailed in PHBRDB
    g. weapon.txt - The PHBRDB does not contain any Weapons but the
    4EParser still produces any empty file - we can ignore it.

    So 1st lets setup Powers.

    11. Scroll down to the Reference section and open the Tree for Powers/Feats/Features/Background, Double-click the Data file icon and navigate to the powers.txt file you scraped earlier e.g.

    e.g. C:\Users\<your name>\Desktop\PHBRaces-Dragonborn\input\powers.txt

    Next Double-Click the Class file icon and navigate to the class.txt file and finally repeat for the Race file icon choosing the race.txt file.

    12. Next, Magic Items. Close the Powers/Feats/Features/Background tree and scroll back up to the Items section. Open the Magic Items tree and Double-Click the Data File icon. Navigate to the mi.txt file you scraped earlier.

    The options Output to Items and Output to Library allow you to set the output path with FGII (Library or Book Icon windowlists) at a more granular level. I recommend leaving them as is for the time being but you should go back and experiment to see the different output options.

    Right that should be it, we are ready to Parse (compile) our module. Before we do that you might want to click on File->Save and save the configuration of the Parser. This can be loaded back in a future session saving you having to type in and select all the options again. Great if you build your modules slowly over time rather than all at once.

    OK. Now we can Parse. If you are using the 4E_JPG v1.51 ruleset simply select Parse->Parse from the menu. If you are using the newer test release of the 4E v2 ruleset first unselect the Output for 1.51 option in the Parse menu before selecting Parse.

    Once Parsed the module will be automatically moved to the modules subfolder of the FGII App Data folder. Simply fire up FGII to take a look at the module.

    Once FGII is up and your 4E campaign loaded, click the Modules activation button (top right, picture of an open book) and open the new Module which should be listed there.

    You should then be able to open the Library (bottom right book icon). The module will be listed under the 4E Supplement section.

    Hope that helps.
    FG Project Development
    Next Project(s)*: Starfinder v1.2 Starship Combat

    Current Project:
    Starfinder v1.1 - Character Starships
    Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
    * All fluid by nature and therefore subject to change.

  2. #2
    Thank you very much for this, it has helped me greatly!

    One question that I have though; I could only find parser version 4.0.118, and you mention 4.0.20 in your post; where can I find this version?

    Kind regards

  3. #3
    Zeus's Avatar
    Join Date
    Mar 2009
    Location
    Olympus
    Posts
    2,658
    Blog Entries
    2
    Quote Originally Posted by MrSavaroth
    Thank you very much for this, it has helped me greatly!

    One question that I have though; I could only find parser version 4.0.118, and you mention 4.0.20 in your post; where can I find this version?

    Kind regards
    I believe 4.0.118 is actually newer than 4.0.20 so you should be good to go. One thing to note is that this tool has been discontinued by the original developer (Tenian). Another community member (EugeneZ) picked it up for a short while (see this thread for more information) however I am unsure if he is continuing its development.

    I am also working on a new Parser for 5E that is modular. If anyone is interested in extending the new tool to support 4E I will gladly support.
    FG Project Development
    Next Project(s)*: Starfinder v1.2 Starship Combat

    Current Project:
    Starfinder v1.1 - Character Starships
    Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
    * All fluid by nature and therefore subject to change.

  4. #4
    Wonderful, then I will stick with this version; thank you for your quick reply!

    Only recently got into FGII, but this has made my life much easier; and I'd love to help, but I am afraid that I'm not that skilled at coding.

    Kind regards

  5. #5
    I'm having an issue where parsing doesn't produce a module for the Library (the parser does put stuff in the 'output' folder). I think it's to do with the thumbnails - they are the right size, and it's only causing issues on some parsing exercises not all (the 'Processing Results' thing gets stuck on the thumbnail part). Any ideas?

    Edit:
    Fixed. I just needed to not call my lovingly prepared thumbnail images 'thumbnail.png'. Heh.

    Edit 2:
    However I can't parse Dragon Magazine 399. 381 and 384 parsed fine, but although the scrape seems to go okay, the Powers are refusing to parse. They are background powers e.g. from Noble instead of normal ones. I'm confused.
    Last edited by Bleak Midwinter; April 4th, 2013 at 23:11.

  6. #6
    Zeus's Avatar
    Join Date
    Mar 2009
    Location
    Olympus
    Posts
    2,658
    Blog Entries
    2
    Post of the most recent error output from the console and we'll see if we can help diagnose the cause.

    Also, if you right click the power tree in the Parser there is an option to Parse the Powers only - when finished it will open a browser for you to view the resulting XML. This is a useful feature for diagnosing broken modules and saves time as you only have to parse the relevant trees that need debugging.
    FG Project Development
    Next Project(s)*: Starfinder v1.2 Starship Combat

    Current Project:
    Starfinder v1.1 - Character Starships
    Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
    * All fluid by nature and therefore subject to change.

  7. #7
    It doesn't produce an error output, the powers just don't appear when I load up the module in FG2. A feat (the only one, I think) and the NPCs are parsed fine and load up in the module.

    I did notice that the names of powers ran into the descriptions of previous powers, but I tried manually editing them all to add in a carriage return and it didn't help.

  8. #8
    Zeus's Avatar
    Join Date
    Mar 2009
    Location
    Olympus
    Posts
    2,658
    Blog Entries
    2
    Right click the Powers tree node in the Parser and click Parse. Does the Browser open? If so examine the XML if you tags with very long names then as you highlighted the problem is the parser is not picking up the individual powers correctly. Check the scrape file and make sure the syntax conforms to the syntax described in the ParserDocument.txt file (under Powers). Also check you scrape file for any rogue html tags like the <p name="Published ... and remove them (Find/Replace All).
    FG Project Development
    Next Project(s)*: Starfinder v1.2 Starship Combat

    Current Project:
    Starfinder v1.1 - Character Starships
    Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
    * All fluid by nature and therefore subject to change.

  9. #9
    I've just checked. A few powers didn't have levels associated with them, which I changed, and it still doesn't work.

    I think it may be because these powers are from Backgrounds (e.g. 'Aqua Regia' if you have the Compendium) rather than Classes. There is something about dynamic tags but it's half past midnight and I'm failing to understand it.

  10. #10
    Zeus's Avatar
    Join Date
    Mar 2009
    Location
    Olympus
    Posts
    2,658
    Blog Entries
    2
    Try creating a class.txt file and adding Aqua Regia.
    FG Project Development
    Next Project(s)*: Starfinder v1.2 Starship Combat

    Current Project:
    Starfinder v1.1 - Character Starships
    Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
    * All fluid by nature and therefore subject to change.

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

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

Log in

Log in