System.NullReferenceException at ORTS.Viewer3D.RollingStock.MSTSLocomotiveViewer.StartRefilling (X3226, WP 3rd Sub, CZ Introduction, wash rack & signal)

Bug #1488329 reported by James Bradley, Jr.
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Open Rails
Triaged
Undecided
Unassigned

Bug Description

The activity "CZ Introduction" on the WP Feather River Sub (by 3D Trains) requires you to take the train through the wash rack before proceeding on the main. The pop-up instructions say the following:

1)Proceed up to the wash rack signal, then stop your train.
2)Press "T" to request permission to enter the wash rack.
3)Wash rack signal will change from Lunar to Purple.
4)Press "CAPS LOCK" and "T" to activate the wash rack.
5)Proceed through the wash rack no faster than 2 MPH.

I have done this activity many times in MSTS, and it has worked. However, in OR, an error message comes up stating that you are too far from the water point, even though the feature works in MSTS. The wash rack signal will not change to Purple.

Proceeding into the wash rack while pressing "T" causes OR to fail.

Although this feature may be unique to the WP Feather River route, I would like to see it functional in OR. I have attached my OR Log, as well as the .sigcfg and .sigscr files.

Tags: crash graphics
Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :
Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :
Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :
James Ross (twpol)
summary: - Wash Rack & Signal on WP Feather River Route causes OR to crash
+ System.NullReferenceException at
+ ORTS.Viewer3D.RollingStock.MSTSLocomotiveViewer.StartRefilling (X3226,
+ WP 3rd Sub, CZ Introduction, wash rack & signal)
Changed in or:
status: New → Triaged
tags: added: crash graphics
Revision history for this message
Carlo Santucci (carlosanit1) wrote :

This route seems to have unusual pickup types. Can you please attach:
1) the .tdb file;
2) the .w file where the pickup is located; to find out this, open the F5 debug hud, and when you are at the pickup read the first two parameters of the last HUD line (Camera). With these you can go in the World subfolder and get the file.

Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :
Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :
Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :

I can't see anything in the .w file other than random symbols. Hopefully...you can make sense of it.

Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :

Here is the entry for the Wash Rack signal:

Pickup (
  UiD ( 963 )
  SpeedRange ( 0 0 )
  PickupType ( 5 0 )
  PickupAnimData ( 3 2 )
  PickupCapacity ( 200000 2000 )
  TrItemId ( 0 836 )
  CollideFlags ( 576 )
  FileName ( wp_wash_2hd_lens.s )
  Position ( 83.7086 1473.08 -321.759 )
  QDirection ( 0 -0.528068 0 0.849202 )
  VDbId ( 4294967295 )
 )

And here is the entry for the wash rack itself:

Pickup (
  UiD ( 859 )
  SpeedRange ( 0 0 )
  PickupType ( 5 0 )
  PickupAnimData ( 3 2 )
  PickupCapacity ( 200000 2000 )
  TrItemId ( 0 751 )
  CollideFlags ( 576 )
  FileName ( GX-WashRack01.s )
  Position ( 29.4134 1473.1 -351.351 )
  QDirection ( 0 -0.533134 0 0.846031 )
  VDbId ( 4294967295 )
 )

I'm not sure what any of these values mean, so hopefully someone here can interpret them and fix the issue. Thanks!

Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :

Just attempted this activity again with the most recent version of OR, and it still causes OR to crash. The wash rack signal still does not function when pressing "T", however it does not cause OR to crash.

Entering the wash rack, OR counts down the distance in meters until the wash rack (water source) has been reached. A message then appears that the locomotive MUST be stationary, which contradicts the direction in the activity (proceed at 2 MPH) and the way MSTS would handle this pickup. When I stopped the train in the wash rack and pressed "T", an error message appeared that the wash rack was an incompatible water type and OR crashed.

I have attached the OR Log Report for reference.

Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :

F.Y.I....I have discovered that the Wash Rack signal is not part of the actual signaling system (i.e. SigCfg.dat), but is actually a "Pickup Object". The signal files can be ignored, as this appears to be an issue with Pickup Objects, not signals.

Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :
Revision history for this message
Carlo Santucci (carlosanit1) wrote :

Hi James,
long time since we interacted about this.
At the moment I'm not able to say why you get the crash, but I can tell you that the fact that you get the message that the locomotive MUST be stationary is well justified, because the SpeedRange of the pickups as defined in the .w file is
  SpeedRange ( 0 0 )
as yourself can see in your post #8. So, min speed and max speed are both set to 0.
So, in order for the pickups to become operating, these lines should be replaced with
  SpeedRange ( 0 2.0 )
(first value is min speed, second value is max speed in mph).
I think this should be done for all wash rack pickup entries in the .w file, that is entries 963, 964, 859, 858 and 860.
However I think this could not be enough, because I still expect you get the indication that the wash rack is of an incompatible water type. In fact OR checks if the pickup type is compatible with the loco running under it. So a water pickup can be activated only by a steam loco with tender.

Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :

Carlo,

It has been a long time since we interacted about this. Is it possible to remove the stipulation in OR that the locomotive MUST be of a compatible type? In the real world, a water tower would still be operable, even if it had a diesel below it instead of a steam loco. It shouldn't matter what type the player's locomotive is, only that the pickup object is operational. If the pickup were coal, but the locomotive doesn't use coal for fuel, the coal chute would still open and there would be no effect on the player train.

In the case of my scenario on the WP Feather River, the wash rack and wash rack signal should still be operational, even though a diesel loco doesn't use water. You should still be able to see the animation, but it won't have any effect on the player's train.

Just a suggestion.

--James

Revision history for this message
James Bradley, Jr. (jbrad1974) wrote :

It has been awhile since I visited this issue. Just attempted changing the "PickupType" value to several values between 0-9. The only two values that appear to work are 6 & 7.

With 6, the Wash Rack signal is recognized as a "Coal" pickup, giving a distance to the coal chute. However, OpenRails crashes as soon as the distance is zero.

With 7, the Wash Rack signal is recognized as a "Diesel Fuel Oil" pickup, giving a distance to the fueling point. When the distance reaches zero, OR does not crash and I get a popup that states "Fuel Oil Full". The signal itself never changed from lunar to purple (animated) as it is supposed to.

Either OR doesn't recognize any PickupType value other than 6 & 7 (i.e. 5 is not defined), or the engine type is not compatible. I suspect it is the first reason, as the activity is using a diesel but still recognized the coal pickup. This would also explain why the sand towers were not recognized as a valid pickup either. OR needs to have it's code updated to recognize all pickup types, regardless of the type of locomotive being driven.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.