Passenger Train Stopping At Engine

boleyd

Well-known member
Passenger train stops at the Engine, not at the passenger cars. Station passengers seem to unload/load normally from the 2 passenger cars. Doors also operate properly. If a steamer train , it stops at the tender. I have several different terminals/stations on the route and they all have the same issue. I know this was messaged earlier, but has any solution been created?
 
The rule for all industries (including passenger stations) is:
- the DriveTo/NavigateTo command drives the train to the beginning of the industrie (= first attachmentpoint for a track reached at the industry)
- the Load/Unload command drives the train to the loading/unloading position, and does the loading/unloading
There are some commands, which combine these 2 commands into a single command (CallAt ?)
.
Peter
 
This has always been the case. It's annoying when the passenger consist trails far behind the locomotive. This applies not only to AI but also to human drivers driving to interactive stations. I noticed too that the engine has to stop somewhere within the station boundary-box in order to trigger the loading and unloading.
 
The engine? The engine? That`s just plain wrong. It should not matter whatsoever where the locomotive is located as long as suitable transport vehicles are within range of the target mark. If this is true (and I do believe you), it should be reported as a bug.
 
The engine? The engine? That`s just plain wrong. It should not matter whatsoever where the locomotive is located as long as suitable transport vehicles are within range of the target mark. If this is true (and I do believe you), it should be reported as a bug.
A bug that goes back at least 20-years to TRS2004 SP2 when interactive stations and industries first appeared.
 
The position, where the train is stopped for loading/unloading, is defined by the script of the industry (station). The most common methods for stopping the train are:
- the vehicle at the center of the train has reached the trigger at the center of the active station area
- the last vehicle of the train has entered the active station area
- the first vehicle of the train has reached the opposite end of the station area

Peter
 
A bug that goes back at least 20-years to TRS2004 SP2 when interactive stations and industries first appeared.
I can (and do) believe that one, too! Still should be reported. <grumble>
The position, where the train is stopped for loading/unloading, is defined by the script of the industry (station).
In that case, in any such script that I ever write, I expect to define arrival as the first suitable vehicle at the last suitable space, with the possible exception of trains that are so short that the entire train fits within the action area. In that case, the relevant vehicles can be anywhere within the action area. Similar exception for trains that can fit all of the relevant vehicles within the action area. Hmm, the first exception turns out to be a subset of the second.
 
This script from one of my station tracks allows for three different-length trains to use the station. Long trains stop at the end while shorter trains stop nearer the middle. Some station scripts get the length of the train and then stop it with the middle coach at the center of the platform.

Code:
class Station isclass GenericPassengerStation
 
    if (lengthOfTrain < 6 and (triggerName == "trigger_track_2_d" or triggerName == "trigger_track_2_e"))
    {
      int direction = vehicle.GetRelationToTrack(me, "track_2");
      if (!vehicleToTrain)
          direction = -direction;

      if (direction == Vehicle.DIRECTION_BACKWARD and triggerName == "trigger_track_2_d")
        return true;
   
      if (direction == Vehicle.DIRECTION_FORWARD and triggerName == "trigger_track_2_e")
        return true;
    }

    if (lengthOfTrain < 11 and (triggerName == "trigger_track_2_c" or triggerName == "trigger_track_2_h"))
    {
      int direction = vehicle.GetRelationToTrack(me, "track_2");
      if (!vehicleToTrain)
          direction = -direction;

      if (direction == Vehicle.DIRECTION_BACKWARD and triggerName == "trigger_track_2_c")
        return true;
   
      if (direction == Vehicle.DIRECTION_FORWARD and triggerName == "trigger_track_2_h")
        return true;
    }

    if (lengthOfTrain > 10 and (triggerName == "trigger_track_2_b" or triggerName == "trigger_track_2_k"))
    {
      int direction = vehicle.GetRelationToTrack(me, "track_2");
      if (!vehicleToTrain)
          direction = -direction;

      if (direction == Vehicle.DIRECTION_BACKWARD and triggerName == "trigger_track_2_b")
        return true;
   
      if (direction == Vehicle.DIRECTION_FORWARD and triggerName == "trigger_track_2_k")
        return true;
    }
Edit (by moderator): Added code tags.
 
Last edited by a moderator:
Thank you, @stagecoach. Do you know how to wrap code in [CODE][/CODE] tags? It preserves the indentation and makes it easier to read.

What happens when a bool function fails to return anything? I would think that it should be an error, which terminates the script, and the script that you posted appears to be doing just that.

One more thing, did you write that code yourself? If not, has the author granted permission to share it like this? I wouldn`t want to accidentally use someone else`s code without permission.
 
Nice... (y)

Can I use this piece of code with any station?

If yes, how? :confused:


hoedje.gif
 
The position, where the train is stopped for loading/unloading, is defined by the script of the industry (station). The most common methods for stopping the train are:
- the vehicle at the center of the train has reached the trigger at the center of the active station area
- the last vehicle of the train has entered the active station area
- the first vehicle of the train has reached the opposite end of the station area

Peter
I'm not too sure about this. I always use the same set of stations (DMT) and roughly the same locomotives, but sometimes the trains stop where they should - best case, with locomotive just past the end of the platform - and sometimes, within the same route, another locomotive will stop at one or more stations either way too soon or way past. I really think it must be a bug in the game rather than in the station code.
 
Probably a little bit of both, @rhban. The station script is supposed to control where the train stops, but many of the changes made lately in preparation for The Living Railroad and other upcoming features have broken (or at least severely bent) many existing assets. Some interaction between the two probably controls the actual outcome. As @stagecoach mentions, some of those changes may have affected the triggers used by the stations, and those trigger setting also affect the stopping location.

Just curious, when this occurs multiple times within a session, do the mis-placed stops occur for all engines at a given station, all stations for a particular locomotive, or apparently at random? Does this occur only for a specific instance of either one, or for all instances? In other words, is there any discernable pattern to where and when this occurs?
 
Another problem could be the enginespec. The AI requires a really powerfull (DCC) brake, to stop in the correct position.

Peter
 
Another problem could be the enginespec. The AI requires a really powerfull (DCC) brake, to stop in the correct position.

Peter
The really ancient, ca. TRS2004 passenger stations have the stopping power to bring a train to a stop instantly. The engine though always lines up at the end of the platform.
 
Probably a little bit of both, @rhban. The station script is supposed to control where the train stops, but many of the changes made lately in preparation for The Living Railroad and other upcoming features have broken (or at least severely bent) many existing assets. Some interaction between the two probably controls the actual outcome. As @stagecoach mentions, some of those changes may have affected the triggers used by the stations, and those trigger setting also affect the stopping location.

Just curious, when this occurs multiple times within a session, do the mis-placed stops occur for all engines at a given station, all stations for a particular locomotive, or apparently at random? Does this occur only for a specific instance of either one, or for all instances? In other words, is there any discernable pattern to where and when this occurs?
I'll have to check on that, but I rarely use more than 2 or 3 types and, when I'm beginning a new route, use just the one type. But I confess I do sometimes slip in different station types.
 
Finding a pattern to the failures goes a long way to identifying the culprit. Please keep your eyes proverbially peeled (Ouch! That should hurt something awful if literal!) and let us know what you find. @p-dehnert and @JCitron are both correct that the enginespec can influence the slow-down and stations (or really, any script) can bring a train to an instant stop. With so many different elements affecting the train upon arrival, it`s not surprising if things occasionally go weird.
 
I'll have to check on that, but I rarely use more than 2 or 3 types and, when I'm beginning a new route, use just the one type. But I confess I do sometimes slip in different station types.
I did a check. My current route mainly uses DMT stations and a few VSR "platform" which work perfectly. Only one faulty one: Sen City Brick Station Large - which is a pity because, although it's not beautiful, it is quite a useful asset for a change of scenery. This one stops the locomotive a very short way into the station.
 
Back
Top