Planetside Software Forums

General => Terragen Discussion => Topic started by: Henry Blewer on February 20, 2010, 09:02:47 AM

Title: Parsing
Post by: Henry Blewer on February 20, 2010, 09:02:47 AM
Here's a question I don't think anyone has asked before. If I have a tgd file and want to send it to someone, is there a way to parse the tgd file with comments?

Like in Basic, 'REM This is a comment'. Or '; this is a comment.'
Title: Re: Parsing
Post by: FrankB on February 20, 2010, 09:25:30 AM
tgd's are XML, so this might work:

<!-- This is a comment -->

... haven't tried it though.
Title: Re: Parsing
Post by: Henry Blewer on February 20, 2010, 10:16:40 AM
I knew there had to be a way. Thanks Frank!
Title: Re: Parsing
Post by: cyphyr on February 20, 2010, 01:07:41 PM
I did try this a while ago, to see if I could embed a copyright notice in a tgd file. You can (you need to edit the file in a text editor) and it does not effect the tgd file however the extra comment code is lost when the file is re-saved.
Richard
Title: Re: Parsing
Post by: jaf on February 20, 2010, 06:54:29 PM
You can use the "Project Settings ..." button in the lower-left corner.  There's a "comments" option.  I tried around 1500 characters and it saves and loads okay with the tgd file.

The standard xml comment structure doesn't seem to work though, which would really be ideal.  I would think this would be a feature to maybe add in the future (or maybe there's already a different comment structure?)

Title: Re: Parsing
Post by: jo on February 20, 2010, 08:11:44 PM
Hi,

TGD files are XML, so XML comments will work in the sense that they will be ignored as comments should be. However TGD will not preserve comments or anything else which doesn't form part of what TG2 writes, as you've found. When the files are saved they're basically written anew, from scratch.

Regards,

Jo
Title: Re: Parsing
Post by: Henry Blewer on February 20, 2010, 08:13:57 PM
Thanks Jo. It would be handy to have this. When I have returned to an older tgd file, I have to pull it apart to see what I had in mind building it. Comments would be helpful.