5E Character Create Playlist
  1. #1

    Parsing text to create xml to integrate into a campaign (in this case, PFRPG ruleset)

    Greetings,

    I hesitate to contribute to cluttering The Workshop with inane threads, but...

    I'll do it anyway

    The questions I have could be posed and answered for the general case, but I don't have broad enough experience with either FG or XML to do that, so I will stick to the specifics of what I want to do for this case, and then extrapolate it to the general case.

    I want to create a comprehensive list of Sandpoint Residents (PFRPG ruleset) that can be included as a Group in the Story banner of any campaign I run that uses the Sandpoint setting. These entries will look like:

    Attachment 8608

    and might come from a text file that looks like the following:

    BEGIN
    Atstalar Zantus
    BACKGROUND
    When the Sandpoint chapel burnt to the ground in 4702 AR, killing the town's priest, Ezakien Tobyn, his position in the town was filled by his top acolyte, Abstalar Zantus. Though Father Zantus is himself a cleric of Desna, his role as high-priest requires him to be open to other faiths, and he is more than willing and open to assist followers of other gods with spiritual matters.
    TABLE
    Titles, Father Zantus
    Alignment, Chaotic good
    Race/Species, Human
    Class, Cleric 4
    Gender, Male
    Homeland, "Sandpoint, Varisia"
    Deity, Desna
    END

    I started entering this data by using the built-in list editor, and that was going pretty quickly, however, I would prefer to figure out how to:

    1. Start with some kind of parseable text file
    2. Parse that file to generate appropriate XML
    3. Package that XML into a module that can be dropped into any campaign

    I have some community modules to look at as examples, and so I thought that I would be able to infer #3 from one or more of them, but my powers of inference might not be up to the challenge... nevertheless, I exported a couple of Story entries to a module, SandpointResidents.mod, and that module has two xml files.

    First xml.db
    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <root version="3.0" release="1|3.5E:14|CoreRPG:3">
    	<encounter>
    		<category name="Sandpoint Residents" mergeid="" baseicon="1" decalicon="0">
    			<id-00039>
    				<locked type="number">1</locked>
    				<name type="string">Abstalar Zantus</name>
    				<text type="formattedtext">
    					<p>When the Sandpoint chapel burnt to the ground in 4702 AR, killing the town's priest, Ezakien Tobyn, his position in the town was filled by his top acolyte, Abstalar Zantus. Though Father Zantus is himself a cleric of Desna, his role as high-priest requires him to be open to other faiths, and he is more than willing and open to assist followers of other gods with spiritual matters.</p>
    					<table>
    						<tr>
    							<td>Titles</td>
    							<td>Father Zantus</td>
    						</tr>
    						<tr>
    							<td>Alignment</td>
    							<td>Chaotic good</td>
    						</tr>
    						<tr>
    							<td>Race/Species</td>
    							<td>Human</td>
    						</tr>
    						<tr>
    							<td>Class</td>
    							<td>Cleric 4</td>
    						</tr>
    						<tr>
    							<td>Gender</td>
    							<td>Male</td>
    						</tr>
    						<tr>
    							<td>Homeland</td>
    							<td>Sandpoint, Varisia</td>
    						</tr>
    						<tr>
    							<td>Deity</td>
    							<td>Desna</td>
    						</tr>
    					</table>
    				</text>
    			</id-00039>
    			<id-00041>
    				<locked type="number">1</locked>
    				<name type="string">Aesrick Battlehorn</name>
    				<text type="formattedtext">
    					<p>Aesrick Battlehorn is the Guildmaster of the Carpenter's Guild in Sandpoint. He left his homeland because of his fondness for working with wood rather than stone.</p>
    					<table>
    						<tr>
    							<td>Titles</td>
    							<td>Guildmaster</td>
    						</tr>
    						<tr>
    							<td>Alignment</td>
    							<td>Lawful good</td>
    						</tr>
    						<tr>
    							<td>Race/Species</td>
    							<td>Dwarf</td>
    						</tr>
    						<tr>
    							<td>Class</td>
    							<td>Expert 5</td>
    						</tr>
    					</table>
    				</text>
    			</id-00041>
    		</category>
    	</encounter>
    	<library>
    		<sandpointresidents static="true">
    			<categoryname type="string">Story</categoryname>
    			<name type="string">sandpointresidents</name>
    			<entries>
    				<encounter>
    					<librarylink type="windowreference">
    						<class>referenceindex</class>
    						<recordname>lists.encounter@Sandpoint Residents</recordname>
    					</librarylink>
    					<name type="string">Story</name>
    				</encounter>
    			</entries>
    		</sandpointresidents>
    	</library>
    	<lists>
    		<encounter>
    			<name type="string">Story</name>
    			<index>
    				<id-00039>
    					<listlink type="windowreference">
    						<class>encounter</class>
    						<recordname>encounter.id-00039@Sandpoint Residents</recordname>
    					</listlink>
    					<name type="string">Abstalar Zantus</name>
    				</id-00039>
    				<id-00041>
    					<listlink type="windowreference">
    						<class>encounter</class>
    						<recordname>encounter.id-00041@Sandpoint Residents</recordname>
    					</listlink>
    					<name type="string">Aesrick Battlehorn</name>
    				</id-00041>
    			</index>
    		</encounter>
    	</lists>
    </root>
    and definition.xml:
    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <root version="3.0" release="1|3.5E:14|CoreRPG:3">
    	<name>Sandpoint Residents</name>
    	<category>Story</category>
    	<author>Various</author>
    	<ruleset>PFRPG</ruleset>
    </root>
    So, it would seem that if I produce these two files, using this pattern, I should be able to create a useable module.

    1st question: At what number should the ID sequence (i.e., 'id-0000x'), start? Does it matter?
    2nd question: What are some caveats to look out for?
    3rd question: Short of writing a parser from scratch, is there a recommended tool that will parse my input file, and produce the XML I want? Also, is there a recommended input format?

    Thanks.

    - s.west
    Last edited by swest; January 6th, 2015 at 00:00. Reason: clarification

  2. #2
    You could use PCGen and the Creature Parser or the NPC Parser, which is what I'm doing.

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    For creating story entries you can indeed create them manually by copy/paste into the module db.xml file - the ID sequence starts at id-00001, but doesn't really matter particularly - just don't have two IDs the same. Just make sure that the links from the <lists> section match the ID used in the <library> section.

    You should be able to use PAR5E to create story entries using the CoreRPG ruleset setting - download the PAR5E ZIP file and look at the "PAR5E CoreRPG User Guide.pdf" file in the docs directory for details of the markup needed for story entries. You'd need to then rename the <ruleset> tag in the generated module definition.xml from CoreRPG to PFRPG.
    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!

  4. #4
    Ok, I've finally managed to get some time to experiment with PAR5E, and start work on my Pathfinder Residents modules...

    It's a very nice tool, and with the guidance you (Trenloe) provided, I have been able to get a new Story module created, and I'm currently working on understanding the behavior and limits of PAR5E's markup tags, and how they affect the final xml.

    I have a question (which I will probably also post over in the PAR5E thread) that is related to your (Trenloe) instructions to use the CoreRPG ruleset for parsing, and then change it to PFRPG before using it in a PFRPG Campaign.

    While your instructions work as you described, he (Zeus) has a 'Pathfinder' ruleset available in PAR5E, and if I parse my module with that setting, it creates client.xml & definition.xml files identical to those created with CoreRPG, with the exception that now the ruleset is Pathfinder (which also must be changed to PFRPG, before using...)

    My question is: Since PAR5E has a 'Pathfinder' ruleset selection, why isn't the definition.xml file created with the ruleset tag set to "<ruleset>PFRPG</ruleset>" instead of "<ruleset>Pathfinder</ruleset>"? This would obviate the requirement to rename/unzip/edit/rezip/rename (a bit of a pain...) I suppose, as a workaround, I could just use CoreRPG for my testing/development phase...

    Obviously, I know that you didn't write this parser, but I thought you might know the answer. If you don't, perhaps Zeus will poke his head in here, and tell us himself...

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    PAR5E is very much a work in progress and most of the development has been done on the 5E portion - very little has changed on the other rulesets included since it was first released, so don't expect them to work flawlessly as there hasn't been any serious development/testing on them. I'm sure it's just an oversight on Zeus's behalf that the Pathfinder ruleset option doesn't set the ruleset tag as PFRPG.
    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!

  6. #6
    Roger that. I posted the change request over on the PAR5E thread.

    Do I recall there being a source distribution of PAR5E? Maybe I could change it, and rebuild myself... (?)

    Thanks

    - s.west

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
  •  
FG Spreadshirt Swag

Log in

Log in