I am trying to understand the function of LuaEntity#connected_rail_direction. I have these four train stops:
All four report a connected_rail_direction of "0" (which is defines.rail_direction.back). Under which circumstances would a train stop report defines.rail_direction_front. And what exactly does that direction represent?
[2.0.76] LuaEntity.connected_rail_direction
Re: [2.0.76] LuaEntity.connected_rail_direction
When a train goes to a train stop, the pathfinder is pointed at a specific rail as a path goal, but that information alone is not enough as it would allow train to approach that rail from either side. Because of this the trains pathfinder must be also told what is the rail direction of the target rail related to the direction it should approach it. As it is implemented right now, all horizontal and vertical straight rails obey the same set of rules about where the front and back is, which means value returned by LuaEntity::connected_rail_direction currently only depends on the direction of the train stop itself and does not require it to be attached to any rail. You can also use `show-rail-connection-points` debug layer to see where fronts and backs of each rail are and how does it correspond to the value returned by LuaEntity::connected_rail_direction.

