PDA

View Full Version : New Ruleset - Problem 2



Valarian
April 7th, 2007, 16:22
Hi, I've hit my second problem and can't see where the difficulty lies. Can anyone please help?

I'm trying to amend the feats.xml so that I can have multiple nodes shown in the Reference window - the same as with classes.xml and equipment.xml currently. I could get around the problem by trying to add another xml file, but ideally I'd like to know why this isn't working.

I've amended the d20_reference.xml feats windowclass as follows, using the equipment windowclass above as a reference


<windowclass name="feats">
<datasource name="feats" />
<frame name="referencebox" />
<dynamic resize="vertical" />
<defaultsize width="500" height="650" />
<minimize icon="minimized_reference" />
<tooltip field="name" />
<sheetdata>
<formattedtextcontrol name="text">
<bounds rect="25,15,-30,-20" />
<font normal="chatfont" bold="narratorfont" italic="chatitalicfont" bolditalic="chatbolditalicfont" title="titlefont" />
<icon link="button_openwindow" emptylink="button_emptytarget" />
<footer image="footer_wide" />
</formattedtextcontrol>
<scroller>
<bounds rect="-63,-45,45,27" />
<target name="text" />
<button normal="button_scroller" pressed="button_scroller_down" />
</scroller>
</sheetdata>
</windowclass>
<windowclass name="featssmall">
<datasource name="feats" />
<defaultsize width="200" height="27" />
<sheetdata>
<windowopencontrol name="open">
<icon normal="button_openwindow2" pressed="button_openwindow2down" />
<bounds rect="0,0,24,24" />
<class name="feats" />
<description field="name" />
</windowopencontrol>
<stringcontrol name="name">
<bounds rect="30,2,120,20" />
<link handler="open" underlineoffset="-2" />
</stringcontrol>
</sheetdata>
</windowclass>


In the feats.xml, I have two inner nodes (inside the first feats node). I've called these "1feats" and "2feats" - shown below (without the content as not OGL). Whichever node I name "1feats" is the one that is shown, the other is ignored.


<root>
<node name="feats">
<node name="1feats">
<stringvalue name="name" value="Skills" />
<formattedtext name="text">
...CONTENT GOES HERE...
</formattedtext>
</node>
<node name="2feats">
<stringvalue name="name" value="The Force" />
<formattedtext name="text">
...CONTENT GOES HERE...
</formattedtext>
</node>
</node>
</root>

DrDeth
April 9th, 2007, 17:39
Ok...

You've defined two sheets and linked them to data...?

What are you expecting, and what are you getting?

Valarian
April 9th, 2007, 21:23
The classes and equipment XML files show more than a single node. I want the feats XML file to do the same, so that I can show Alien Races, Skills, and The Force as nodes sourced from feats.xml.

At the moment, I have Skills and The Force defined in the feats XML file. These are defined as nodes "1feats" and "2feats". Whichever of the nodes I designate as "1feats" is the one that is displayed. The other is ignored.

Herein lies the problem.

DrDeth
April 11th, 2007, 08:02
Ahh...

Ok. If you look at the referenceroot and classsmall windowclasses as an example, you'll see that the referenceroot defines a windowlist.

The windowlist essentially tells FG to repeat the classsmall windowclass for each subnode of class.

This essentially gives you the list:

Races
Bard
Barbarian
etc...


I notice that the d20 ruleset already defines a list for feats, but there is only 1 subnode in the database file. If you've changed the database file to your format, and left the rest of the xml the same, you should indeed get a list - as long as you've made sure to increase the size of the windowlist.

It could be that your list IS working, but the bounds are still set to the size of one row.

Valarian
April 11th, 2007, 10:42
Doh! It was this simple!
Thanks for the help. I just didn't spot this at all.
I changed the size of the windowlist element, and all is well.
Thanks again.