Func_tracktrain with "Stations"

So I’m trying to create a func_tracktrain that responds normally to the startForward and startBackward inputs to move it along its track (these will be supplied by func_buttons the player can use), but when it hits certain specific path_track entites along that path it will stop and require another startforward or startbackward input to get it moving again. (This would be useful for creating a tram with different predetermined “stops” the user can move back and forth between, or an elevator that moves up and down across multiple floors, etc.)

I have already tried giving the station nodes an “OnPass [train] Stop” output, but this does not seem stable- sometimes the tram will immediately stop when it attempts to leave the station node, creating the appearance that it is “stalled” or that the button press did not work.

So I’ve found a workaround using a telescoping system of func_doors parented one-after-the-other, which is actually fairly practical and scales well. However, while fine for an elevator that moves strictly along one axis (in this case the vertical), it’s not going to be of much use for a train that turns corners.

Use the onPass for the path_track but have it trigger a logic_relay?
the logic_relay then tells the train to stop.
Disable the logic_relay when it’s triggered and only enable it after the train has started moving forward / backwards after a few seconds again?

Thus if you get an OnPass when moving forward, you will only trigger a disabled logic_relay, thus the train should continue forward.

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valve’s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.