swest
January 5th, 2015, 23:58
Greetings,
I hesitate to contribute to cluttering The Workshop with inane threads, but...
I'll do it anyway :D
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:
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:
Start with some kind of parseable text file
Parse that file to generate appropriate XML
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
<?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:
<?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
I hesitate to contribute to cluttering The Workshop with inane threads, but...
I'll do it anyway :D
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:
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:
Start with some kind of parseable text file
Parse that file to generate appropriate XML
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
<?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:
<?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