Sign in to follow this  
Holger

Tool to automate terrain.cfg manipulation

Recommended Posts

Has anybody yet written (and is willing to provide) a (free) tool to safely manipulate the terrain.cfg file in FSX?I would like to eventually distribute some (free) (free as in Open Source) new road and rail textures that would for instance actually show proper lane markings depending on the number of lanes of the road and not use the same texture for 2-lane and 4-lane roads, and have concrete sleeper and also single-track railway textures. (Hmm, maybe even overhead lines for electrified track, wonder if the extrusions stuff could be used for that?) (Hmm, another idea, would it be possible to use extrusions to get actual wires for power lines, instead of the sorry bare towers we now get for UTX vectors? That would be cool.)Obviously I would then also distribute some addon vector scenery (for my local area) that would refer to these new textures. Anyway, I don't feel that giving instructions like "Open the terrain.cfg file in a text editor. (No, Word is not a text editor.) Copy the texture definitions from here into it, looking up and editing in the next free texture numbers for them. Update the DefaultTextureCount at the top of the file"is going to work. People will screw up their terrain.cfg. So an automated tool is needed. I mean some small non-interactive program that would take a command-line switch to either add or remove, and a file containing 3rd-party Texture and Autogen entries, and either add or remove them to the terrain.cfg file, renumbering the entries as needed. Obviously it should make a backup copy first, preferrably a unique timestamped one each time.I started writing such a tool and the texture part was relatively easy (I used regular expressions in C#) and I got it working after some hours. The autogen part is hairier because the autogens are not simply sequential single entries like the textures, but each autogen guid can correspond to a number of types and variants, and handling those with regular expressions doesn't look fun.Oh, why couldn't they use an easier to manipulate XML format for this, too... Slurping in such a XML terrain.cfg and just manipulating the XML document tree in memory would be easier, I think.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi there,I started a discussion about this here: http://www.fsdeveloper.com/forum/showthread.php?t=6204Not much feedback thus far. We have someone to help us with the installer/configurator coding for our own projects but I'm surprised that there hasn't been more interest or discussion from others. I guess either they are doing their own things or make do with the default/modified terrain.cfg.Cheers, Holger

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this