dr_venture
September 30th, 2012, 18:57
A big 'for what it's worth here' - expressing a little frustration as I slog through the first stages of learning the FG file structures.
I'm guessing that the XML architecture was inherited by Smiteworks and is 'set in stone' in support of existing rulesets, correct? One thing that makes learning the FG structures a bit painful is their wordy, cluttered depictions by favoring the use of hierarchical elements as opposed to Attributes. This is probably a matter of personal preference, but I've found that in creating large and varied XML documents, it's much easier to read and saves space to use a lot more Attributes , as opposed to mostly Elements. Case in point:
Here's a panel description in the existing structure:
<windowclass name="optionalstats">
<sheetdata>
<genericcontrol name="optionalframe">
<bounds>0,0,100,190</bounds>
</genericcontrol>
<numberfield name="fate" source="abilities.optional.fate">
<anchored>
<to>optionalframe</to>
<position>insidetop</position>
<offset>-20,32</offset>
<size>
<height>30</height>
</size>
</anchored>
<frame>
<name>bonus</name>
<offset>5,5,5,5</offset>
</frame>
<font>sheetnumber</font>
</numberfield>
<sheetlabelsmall>
<anchored>
<to>fate</to>
<position>above</position>
<offset>-20,3</offset>
</anchored>
<static>Fate</static>
</sheetlabelsmall>
</sheetdata>
</windowclass>
... and here's the same code with a preference of using Attributes where possible:
<windowclass name="optionalstats">
<sheetdata>
<genericcontrol name="optionalframe" bounds="0,0,100,190" />
<numberfield name="fate" source="abilities.optional.fate">
<anchored to="optionalframe" position="insidetop" offset="-20,32">
<size height="30" />
</anchored>
<frame name="bonus" offset="5,5,5,5" />
<font name="sheetnumber" />
</numberfield>
<sheetlabelsmall type="static">
<anchored to="fate" position="above" offset="-20,3" />
<text>Fate</text>
</sheetlabelsmall>
</sheetdata>
</windowclass>
To me that second sample is much easier to read and is about 30% more compact. If there's any way to move more in this direction in the future, that'd be my vote.
Yeah, I know, there's probably not much to do about it at this point, but I just wanted to get it off my chest. Thanks for listening. :)
I'm guessing that the XML architecture was inherited by Smiteworks and is 'set in stone' in support of existing rulesets, correct? One thing that makes learning the FG structures a bit painful is their wordy, cluttered depictions by favoring the use of hierarchical elements as opposed to Attributes. This is probably a matter of personal preference, but I've found that in creating large and varied XML documents, it's much easier to read and saves space to use a lot more Attributes , as opposed to mostly Elements. Case in point:
Here's a panel description in the existing structure:
<windowclass name="optionalstats">
<sheetdata>
<genericcontrol name="optionalframe">
<bounds>0,0,100,190</bounds>
</genericcontrol>
<numberfield name="fate" source="abilities.optional.fate">
<anchored>
<to>optionalframe</to>
<position>insidetop</position>
<offset>-20,32</offset>
<size>
<height>30</height>
</size>
</anchored>
<frame>
<name>bonus</name>
<offset>5,5,5,5</offset>
</frame>
<font>sheetnumber</font>
</numberfield>
<sheetlabelsmall>
<anchored>
<to>fate</to>
<position>above</position>
<offset>-20,3</offset>
</anchored>
<static>Fate</static>
</sheetlabelsmall>
</sheetdata>
</windowclass>
... and here's the same code with a preference of using Attributes where possible:
<windowclass name="optionalstats">
<sheetdata>
<genericcontrol name="optionalframe" bounds="0,0,100,190" />
<numberfield name="fate" source="abilities.optional.fate">
<anchored to="optionalframe" position="insidetop" offset="-20,32">
<size height="30" />
</anchored>
<frame name="bonus" offset="5,5,5,5" />
<font name="sheetnumber" />
</numberfield>
<sheetlabelsmall type="static">
<anchored to="fate" position="above" offset="-20,3" />
<text>Fate</text>
</sheetlabelsmall>
</sheetdata>
</windowclass>
To me that second sample is much easier to read and is about 30% more compact. If there's any way to move more in this direction in the future, that'd be my vote.
Yeah, I know, there's probably not much to do about it at this point, but I just wanted to get it off my chest. Thanks for listening. :)