@Bricks - Cool, thanks for the input!
@Jookia - Thanks!
To be entirely honest, the scripting thing is definitely coming, but it's coming very slowly... I understand the engine enough to use it will non-object-oriented code, but getting it to work with classes is proving to be a bit tricky. While I'm working on figuring that out, I was inspired by
this to write something that converts the world-histories to XML files.
I've already got boost.regex/expressive set up with some regex expressions to pull the information out of the site and population file, and put it into an XML file. Just need to get it to pull the information in the world_history file, and then, depending on how research for the scripting is coming, I may look into exporting raw files to XML as well, so that they can be loaded into a wiki and such.
Turns this:
28: Enshalgor, "Buddedpits", a cave
Owner: Tlolothlinkis, kobolds
Parent Civ: Stabastruker, kobolds
Leader: Gidikikarbin, kobold
62 kobolds
29: Astooxut, "Desertshaft", a cave
5 large rats
447 purring maggots
349 bats
Into This:
<world>
<site>
<id>28</id>
<type>a cave</type>
<name>Enshalgor</name>
<translation>Buddedpits</translation>
<owner>
<name>Tlolothlinkis</name>
<race>kobolds</race>
</owner>
<parent_civ>
<name>Stabastruker</name>
<race>kobolds</race>
</parent_civ>
<leader>
<name>Gidikikarbin</name>
<race>kobold</race>
</leader>
<creature>
<name>kobolds</name>
<number>62</number>
</creature>
</site>
<site>
<id>29</id>
<type>a cave</type>
<name>Astooxut</name>
<translation>Desertshaft</translation>
<creature>
<name>large rats</name>
<number>5</number>
</creature>
<creature>
<name>purring maggots</name>
<number>447</number>
</creature>
<creature>
<name>bats</name>
<number>349</number>
</creature>
</site>
</world>
[EDIT]: Oh, and the formatting above was done through another program, the only formatting in the default output is newlines between the tags. I may add tabs later, we'll see...
[EDIT2]: Okay, the world history file is proving a little more complicated... working on figuring out how to parse the ruler lines now, although I'm not really sure how to handle multi-line stuff. That should be the easy part though. The way some parts of the line are left out entirely based on certain conditions (like the date of death not being listed for characters that hadn't died yet...).
Like this entry:
[*] Narena Craftedapes (b.??? d. 80, Reign Began: 1), *** Original Line, Married (d. 85)
10 Children (out-lived 6 of them) -- Ages at death: 79 (d. 75) 77 76 (d. 75) (d. 75) (d. 35) (d. 75) 71 (d. 22)
Worshipped Iru (45%)
I can get the name and the date of birth (or
for characters alive from the beginning) but getting the date of death is proving a bit trickier, since it isn't there at all in some entries, and the expression won't match both those with and those without... gah, regex is confusing
Anyways, I've asked about it on the Boost user-mailing-list, hopefully I'll get a reply pretty quick...
And while I'm here, does anyone have any idea what the percentage after the deity they worshiped is, the number in parenthesis?
[EDIT3]: Okay, it's loading everything except the ages of the children (either at the death of the parent, or at the current date) and the spheres each object of worship represents. The problem is, I have no idea how to get it to capture an arbitrary number of variables using regex, which'll make getting the ages and spheres difficult to say the least.
I may see if I can figure it out later, but I really have no idea at this point. I may just have it capture both as a string, just as it's found in the text file, and then upload and let you guys play around with it.
[EDIT4]: Uploaded the program as it is to
it's own topic in the Modding section.