Skip to content

Conversation

@AmberIsFrozen
Copy link
Contributor

  • Fix playerTrackDistance & playerTrainDistance throwing errors in ObjectViewer/RouteViewer
  • Fix PrimaryKlaxon, SecondaryKlaxon, MusicKlaxon not recognized as a variable in RouteViewer
  • Change TFO warning message in RouteViewer to informational message. It's a noteworthy message but given that it's not actionable by the developer and will work properly in the main simulation, I am not certain this should be classified as a warning like any other messages.

N.B. It's interesting to see that the klaxon variables only target the player train as that's not explicitly stated in the documentation (Although I suppose back then there's no real way for non-player train to initiate a horn)

@leezer3
Copy link
Owner

leezer3 commented Oct 15, 2025

Hmm...

I'm not actually sure copying the code from the main sim for the horn variables is the 'correct' fix for Route Viewer.
My initial thought would be to just no-op all the missing horn values (e.g. return zero)
For the distance ones. it might actually be better to link to the camera track position.

The TFO message is definitely information though.

I really need to look again at this PR though:
#165

I can't remember off the top of my head exaxctly what's broken (and it'd need to be fixed up for relevance with the current mainline), but really discontinuing Route Viewer in favour of just a 'new' main game mode is a better solution in the long run.
There are a bunch of other bits and bobs which aren't implemnted properly in Route Viewer (dynamic backgrounds /lights for one IIRC), and at the end of the day, maintaing two different copies of what's essentially the same thing isn't the cleverest thing in the world...

@AmberIsFrozen
Copy link
Contributor Author

That's true, I noticed most of the other functions aren't no-op so I just proceeded through
IIRC there are more variables which aren't parsed in RouteViewer, but bisecting them gets out of hand quickly...

@leezer3
Copy link
Owner

leezer3 commented Oct 15, 2025

Yeah :/

The viewers are a mess to be honest, and it's an absolute PITA remembering to update them when something is added.
I'm currently working on a basic vaccum brake for the MSTS parser (In theory this is remarkably simple, after all the physics are only really an air brake in reverse at the end of the day), and this is just showing quite how entangled some of this stuff is.

@leezer3 leezer3 closed this in 33e9d60 Oct 15, 2025
@leezer3
Copy link
Owner

leezer3 commented Oct 15, 2025

I've added the missing horn instructions as no-ops in both viewers.
Route Viewer will now use the camera track position for TrackPosition based instructions.
Object Viewer will now return zero for these.

Have also picked out the change from error to info message. This should sort these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants