Yes, that looks better to me. The logical continuation would be to have the switches inside the categories - then everything is the tree from the very beginning but that's maybe too big a change of the xml file? Which tools are currently using this file?
Probably not, so to get category info now, you have to start TTDPatch with "-!S-S-", i.e. double the S- debug switch. This will start working in the next nightly/beta, with older versions this will give you the old format, which you may complain about and abort
Sample switches.xml is attached. It also has the name of the manual page on the wiki, so you can create a "click here for more info" link by opening "http://wiki.ttdpatch.net/tiki-index.php?page=%s" where %s is the manpage property.
DaleStan in the TTDPC thread wrote:Put the tgr* and towngrowth* switches (except for towngrowthratemode) in their own category,
I agree on this.
It is possible to enter invalid digts into the mountains and curves field"
Each digit of moresteam must be in the range 0..5, rather than the number as a whole being limited to fifty-five
This would need a new kind of switch type descriptor, like a bitswitch but with (single digit?) decimal values for each part.
It is invalid to have the sum of the three aibuild*chance switches exceed 65535.
The XML today has no information about dependencies between switches. Is this desirable/doable?
DaleStan in the TTDPC thread wrote:Put the tgr* and towngrowth* switches (except for towngrowthratemode) in their own category,
I agree on this.
Done.
It is possible to enter invalid digts into the mountains and curves field"
Each digit of moresteam must be in the range 0..5, rather than the number as a whole being limited to fifty-five
This would need a new kind of switch type descriptor, like a bitswitch but with (single digit?) decimal values for each part.
Something like a "validdigits" property might work. If present, only the given digits may be used in the value. Is that acceptable?
It is invalid to have the sum of the three aibuild*chance switches exceed 65535.
The XML today has no information about dependencies between switches. Is this desirable/doable?
Technically it's not invalid, it just won't work as intended. I wouldn't worry about it too much.
The attached switches.xml with categories is perfectly valid for TTDXC, of course. To test it, replace current switches.xml with it and TTDXC will retrieve the info from it, the file is rebuilt only with a new version detection.
Patchman wrote:Something like a "validdigits" property might work. If present, only the given digits may be used in the value. Is that acceptable?
Sounds good enough for me.
Andrex wrote:The attached switches.xml with categories is perfectly valid for TTDXC, of course. To test it, replace current switches.xml with it and TTDXC will retrieve the info from it, the file is rebuilt only with a new version detection.
Great, then there's really no need for the -!S-S- kludge, is there, Patchman? Just let -!S- generate the new kind of XML?
Andrex wrote:The attached switches.xml with categories is perfectly valid for TTDXC, of course. To test it, replace current switches.xml with it and TTDXC will retrieve the info from it, the file is rebuilt only with a new version detection.
Great, then there's really no need for the -!S-S- kludge, is there, Patchman? Just let -!S- generate the new kind of XML?
OK. I can't run TTDXC on Wine so I couldn't test it with the new format, but if you say it works with the <category> tags then I'll just make that the default from now on.
I'm just wondering if Andrex really means the <category> tags and not just the categorynum="11" category="INFST_ROADS" properties in the switch tags, as beta 7 writes it.
<range name="curves" min="0" max="3333" default="120" cmdline="-c" defstate="on" validdigits="0123" manpage="NewCurveAndMountainHandling" desc="`%s' (%s) sets curve speeds to normal (0), faster (1), fastest (2) or realistic (3). One digit for each of railroad, monorail, maglev and road vehicles. Default 0120."/>
Patchman wrote:I'm just wondering if Andrex really means the <category> tags and not just the categorynum="11" category="INFST_ROADS" properties in the switch tags, as beta 7 writes it.
The XML parsing from TTDXC is quite standard, and will keep working as long as the initial switch structure is mantained, this is: