DrClarke
June 27th, 2007, 22:06
Okay, be patient with me here. :) As kalmarjan pointed out in another post, I'm not grasping this like I thought I would.
I'm no pro coder/scripter, but I can get by well enough for my own personal projects. I do just fine with things like .php, mysql, or even perl, but I'm feel I'm missing something fundamental here in FG2.
I've never tinkered with .xml, but I assumed it was, for better use of a term, simply a flat file db? I've never touched lua, even though I played WoW for the better part of two years, I just never got around to modding an interface project.
Enter FG2. I'll post my 'example' here and then try to ask my questions so that one of the pros can point me in the right direction.
<?xml version="1.0" encoding="ISO-8859-1"?>
<root version="2.0">
<library>
<d20Armor static="true">
<name type="string">d20Armor</name>
<categoryname type="string">d20Armor</categoryname>
<entries>
<armor2>
<librarylink type="windowreference">
<class>referencetextwide</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Armor 2</name>
<text type="formattedtext">
<table width="100%" border="0">
<tr decoration="underline"><td colspan="2"><b>Armor</b></td><td><b>Cost</b></td><td><b>Armor/Shield Bonus</b></td><td><b>Maximum Dex Bonus</b></td><td><b>Armor Check Penalty</b></td><td><b>Arcane Spell Failure Chance</b></td><td><b>Speed (30 ft.)</b></td><td><b>Speed (20 ft.)</b></td><td><b>Weight</b></td></tr>
<tr><td colspan="10">Light armor</td></tr>
<tr><td colspan="2">    Padded</td><td>5 gp</td><td>+1</td><td>+8</td><td>0</td><td>5%</td><td>30 ft.</td><td>20 ft.</td><td>10 lb.</td></tr>
<tr><td colspan="2">    Leather</td><td>10 gp</td><td>+2</td><td>+6</td><td>0</td><td>10%</td><td>30 ft.</td><td>20 ft.</td><td>15 lb.</td></tr>
<tr><td colspan="2">    Studded Leather</td><td>25 gp</td><td>+3</td><td>+5</td><td>-1</td><td>15%</td><td>30 ft.</td><td>20 ft.</td><td>20 lb.</td></tr>
<tr><td colspan="2">    Chain Shirt</td><td>100 gp</td><td>+4</td><td>+4</td><td>-2</td><td>20%</td><td>30 ft.</td><td>20 ft.</td><td>25 lb.</td></tr>
</table>
</text>
</armor2>
</entries>
</d20Armor>
</library>
</root>
Okay, for the most part, I was thinking that .xml simply stored our data and the <tags></tags> we utilize/created were of our own design, but to be called upon from elsewhere within another script/application.
So, for my first question, how is it that FG2 knows to actually bold something in this .xml that utilizes the <b></b>? It's as if it's treating it like an html or xhtml command.
Is it because of the afore mentioned portion:
<text type="formattedtext">
I've literally loaded up all the .xml and .lua items I could find in FG2 into Notepad++ and did a search on all files for snippets to locate my Ah-ha! moment. Like an example I would do is a complete search on text or formattedtext thinking that since this was data stored in xml, the actual 'structure' had been formed somewhere else.
I KNOW I'm missing something easy here. I'm simply trying to learn what/where/how the data stored in this .xml files is being called from.
I'm no pro coder/scripter, but I can get by well enough for my own personal projects. I do just fine with things like .php, mysql, or even perl, but I'm feel I'm missing something fundamental here in FG2.
I've never tinkered with .xml, but I assumed it was, for better use of a term, simply a flat file db? I've never touched lua, even though I played WoW for the better part of two years, I just never got around to modding an interface project.
Enter FG2. I'll post my 'example' here and then try to ask my questions so that one of the pros can point me in the right direction.
<?xml version="1.0" encoding="ISO-8859-1"?>
<root version="2.0">
<library>
<d20Armor static="true">
<name type="string">d20Armor</name>
<categoryname type="string">d20Armor</categoryname>
<entries>
<armor2>
<librarylink type="windowreference">
<class>referencetextwide</class>
<recordname>..</recordname>
</librarylink>
<name type="string">Armor 2</name>
<text type="formattedtext">
<table width="100%" border="0">
<tr decoration="underline"><td colspan="2"><b>Armor</b></td><td><b>Cost</b></td><td><b>Armor/Shield Bonus</b></td><td><b>Maximum Dex Bonus</b></td><td><b>Armor Check Penalty</b></td><td><b>Arcane Spell Failure Chance</b></td><td><b>Speed (30 ft.)</b></td><td><b>Speed (20 ft.)</b></td><td><b>Weight</b></td></tr>
<tr><td colspan="10">Light armor</td></tr>
<tr><td colspan="2">    Padded</td><td>5 gp</td><td>+1</td><td>+8</td><td>0</td><td>5%</td><td>30 ft.</td><td>20 ft.</td><td>10 lb.</td></tr>
<tr><td colspan="2">    Leather</td><td>10 gp</td><td>+2</td><td>+6</td><td>0</td><td>10%</td><td>30 ft.</td><td>20 ft.</td><td>15 lb.</td></tr>
<tr><td colspan="2">    Studded Leather</td><td>25 gp</td><td>+3</td><td>+5</td><td>-1</td><td>15%</td><td>30 ft.</td><td>20 ft.</td><td>20 lb.</td></tr>
<tr><td colspan="2">    Chain Shirt</td><td>100 gp</td><td>+4</td><td>+4</td><td>-2</td><td>20%</td><td>30 ft.</td><td>20 ft.</td><td>25 lb.</td></tr>
</table>
</text>
</armor2>
</entries>
</d20Armor>
</library>
</root>
Okay, for the most part, I was thinking that .xml simply stored our data and the <tags></tags> we utilize/created were of our own design, but to be called upon from elsewhere within another script/application.
So, for my first question, how is it that FG2 knows to actually bold something in this .xml that utilizes the <b></b>? It's as if it's treating it like an html or xhtml command.
Is it because of the afore mentioned portion:
<text type="formattedtext">
I've literally loaded up all the .xml and .lua items I could find in FG2 into Notepad++ and did a search on all files for snippets to locate my Ah-ha! moment. Like an example I would do is a complete search on text or formattedtext thinking that since this was data stored in xml, the actual 'structure' had been formed somewhere else.
I KNOW I'm missing something easy here. I'm simply trying to learn what/where/how the data stored in this .xml files is being called from.