I've assumed some agnostic methods would be:
/1. the least x then least y carriage orientation, or reversed, least y then least x
/2. first locomotive orientation based on position
/3. orientation of the frontmost entity in 'leading' locomotive's orientation
/4. something with selected train orientation when 'connect stock' is used
But none of these seem to be it.
Included is an example save. Image for reference: On the bottom loop for example, if the train is on the top side, disconnecting the carriages and reversing either locomotive then reconnecting everything has the effect of not re-orienting the train, but on the bottom the train carriage order reverses when either locomotive is rotated.
Here is an example command to show which things are changing:
Code: Select all
/c
local train = game.player.selected.train
local string = ""
for i, carriage in pairs(train.carriages) do
string = string.."\n"..i..": "..carriage.name.." orientation: "..carriage.orientation
end
game.print(string)