Software tool needed in trainz.

PEV's great set of graphics tools (http://www.members.optusnet.com.au/~villaump/pevsoft.htm) are directly accessable from within CM2. We needed a similar tool for text problems which would allow us to correct typos, delete lines and replace phrases in the Config.txt file of an asset. Any volunteers? PEV?

Bob

I don't think I understand all I know about this request. From CM2, if I open an asset for edit using explorer, then click on the "config.txt" file, it opens in Notepad, and I can "correct typos, delete lines, and replace phrases". If I open the asset for edit in CM2, then I can correct the same typos, delete the same lines, and replace the same phrases, except in a slightly different format.

So, apparently I don't understand what you're asking for here. Teach me, please.

ns
 
PEV's great set of graphics tools (http://www.members.optusnet.com.au/~villaump/pevsoft.htm) are directly accessable from within CM2. We needed a similar tool for text problems which would allow us to correct typos, delete lines and replace phrases in the Config.txt file of an asset. Any volunteers? PEV?

Bob

There is a project floating around in the background to tackle this but it is much more complex than pressing a magic button.

Cheerio John
 
I don't think I understand all I know about this request. From CM2, if I open an asset for edit using explorer, then click on the "config.txt" file, it opens in Notepad, and I can "correct typos, delete lines, and replace phrases". If I open the asset for edit in CM2, then I can correct the same typos, delete the same lines, and replace the same phrases, except in a slightly different format.

So, apparently I don't understand what you're asking for here. Teach me, please.

ns
The need for such a tool comes about as the result of content creators using the time saving cut and paste function to produce the boilerplate sections of a config.txt file in which there is a typo or illegal tag. For example, I've downloaded a route that has 20 scenery kuids with one occurance of the word category misspelled as catagory. I can highlight all 20 then select Edit - Open for Edit but then I have to separately edit each config.txt file. It would be handy to have a program to do a replace category for catagory.

Another common error is config.txt file that has lines like:
/color 128,225,0
color 128,225,100
where the author was trying to get the right color and left the /color tag in the config.txt file. Again, I would highlight the 20 or 30 occurances of faulty kuids for Edit and use the program to delete all lines that start with /color.

Bob
 
The need for such a tool comes about as the result of content creators using the time saving cut and paste function to produce the boilerplate sections of a config.txt file in which there is a typo or illegal tag. For example, I've downloaded a route that has 20 scenery kuids with one occurance of the word category misspelled as catagory. I can highlight all 20 then select Edit - Open for Edit but then I have to separately edit each config.txt file. It would be handy to have a program to do a replace category for catagory.

Another common error is config.txt file that has lines like:
/color 128,225,0
color 128,225,100
where the author was trying to get the right color and left the /color tag in the config.txt file. Again, I would highlight the 20 or 30 occurances of faulty kuids for Edit and use the program to delete all lines that start with /color.

Bob

Not sure if you are aware but since SP2, if you open the asset in CMP all the errors regarding invalid entries such as # REM / // note: etc etc are marked in red with a cross next to them which you click to delete as are entries that are not needed all errors are now also listed at the bottom of the page, that should get rid of the majority of them very quickly, careful though and backup the config file before opening it as revert doesn't seem to work once it has converted it to 2009 standards here. When playing with it, it wanted to render a tunnel useless by flagging up height, and bendy as errors and refused to commit without the changes so that method is not infallible! and yes I had backed up.;) Changing the version number back to 2.5 in the config I was then able to commit it. Guess conversion to 2009 is changing the version number???
I do the errors that need correcting, manually anyway, I trust me I don't trust CMP.

Searching for strings in text files and replacing can be done quickly in Linux or Unix by using gawk or grep and sed or similar, saves trawling through hundreds of lines of code to replace instances of xxx when a compile goes wrong.
There are many freeware text search and replace tools for Windows that will probably do the job, may need to use the command line though, could be set up with a batch file to point to the edit folder and sub folders and run from CM2 to make life easier, as in open all the offening assetts for edit and run the batch file.
What it won't do is find unknown errors, but you should be able to remove the no longer required containers and frequent typo's and wrong case errors with it.

Malc
 
Last edited:
Bob

If CMP or CM2 allow you to pull multiple assets out of their database and put them in their own separate Windows folders, within a master folder, then you could easily fix recurring config errors, such as your mis-spelled 'catagory', with a find-and-replace text editor.

I do this all the time for bunches of new TRS2004 assets, using the freeware editor BK ReplaceM. The power of this particular one is that you can point it at just the master folder and it will find all the config files buried in all the sub-folders and correct them. You can also save your editing instructions for next time a bunch of assets has the same error -saves you working out the editing logic again.

Look towards the bottom of this page at the GAURC web site, there is a short description and link to BK ReplaceM;
http://www.gaurc.us/index_files/software.htm

~ Deane
 
Last edited:
PEV's great set of graphics tools (http://www.members.optusnet.com.au/~villaump/pevsoft.htm) are directly accessable from within CM2. We needed a similar tool for text problems which would allow us to correct typos, delete lines and replace phrases in the Config.txt file of an asset. Any volunteers? PEV?

Bob,

A very comprehensive tool box is under development now. I am just helping with a few details. The author will publish in due course.. One of the features will be that any external tool can be connected to a file type and be opened from the tool box..and the config.txt can be manipulated and checked by the tool.
 
Last edited:
Back
Top