System.NullReferenceException error on TA_VR_NE_1950s route

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lindsayts
    Senior Member
    • May 2010
    • 194

    #1

    System.NullReferenceException error on TA_VR_NE_1950s route

    I get this error on all versions of OR except V360. The error only occurs when starting on a particular tile. Any Idea on how I can fix this.
    Looks a bit like it is looking for a signal and can not find it.

    By the way I noticed the intermitent smoke problem on ATI cards has been fixed, good :-)

    With any kind of luck the OpenRailsLog.txt is attached
    Attached Files
    Last edited by lindsayts; 08-03-2011, 18:21.
  • kraus
    1000 Post Veteran

    • Jan 2001
    • 1086
    • Madison, Wisconsin
    • General

    #2
    Where can I get a copy of this route, TA_VR_NE_1950s?

    One possible cause is a mismatch between the signal defintion and the signals in the track database. To compare these find and post both the signal definitions and the signals from the track database. Step one is to open world file w-001202+010095.w and search for TrItemId ( 0 2032 ). Copy the entire Signal element containing signal 2032 and post to this thread. Also, open file sigcfg.dat and search for the SignalShape named by FileName from the Signal copied from the world file and post that to this thread. I will go over the following steps after having these two items.

    Comment

    • lindsayts
      Senior Member
      • May 2010
      • 194

      #3
      Quick reply, had not even taken a breath..........

      URL for the route is
      http://msts.steam4me.net/routes/vic_ne1950.html

      I will have a look as you have sugested

      Lindsay

      Comment

      • lindsayts
        Senior Member
        • May 2010
        • 194

        #4
        From file w+001202+010095.w

        Signal (
        UiD ( 2032 )
        FileName ( VR_Home_Disc.s )
        Position ( 416.011 20.1133 857.593 )
        QDirection ( 0 0.406737 0 0.913545 )
        VDbId ( 4294967295 )
        SignalSubObj ( 0000000f )
        SignalUnits ( 4
        SignalUnit ( 0
        TrItemId ( 0 217 )
        )
        SignalUnit ( 1
        TrItemId ( 0 218 )
        )
        SignalUnit ( 2
        TrItemId ( 0 219 )
        )
        SignalUnit ( 3
        TrItemId ( 0 220 )sigcfg.d
        )
        )
        )

        From file sigcfg.dat

        SignalShape (
        "VR_Home_Disc.s"
        "Somersault Post RightSubsid-Home 25ft no weight"
        SignalSubObjs ( 4
        SignalSubObj ( 0
        "HEAD1"
        "Main arm"
        SigSubType ( SIGNAL_HEAD )
        SignalFlags ( JN_LINK )
        SigSubSType ( "SomersaultHome" )
        )
        SignalSubObj ( 1
        "HEAD2"
        "Main Spectacle Plate"
        SigSubType ( SIGNAL_HEAD )
        SignalFlags ( JN_LINK )
        SigSubSType ( "SpecPlate_SomersaultHome" )
        )
        SignalSubObj ( 2
        "HEAD3"
        "Subsid Arm"
        SigSubType ( SIGNAL_HEAD )
        SignalFlags ( JN_LINK )
        SigSubSType ( "SomersaultHome" )
        )
        SignalSubObj ( 3
        "HEAD4"
        "Subsid Spectacle Plate"
        SigSubType ( SIGNAL_HEAD )
        SignalFlags ( JN_LINK )
        SigSubSType ( "SpecPlate_SomersaultSubsid" )
        )
        )
        )

        Comment

        • lindsayts
          Senior Member
          • May 2010
          • 194

          #5
          Also in case its of any help here is relevent portions of the file sigscr.dat

          SCRIPT SpecPlate_SomersaultSubsid
          // Spectacle Plate Somersault (Subsidiary)

          extern float block_state ();
          extern float route_set ();
          extern float def_draw_state ();
          extern float state;
          extern float draw_state;
          extern float enabled;

          if (!enabled || // Not enabled/cleared to show natural state?
          block_state() !=# BLOCK_CLEAR || // Block ahead not clear?
          !route_set()) // Switch not set as per link?
          {
          state = SIGASP_STOP;
          }
          else
          {
          state = SIGASP_CLEAR_2;
          }

          // Get draw state
          draw_state = def_draw_state (state);
          ///////////////////////////////////////////////////////////////////////////////

          Comment

          • kraus
            1000 Post Veteran

            • Jan 2001
            • 1086
            • Madison, Wisconsin
            • General

            #6
            Would you find the signal with TrItemId ( 0 2032 ). That is not the same as a signal with UiD ( 2032 ). The first attribute of TrItem is 0 which indicates track while a value of 1 indicates road. The second attribute is the identifier of the signal in the track database. The attribute of element UiD is the identifier within the world file. These identifiers should be unique within a world file but can be reused by different world files.

            Comment

            • lindsayts
              Senior Member
              • May 2010
              • 194

              #7
              I believe I have this figured out. The signals concerned (theres three of them) are a somersault with disk signal below it. On the signal shape only three animated items are availble. The somersault arm, its spectacle plate and the disk signal. I think Openrails is complaining as everything is saying there are 4 items and it apparently is only finding the three mentioned. Next time I start Windows (I run LInux normally) I will remove the reference for "HEAD4" and see what happens.

              Lindsay
              Last edited by lindsayts; 08-04-2011, 01:29.

              Comment

              • twpol
                Senior Member
                • Oct 2009
                • 434
                • United Kingdom

                #8
                The problem is this signal in w+001202+010095.w:

                Code:
                Signal (
                  UiD ( 2170 )
                  FileName ( VR_LH_Disc.s )
                  StaticFlags ( 00002000 )
                  Position ( 207.795 24.0163 1001.82 )
                  QDirection ( 0 0.494321 0 0.869279 )
                  VDbId ( 4294967295 )
                  SignalSubObj ( 00000000 )
                 )
                Open Rails is objecting to the complete lack of a SignalUnits section - even an empty one should fix the problem. I have, however, fixed the development version to cope with this and it'll just print the following in the future:

                Code:
                RunActivity.vshost.exe : Error : 0 : {TileX:1202 TileZ:10095 X:207.795 Y:24.0163 Z:1001.82} signal 2170 has no SignalUnits.
                James Ross
                Open Rails Management Team
                sigpic

                Comment

                • lindsayts
                  Senior Member
                  • May 2010
                  • 194

                  #9
                  Thank you for this, I repaired the problem with for the three signal defs mentioned. This got rid of the resulting error messages but OR still did not load. So I gave up not knowning enough about the internerls of MSTS signalling or OR.

                  Lindsay

                  Comment

                  Working...