Elvas Tower: MSTS legacy US2BNSFCar.wag no more loading - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

MSTS legacy US2BNSFCar.wag no more loading Rate Topic: -----

#1 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,019
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 03 April 2015 - 09:18 AM

The US2BNSFCar.wag, that is a car coming from the original MSTS release, doesn't load any more in recent OR versions, due to a problem of casting in braking parameters, see attached logfile.
Attached File  OpenRailsLog.txt (57K)
Number of downloads: 233

OK, I found the problem: it's the same as here http://www.elvastowe...missing-wagons/ , in an ORIGINAL MSTS wagon. A parenthesis too much after the Lights() block...
Maybe there are other original wagons with this problem?

#2 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,019
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 03 April 2015 - 11:18 PM

Looking a bit better into the problem, I have the impression that (apart of the missing parenthesis) however maybe there could be an OR bug.
In the corrected .eng file I commented out the BrakeSystem () line and I got the same error. The error ( Unable to cast object of type 'ORTS.AirSinglePipe' to type 'ORTS.SingleTransferPipe') comes out at line 42 of SingleTransferPipe.cs, that is
            SingleTransferPipe thiscopy = (SingleTransferPipe)copy;

I believe to remember that it was allowed to have cars without brake system line, or don't I remember well?

#3 User is offline   gpz 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,772
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 03 April 2015 - 11:41 PM

What I am concerned about here is, how is it at all possible, that the copied wagon has AirSinglePipe brake system, while it is being copied to a one with SingleTransferPipe? They must have exactly the same config!

I recently changed the behavior, that by default, if no BrakeSystem() is present, single trasfer pipe will be selected. It was asked by copperpen, to match MSTS behavior. But this alone should not lead to any problems. (I will not be able to look into code before Tuesday.) The question is what I wrote above. :p

#4 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,019
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 03 April 2015 - 11:57 PM

Yes, it' strange, but when you have time it's easy to test. Take any car, remove the BrakeSystem line, make a consist of at least two such cars and run OR! :p

#5 User is offline   copperpen 

  • Executive Vice President
  • Group: Status: Elite Member
  • Posts: 3,144
  • Joined: 08-August 05
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 04 April 2015 - 10:28 AM

The specific error is caused by not having a brake equipment line in the wag or eng file. If the line is present but no data in the brackets, OR substitutes with no error.

#6 User is offline   cr-stagg 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 909
  • Joined: 16-May 05
  • Gender:Male
  • Simulator:OR
  • Country:

Posted 04 April 2015 - 01:33 PM

View PostCsantucci, on 03 April 2015 - 09:18 AM, said:

The US2BNSFCar.wag, that is a car coming from the original MSTS release, doesn't load any more in recent OR versions, due to a problem of casting in braking parameters, see attached logfile.
Attachment OpenRailsLog.txt

OK, I found the problem: it's the same as here http://www.elvastowe...missing-wagons/ , in an ORIGINAL MSTS wagon. A parenthesis too much after the Lights() block...
Maybe there are other original wagons with this problem?

I have an install I call "Pure MSTS" an install from the CDs with no edits and no additions. Just checked all the US2xxxxx.WAG files and those two are the only ones with the extra closing paren. But there have been many, many repaints.

#7 User is offline   roeter 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,426
  • Joined: 25-October 11
  • Gender:Male
  • Country:

Posted 05 April 2015 - 03:25 PM

Problem was caused by a straigthforward error in MSTSWagon.
The new method setting brake type was called during parsing of "brakesystemtype" in wagon or engine file, and during the copy action. If on these calls the defined brake type was "null", brake system would be set to "SingleTransferPipe".
However, if "brakesystemtype" was not set at all, then, after parsing, the brake type would also be "null", but then the brake system would be set to "AirSinglePipe".
So, the first loaded instance of a wagon which did not have "brakesystemtype" defined would get brake system "AirSinglePipe", while any copies would get brake system "SingleTransferPipe". This caused the mismatch, and thus the load error.
The error is corrected in version 2989, by setting the brake type to "SingleTransferPipe" if "brakesystemtype" is not defined at all.

Regards,
Rob Roeterdink

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users