Train-Sim.Com
MSTS Route Design

What happened to my .REF file? Is Route Riter to blame

Notice to all visitors and members of the Train-Sim.Com message forums:
If you plan on using a signature banner in your posts, we would like to remind you that there is a maximum size for banners. That maximum is 450 pixels wide by 120 pixels high, and not to exceed 25k. Your compliance is appreciated. FORUM RULES Problems? There are two common reasons for problems with logging in and posting messages. The first is that you are running a firewall that prevents your messages from being sent to the server. The other is that you have cookies disabled; the DCForum software requires cookies to work properly.

Previous Topic | Next Topic

Printer-friendly copy Email this topic to a friend

Reading Topic #12567

Member since Jun-21-04 · 39 posts

What happened to my .REF file? Is Route Riter to blame – image 1

LAST EDITED ON Oct-06-04 AT 07:14 PM (EDT)

I worked too much on my route until I released it.Now I installed it again, and it worked well.
But I tried to edit it in the R.E., to make some fixes, and it gave an "Error reading editor object selection file FCDFS.ref - Line Nº .....".
When I press Ok to continue, it tells me:
Object select initialization failed
I found that some errors where in lines of references where no Class was shown; but in others, the syntax was correct, and no line was lacking.
Now I cannot understand why it gives me hundreds of errors, the more I fix and the more they occur.
Could it be, that I compacted my route with Route Riter, that the reference file was spoiled?
Can Route Riter fix these errors, or check the Ref file to find them?I'll have to edit all the .REF file manually.
I'm really confused wit this, and I'm needing help; I'll be thankful by your help.Kind regards...

Eduardo

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

RE: What happened to my .REF file? Is Route Riter to b, MikeSimpson, Oct-06-04, 07:25 PM, (1) RE: What happened to my .REF file? Is Route Riter to b, yulbrynner, Oct-06-04, 08:09 PM, (2) RE: What happened to my .REF file? Is Route Riter to b, calr, Oct-06-04, 11:24 PM, (3) RE: What happened to my .REF file? Is Route Riter to b, yulbrynner, Oct-07-04, 00:05 AM, (4) RE: What happened to my .REF file? Is Route Riter to b, Swissie, Oct-07-04, 07:59 AM, (5) RE: What happened to my .REF file? Is Route Riter to b, MikeSimpson, Oct-07-04, 06:48 PM, (6) RE: What happened to my .REF file? Is Route Riter to b, yulbrynner, Oct-07-04, 10:52 PM, (7) RE: What happened to my .REF file? Is Route Riter to b, Swissie, Oct-10-04, 04:17 PM, (8) RE: What happened to my .REF file? Is Route Riter to b, MikeSimpson, Oct-10-04, 06:22 PM, (9) RE: What happened to my .REF file? Is Route Riter to b, Swissie, Oct-11-04, 03:12 AM, (10) RE: What happened to my .REF file? Is Route Riter to b, MikeSimpson, Oct-11-04, 06:27 PM, (12) RE: What happened to my .REF file? Is Route Riter to b, Swissie, Oct-11-04, 06:54 PM, (13) RE: What happened to my .REF file? Is Route Riter to b, Roman, Oct-11-04, 03:58 PM, (11)

Conferences | Topics | Previous Topic | Next Topic

Charter Member · 984 posts

RE: What happened to my .REF file? Is Route Riter to b

Hi Eduardo,Please send me your .ref file as an email attachment and I will have a look at it. However check that your .ref file is in Unicode, as another thread on this site had a similar problem, and that was the cause.My email address is on the Route-Riter front screen.Mike

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Jun-21-04 · 39 posts

RE: What happened to my .REF file? Is Route Riter to b

What happened to my .REF file? Is Route Riter to blame – image 2

Mike:Thank you very much for this.
Yes, I think it's in Unicode.
I'll send it to you right now..Greetings

Eduardo

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 3749 posts

RE: What happened to my .REF file? Is Route Riter to b

What happened to my .REF file? Is Route Riter to blame – image 3

If you ran Route-Riter on the route (all steps), RR removes unused entries in the .ref file as well as the associated shape and texture files. If you generated a batch file, RR also removes all default routes objects in the .ref, texture and shape files.Cal Rasmussen
Beaverton, OR
(My email is in my profile)Columbia Gorge Route (Phase 2-- On Hold.)

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Jun-21-04 · 39 posts

RE: What happened to my .REF file? Is Route Riter to b

What happened to my .REF file? Is Route Riter to blame – image 4

LAST EDITED ON Oct-07-04 AT 00:17 AM (EDT)

Mike:I converted the REF file to ASCII, and it loaded well the route, so I can edit it in the RE;
But only the 6 most important objects categories are shown:
Road Sections, Sound Regions, Sound Sources, Speed Limits, Tracks Objects, & Track Sections.All the rest disappeared...Greetings

Eduardo

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Sep-27-02 · 1289 posts

RE: What happened to my .REF file? Is Route Riter to b

LAST EDITED ON Oct-07-04 AT 08:15 AM (EDT)

Eduardo,> Road Sections, Sound Regions, Sound Sources, Speed Limits, Tracks Objects, & Track Sections.Most of the above object classes are not listed in the .ref file, but come from other sources: Track & road sections are based on global/tsection.dat, Sound Regions on route/ttype.dat, Sound Sources on route/ssource.dat, speed limits (and mileposts) on route/speedpost.dat. The only "helpful" category might be the "Track Objects". Some track objects (signals, forests) are based on sigcfg.dat or forest.dat, but also the .ref file usually contains a class "Track Objects". This leaves us with two possible conclusions: Either the RE still doesn't read the .ref at all, or it only reads the beginning until it is stopped by an error.As some "Track Objects" that are still being displayed in RE could come from the .ref file, I recommend you open that category and see which individual objects it lists. If there is more than signals and forest regions, then I assume they are at the beginning of your .ref file, and the error in your .ref file will be just after the entry for the last one of these objects that display (note that in RE they are displayed alphabetically, in the .ref file the entries might come in a different order than what you see in RE).For the record and @Mike: I also had problems recently after compacting a route with RR - the previously sound .ref file was giving me error messages after RR had edited all unused items out of it. I then opened the new .ref in Wordpad and started to comment out section by section until I found the part of the file that was giving me problems. Somehow RR deleted one closing bracket too many, and thus messed up the logic of the file. Took me about 2hrs extra work to find the bugger ca. 2/3 through the file, and I have no idea why the error happened, there was nothing unusual to spot about the entry where it occured. As I considered it either caused by an error I had previously installed into the .ref myself, or an exceptional hick-up, I didn't investigate further. Instead of giving feedback, I forgot about it after having fixed it up... Lukas a.k.a Swissie

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 984 posts

RE: What happened to my .REF file? Is Route Riter to b

Hi Eduardo,If you converted the .ref file to ASCII, it should not have worked at all? The ref file should always be in unicode.The .ref file you sent me did not have a 'Class' entry for one object, so this would cause the RE to cease reading the .ref file at that point.Mike

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Jun-21-04 · 39 posts

RE: What happened to my .REF file? Is Route Riter to b

What happened to my .REF file? Is Route Riter to blame – image 5

LAST EDITED ON Oct-07-04 AT 10:55 PM (EDT)

Mike:Well, it's fixed!
Here's what I did:
1) I opened my route with RR.
2) I converted the Ref file to Unicode
3) I opened the .REF file in RR with Ref File Editor
4) I found 30 entries without the Class entries, so I named them all according to my known categories. I opened the route with the R.E., and it loaded it all, showing all the Objects and Categories!
Lukas:Thanks for your explanation in message #6;
Yes, those 6 special categories come from those other files.
As you told me to, I read into the Track Object list, but no other objects were shown.
After fixing the REF file with RR, In Unicode format, the objects came back to where they belonged.Thank you too.
Good Luck!

Eduardo

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Sep-27-02 · 1289 posts

RE: What happened to my .REF file? Is Route Riter to b

LAST EDITED ON Oct-10-04 AT 04:21 PM (EDT)

Hi Eduardo,thanks for sharing your findings. I took this lazy, rainy Sunday afternoon over here and investigated if I could find the reason for my problems with a corrupt .ref after compacting a route. And I'm glad I did so, because I found out that - in a nutshell - hard returns matter as RR seems to need them to properly interpret an entry, which I post here for further discussion and information.After compacting a route I've been working on a few months now, it wouldn't load in the RE anymore due to a corrupt .ref file. I found two cases where RR hick-up'ed on me:1) Missing Hard Returns in EntriesThe first group of problem-makers was some highway bridge sections whose .ref entries were not formatted as usual. Having used "Ref File Manager" on that particular download before installing for whatever reason, the entire entry for each shape was reformatted to one line, so that I copy/pasted a few dozen shapes into my .ref file that looked like:static ( class ( "Bridges Highway" ) filename ( "bridge_13w_strt_100m.s" ) description ( "Highway, Concrete - 13w Strt 100m" ) align ( NONE ) )
static ( class ( "Bridges Highway" ) filename ( "bridge_13w_strt_100m_g.s" ) description ( "Highway, Concrete Graffiti - 13w Strt 100m" ) align ( NONE ) )MSTS RE had no problems with these "unformatted" .ref entries, but it seems that RR skipped all these entries when compacting the route: It didn't edit any one of the unused .s file entries out, so that I got tons of errors about ref entries with no matching .s file in the shapes folder when loading the route in RE.In addition to that, it made a new "misc" entry for those highway bridge sections I had used:Static (
FileName ( "bridge_13w_strt_100m_g.s")
Shadow ( RECT )
Class ( "Misc" )
Align ( None )
Description ( "bridge_13w_strt_100m_g" )
)Conclusion No 1 about .ref file errors in RouteRiter: Entries which are not formatted with hard returns are confusing RR and are skipped in the process.
2) The Dangers of Commenting Out .ref EntriesThe second reason for trouble was self-imposed. Instead of deleting it entirely from the .ref file, I had commented out a shape or two that gave me errors for a missing .ace, as I thought I might add the missing file later. That's what the section in question looked like before RR compacted the route:Static (
FileName ( Skyscraper2c.s )
Class ( "Buildings City" )
Align ( None )
Description ( "Skyscraper 2c" )
)
Comment (
Static (
FileName ( Skyscraper3a.s )
Class ( "Buildings City" )
Align ( None )
Description ( "Skyscraper 3a" )
)
)
Static
(
FileName ( Skyscraper3b.s )
Class ( "Buildings City" )
Align ( None )
Description ( "Skyscraper 3b" )
)Once RR had compacted the route and updated the .ref, the error was fatal:Static (
FileName ( Skyscraper2c.s )
Class ( "Buildings City" )
Align ( None )
Description ( "Skyscraper 2c" )
)
Comment (
Static (
FileName ( Skyscraper3a.s )
Class ( "Buildings City" )
Align ( None )
Description ( "Skyscraper 3a" )
)
Static
(
FileName ( Skyscraper3b.s )
Class ( "Buildings City" )
Align ( None )
Description ( "Skyscraper 3b" )
)Notice the dissappearance of the second closing bracket of the commented-out entry after the compacting (Skyscraper3a.s is not used in the route, so this time I obviously confused RR myself). Again, the hard returns are important in such a situation, as another shape I had commented out was:Comment ( Static (
Class ( "Bridges Highway" )
Filename ( dskchevss2.s )
Align ( None )
Shadow ( Dynamic )
Description ( "Concrete Hwy Bridge - Chevron Switch 2" )
) )This entry got deleted entirely by RR in the compacting, leading me to conclusion No.2: Once again it is proven that hard returns do matter, and if they are not on the line where RR expects them, RR mis-interprets the entry, and messes up that entry - along with the integrity of the entire file.No blame intended, Route Riter is perhaps the most useful tool out there! Still I thought it might be useful to post my findings here, to help avoid the mistakes I made in the future. Mike, I hope you follow the thread, and add these two examples of possible turmoil to your list of trouble-shooting measures recommended to users. Lukas a.k.a Swissie

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 984 posts

RE: What happened to my .REF file? Is Route Riter to b

HI Lukas,Yes, Route-Riter reads the .ref file by the line, using the VB Line Input command - This of course expects a cr/lf at the end of each line.MSTS was supplied with example .ref files in all the default routes. These all use hard returns, and therefore I believe this is how it was intended to work. (Although Kuju obviously built in code to accept other formats because they knew there were people out there who would/could not follow simple instructions.)With regard to the Comment - as far as I know this was never introduced by Kuju? All the .ref files I have with comments use the SKIP command - RR ignores lines preceded by SKIP.Mike

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Sep-27-02 · 1289 posts

RE: What happened to my .REF file? Is Route Riter to b

LAST EDITED ON Oct-11-04 AT 03:16 AM (EDT)

Hi Mike,thanks for the answers! I've figured it out now pretty much myself what works and what doesn't, but thought it is worthwhile to let other users know of what to avoid and/or what to look for when reporting problems.Luckily, most .ref file entries provided in the read-me's by scenery object authors come in the format of the template .ref-files. I don't recall the reason why I needed to put the lengthy section on these custom highway overpasses through ref file manager (where the hard returns got deleted) a year or two ago when I downloaded them, but as it was a very long section of circa 60+ shapes, I never cared about manually re-editing them to the standard format with hard returns. After all, RE was not complaining...SKIP, Comment, and "#" all seem to work making MSTS and its editors skip a line/entry. Thus I've gotten accustomed to always using "comment ()" whenever I wanted to add some notes, or comment out a feature not working as intended. I'll bear in mind to use skip in my .ref files from now on...Another thing that I might add when I am at it: For whatever reason, whenever I am compacting a route, my copy of RR edits out the "buffer.ace" for the default A1tbuffer.s from both the textures and textures/snow folders, although it is in use on the route (along with the A1tUSbuffer, whose yellowbuffer.ace doesn't gets edited out). It might just be a problem with the common files on my copy, but I find it strange that RR is not aware of the .ace being amiss as it doesn't report the missing .ace either when testing the route afterwards. Apart from these few easy-to-fix quirks, your tool has made managing a route project so much easier that I can only praise it! Thanks from a frequent and very satisfied user!Lukas a.k.a Swissie

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 984 posts

RE: What happened to my .REF file? Is Route Riter to b

Hi Lukas,I am trying to rewrite the parsing for the .ref files. It appears that it does not really matter what you put in the Comment ( ) line, even GeorgeBush should work. If MSTS does not understand it then it ignores everything in the braces. I will try to get a new RR out soon, but am rewriting the Help files for use with v6, and Okrasa is looking at an update to his .dll to stop it locking up if it encounters an .s file with errors in it.Not sure why you have problems with the buffer.ace as all my routes use this one, and I have never had a problem with it being deleted. Assuming that you have your A1tbuffer.s in the Global\Shapes folder?Mike

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Sep-27-02 · 1289 posts

RE: What happened to my .REF file? Is Route Riter to b

> Assuming that you have your A1tbuffer.s in the Global\Shapes folder?Hi Mike,just confirmed it, yes, it's in global/shapes where it belongs. The phenomenon only started recently, had it happen a couple of times in different routes (I usually run new installs by third parties through RR, checking for errors and compacting out unused files). I'll keep an eye on the log of files in use/deleted - maybe I find a clue from taking a second look at it.I'll keep you informed.Lukas a.k.a Swissie

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 189 posts

RE: What happened to my .REF file? Is Route Riter to b

>>
>With regard to the Comment - as far as I know this was never
>introduced by Kuju? All the .ref files I have with comments
>use the SKIP command - RR ignores lines preceded by SKIP.
>
>Mike Afaik
_SKIP( ) is used for multiline comments,
_INFO( ) for single line comments/explanations inside the original Tsection.datRoman

Alert | IP


[ Home | MSTS Forum | MSTS FAQ | How To... | File Library ] Copyright © 2004 by Nels Anderson. All Rights Reserved.

Restored from the Train-Sim.Com archive, captured October 22, 2004. About this archive.