I wanted to add this feature to a mod, but gave up when I realized this is the algorithm I would need to use.
Code: Select all
function split_train_in_half()
Copy all properties of carriage n/2+1
Delete carriage n/2+1
Teleport the surviving carriages in the second train to an empty area of the map
Recreate carriage n/2+1
Paste all properties of carriage n/2+1
Teleport the second train back to its original position
end