PDA

View Full Version : NodeDescriptions updated for FG2



Shrp77
April 26th, 2007, 11:23
I've updated the NodeDescriptions utility to be compatible with the XML structure of FG2.

https://kfam.ath.cx/apps/FGTools/Tools.html

For those of you that have not experience with the application, it goes through all the XML files in the folder you specify (including sub folders) and maps out all the nodes and their attributes and members. It's basically just a tool to scope out what's being used where etc.

NOTE: I'm using this more or less as an internal development tool and have built into it a C# code / class generator - however that generator is tailored specifically towards my own application needs. As its focus has shifted to primarily internal use, I've stopped working on eliminating UI issues, therefore some things (like the threaded update of the UI) just aren't working right. If the application is using 100% CPU over a period of time - it's still working.

How To Use:
1) Double click in the "Select Root Folder" entry field - browse to the <Application Data>\Fantasy Grounds II\examples\rulesets\d20 folder and hit ok.

2) Click the Generate button (lower right corner). Take a coffee break.

3) File -> Save Data. Give it a filename you can relate to so that you don't need to re-generate the list every time.

Information description:

Node: this is the actual node name
example: <abilitybonus name="something" source="other"/>
Member: represents a child of the node that does not have any children of its own.
example: <chatentry name="blablabla">
<script file="missing"/>
</chatentry>
Attribute: a value within the node or member
example: <chatentry name="blablabla">

Members and attributes encapsulated in a parenthesis (i.e. "(defaultsize)") indicate that this member or attribute is optional - it has not been encountered every time the node was encountered.

Type: Guesstimate as to the datatype for a given attribute.

Some types have a question mark after the type name. This is from C# and indicates a "nullable" type - meaning a value that can contain an actual value or be nothing.

Found In: Simply lists the XML files the specific node/member/attribute was found in - so that you can open them up and reference them.

I also use color codes - but more for my own coding needs:
White background = instance (single object, not a list or collection)
Cyan background = list or collection of other objects. Look down the list for their node description.
Red background = object inconsistancy. See my question below.

Not entirely sure how much use this thing is to you guys, but I figure that if we have any tools it's better to share than to sit on them...

---------------------------------------------------------------------

Just like to pose a question to the forums here:

I've noticed that SOME nodes contain a hyphen in their name whereas others do not. Example:

the WindowClass nodes member DefaultSize has TWO different entries for height: one called "height" and the other called "h-eight". These entries can be found in "d20_reference.xml".

The same node (WindowClass) also contains a member called "softclose" and another called "s-oftclose".

"softclose" can be found in "adventure_images.xml", "adventure_npcs.xml", "d20_reference.xml" and "utility_notes.xml"

"s-oftclose" can be found in "adventure_items.xml" and "adventure_story.xml".

Does anyone know why the hyphen is in there? does it affect the behavior of that option (i.e. default True or default False)?

Thanks.

Goblin-King
April 26th, 2007, 11:35
I've noticed that SOME nodes contain a hyphen in their name whereas others do not.

Two things. First, a lazy goblin that uses that for commenting silly things out. Second, a stupid goblin that forgets to remove them afterwards.

Shrp77
April 26th, 2007, 11:58
Two things. First, a lazy goblin that uses that for commenting silly things out. Second, a stupid goblin that forgets to remove them afterwards.

Ah.. Well - if you use the NodeDescriptions application those problem areas are highlighted with red for you (including where to find them) :)

:rv:

Cantstanzya
April 28th, 2007, 16:13
For those of you that have not experience with the application, it goes through all the XML files in the folder you specify (including sub folders) and maps out all the nodes and their attributes and members. It's basically just a tool to scope out what's being used where etc.
This seems like a very handy program. How much work would it be to add a comparator to it? In other words, you select two rulesets, the example ruleset and your custom ruleset. Then the program compares the two rulesets Node by Node and reports what are the differences between the two. This would be very handy for when updates come out and someone wanted to know what changed so they can update their custom ruleset. There are some people that have a slight variation of the d20 ruleset and this would allow them to see what changes were made by the developers so they could incorporate this into their ruleset. I was thinking about writing something like this myself in C#, but it seems like you are already halfway there.

Shrp77
April 28th, 2007, 18:08
The NodeDescriptions program isn't really made for that - it is made to map out the composition of the nodes themselves regardless of where they are encountered.

I would recommend using WinMerge (https://winmerge.org/) which would suit your problem perfectly (if i understood it correctly). You can perform directory based comparisons and compare the files. The syntax highlighting beats several commercial applications that we use @ work... Best of all - it's free (open source) :)