I've recently dipped my feet into developing aircraft. (More on that project later). One thing that I just couldn't get to grips with is the huge TMD files. Scrolling around a file with tens of thousands of lines with no syntax highlighting or error checking isn't fun. I felt like I couldn't get a handle on all the different parts of the file and how they tie together.
So, I spent a couple of evenings coding up a simple utility that can convert XML to TMD or TMC files (let's call them TMX) and also TMX to XML.
Doing this gives a few of advantages:
- You can edit the XML with your favour editor and get syntax highlighting
- You'll also get real-time XML syntax checking from your editor
- You can fold sections away with your XML editor
- Using XML includes you can break the file into lots of smaller files, neatly arranged into a separate folders
A picture is worth a 1000 words and all that...
Here's my root file for the aircraft (early days, don't judge), all in XML, and it just imports other files.
If you take a look at the left sidebar you'll see how I've broken the aircraft source up into many different files and folders.
In my opinion this makes things so much easier to deal with.
The aircraft code becomes a real project with a logical layout. You know where to find things without searching.
In this screenshot there's one XML include file, this one is specific to cameras.
I can put all the documentation I need in these individual files as they are specific to one area of the aircraft.
When I want to compile things down to a single TMD I run.
If you want to convert an existing TMD to XML, to allow it to be split up you can do the opposite
Obviously, this is very niche appeal. I wrote it for myself, but if anyone else thinks it might be of use to them, let me know, and I'll add some error checking a do a public release.