Error: System.NullReferenceException AND Unknown ControlStyle PRESSED

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mestevet
    2000 Post Veteran
    • Feb 2007
    • 2225
    • Chadds Ford, PA

    #1

    Error: System.NullReferenceException AND Unknown ControlStyle PRESSED

    Even though I've been around a while, have developed rolling stock and done route building for MSTS for years, I just now today tried to load ORTS for the first time (the new v07, just downloaded). I had to install the XNA 3.1 redistributable (done) and then fired it up. Figuring I'd try something simple, I attempted to load the NECv4 with one of my favorites, which has always worked, the Island Electric PRR "B-1" electric switcher with a couple of very tried and true cars in a consist I've used repeatedly over the years in MSTS.

    Well... Seems ORTS didn't like either of those things, and it spat out an error laden log file, with two major errors that I could detect:

    "Warning: Unknown ControlStyle PRESSED in C:\Program Files\Microsoft Games\Train Simulator\trains\trainset\PRR_EM\CABVIEW\PRR_B-1.cvf:line 38"

    "Error: System.NullReferenceException: Object reference not set to an instance of an object." - followed by a several lines of "at ORTS..." type stuff

    (see attached for the full log)OpenRailsLog NECv4 and B1 con.txt

    Oh Kay, so that was like saying "Hi, what's going on?" and getting punched in the face. I must be doing something wrong or missing something, but I have no clue.

    By the way that "line 38" in the B1 .cvf file is part of the horn control definition in the .cvf file. If it has a problem with that control, I'm afraid what I'm going to find when I try to load up any of my locomotives (I know it's in my Silverliners), and many of my favorites, which make use of that as well:
    Code:
    		TwoState (
    			Type ( HORN TWO_STATE )
    			Position ( 95 2 44 128 )
    			Graphic ( HornRope.ace )
    			NumFrames ( 2 2 1 )
    			Style ( PRESSED )
    			MouseControl ( 1 )
    		)
    Any help from the ORTS team?

    Steve
  • kraus
    1000 Post Veteran

    • Jan 2001
    • 1086
    • Madison, Wisconsin
    • General

    #2
    The error occurs after the warning for the cabview file. Based on the log the error may by in the TTYPE file which is for track sounds.


    Warning: Unknown ControlStyle PRESSED in C:\Program Files\Microsoft Games\Train Simulator\trains\trainset\PRR_EM\CABVIEW\PRR_B-1.cvf:line 38

    Information: OpenAL using device DirectSound

    ENV SIGCFG TTYPE

    Comment

    • mestevet
      2000 Post Veteran
      • Feb 2007
      • 2225
      • Chadds Ford, PA

      #3
      Thanks Jeff, but I'm sorry that doesn't help me to resolve the error. I might be a smart fella but I'm afraid I'd need more than that to diagnose what's going on. I subsequently tried to do the same thing with the default NEC route and got the same error, except this time it's also balking about a missing signal type about which I have no idea (I swear, I have never, even a little bit, fiddled with that default NEC route):

      OpenRailsLog NEC and B1con.txt

      I gotta believe I'm missing something. I get what you're saying about the loading getting stopped in the "TType" portion of the loading, but both of those routes have what appears to be the same TType file, both call the same .sms files (which are all the default "usatrack0in.sms" and "usatrack0ex.sms" type files with numbers 0-9) and all those files call on default .wav files. I notice that the "Ttype.dat" files list the names as "USATrack0In.sms", whereas the .sms files are in all lower case, like "usatrack0in.sms" - is OR case sensitive? If it is, that's going to be a HUGE problem with non-compliant 'heritage' data.

      Steve

      {by the way, I just tried and got the same thing trying to use the default "Tokyo-Hakone" route:OpenRailsLog Tokyo-Hakone B1 con.txt

      Does OR have to be located in a particular location to function properly? I'm wondering if it's getting lost trying to find these "global" type files. My MSTS main installation is right in C:\Program Files\Microsoft Games\Train Simulator\ right where it's always been from the moment it was installed by Bill Gates himself (ok, well not Bill himself, but the installer his company provided). }
      Last edited by mestevet; 12-12-2011, 15:26.

      Comment

      • longiron
        1000 Post Veteran and Moderator

        • Jan 2007
        • 1453
        • Just south of NYC

        #4
        Steve,
        In looking at the log file, the first line after "Object reference not set ...." says UserSettings.Save & Window Location. That's the problem.

        Error: System.NullReferenceException: Object reference not set to an instance of an object.
        at ORTS.UserSettings.Save(String name)
        at ORTS.Popups.Window.LocationChanged()

        How did you install v0.7? Did you also install .NET 3.5 redistributable?
        Last edited by longiron; 12-12-2011, 15:26.
        Chris
        "True rail fans have two favorite railroads. The B&O and one other."

        Comment

        • mestevet
          2000 Post Veteran
          • Feb 2007
          • 2225
          • Chadds Ford, PA

          #5
          Never had another version of OR installed, this was number one, first time I've tried, so I suppose the answer is "New Folder". I'm not trying to resume a saved game, I was simply trying to do an "Explore Route" from one of the defined locations in each (from "Crum Lynne" in NECv4 initially and then "Philadelphia" in NEC)

          **And yes, as I stated initially, I did install the XNA 3.1 redistributable.

          I thought I followed the directions in the "README" and "unzip the installation package to a folder on your desktop or any convenient location" - which I did, it's in a new folder within the folder that I've downloaded the .zip "OR_v07.zip". And simply after that, I followed the next step do "doubleclick on the OpenRails.EXE program"

          Wait - must it be on the same Drive as the default MSTS location? It clearly DID find my MSTS installation, because it showed every route and all the locomotive selections I'm used to (the same .con files).

          Steve

          {it's not a DirectX thing is it? I'm honestly not sure what version I'm running and I'm trying to go back and double check right now, but it's been such a long time since I even thought about it, I'm not sure I remember how to find what version of DirectX I'm running...}

          {well I haven't been able to verify what version of DirectX I'm running but the info on my video card, which is an NVIDIA GeForce 7800 GTX says "Full Microsoft® DirectX® 9.0 Shader Model 3.0 Support" and I think it exceeds the other requirements, even though I know it's an old card, it was top of the line once }
          Last edited by mestevet; 12-12-2011, 15:49.

          Comment

          • longiron
            1000 Post Veteran and Moderator

            • Jan 2007
            • 1453
            • Just south of NYC

            #6
            Originally posted by mestevet
            **And yes, as I stated initially, I did install the XNA 3.1 redistributable.

            Steve
            You did everything correct. Please make sure you have both XNA 3.1 Framework ... AND .NET 3.5 Framework redistributables installed. You can find links to both on our downloads page. It's easy to check, just navigate to Programs and you should see both as being installed on your system.

            BTW, have you tried to load a MSTS default activity just to confirm that OR is working properly? Let's get the basics confirmed and then move on.

            OR requires DirectX v9.0c or later. That's supported by XP SP1 and later, plus any video card produced in the past 5 years.
            Last edited by longiron; 12-12-2011, 16:26.
            Chris
            "True rail fans have two favorite railroads. The B&O and one other."

            Comment

            • mestevet
              2000 Post Veteran
              • Feb 2007
              • 2225
              • Chadds Ford, PA

              #7
              I know I installed the XNA because I initially downloaded it and forgot to actually install it before double-clicking the OpenRails.exe, and it reminded me. Installed that, double-clicked again and got what appears to be the normal "selection" GUI screen.

              Now, as for the .NET 3.5 framework, I thought I had that installed previously, but I'll go back and double check that again.

              Can you also tell me what version of DirectX it requires - I'm assuming 9 or later, right? I don't game a lot, so I don't keep upgrading my DirectX like I'm assuming a lot of other folks do (finally refreshed my memory about the DirectX and ran DxDiag, now I'm looking at that).

              I have to put this down for a little bit, gotta take my kid to his Gymnastics class...

              This is why I've resisted actually doing it, I knew I'd have to spend time troubleshooting. Not a hack on OR or the team, just that I know that's the way things tend to go with computers...

              Steve

              Comment

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

                #8
                Originally posted by mestevet
                "Error: System.NullReferenceException: Object reference not set to an instance of an object."
                You should either start Open Rails once from the smaller menu or open the options window and save it to fix this.
                James Ross
                Open Rails Management Team
                sigpic

                Comment

                • longiron
                  1000 Post Veteran and Moderator

                  • Jan 2007
                  • 1453
                  • Just south of NYC

                  #9
                  Steve,
                  There was a bug in the code (since been fixed in dev build) if you used the fancy menu system and it was the first time you ever installed OR, then you got this error. Follow the directions above and all should be well.
                  Chris
                  "True rail fans have two favorite railroads. The B&O and one other."

                  Comment

                  • mestevet
                    2000 Post Veteran
                    • Feb 2007
                    • 2225
                    • Chadds Ford, PA

                    #10
                    OK, so I verified that I have the XNA 3.1 redistributable installed. I re-downloaded the .NET 3.5 framework (which, when I attempted to install it, told me I already had it installed, but ask if I wanted to "repair" it, I have a feeling that I just overwrote some later updates though...). I also verified through "dxdiag" that I do indeed have DirectX 9.0c installed (4.09.0000.0904). So all those things are out of the way going forward.

                    At first, I wasn't sure what "start Open Rails once from the smaller menu" means. I double click on "OpenRails.exe" and I get a "Loading Train Database" with a "tick bar". Then this:



                    Then, engaging my brain, I said to myself "I wonder if they mean to use the "Switch Menu Style" button on the bottom" - so I tried that and got this menu:



                    To stay consistent, I tried exactly what I had initially, the NECv4 with the trusty Island Electric B1 in "Explore Route", and this time I got this:



                    Which is my way of saying, in pictures, that it worked. After that, I switched back to the fancy menu and was also now able to get it to work. Interesting bug.

                    OK, now I have to go on and see how my Silverliners and my E44 work in this, be prepared for some whining

                    I bet nobody anticipated the kind of controller the Silverliners have, with no "forward-reverse" just positive and negative throttle positions from a center "off"...

                    {addition: Sorry, guys, I forgot my manners, THANK YOU both very much for your help in getting me straightened out! I look forward to more productive sessions with OR, so far, looks great!}

                    Steve
                    Attached Files
                    Last edited by mestevet; 12-12-2011, 20:42.

                    Comment

                    • longiron
                      1000 Post Veteran and Moderator

                      • Jan 2007
                      • 1453
                      • Just south of NYC

                      #11
                      Steve,
                      Glad to see you are up and running. Now enjoy for a while
                      Chris
                      "True rail fans have two favorite railroads. The B&O and one other."

                      Comment

                      Working...