Page 1 of 1

[0.18.24] Rolling stock snapping offset when part of train on curve

Posted: Sat May 16, 2020 11:11 pm
by Phoenix27833
When part of a train is on a curve, the snapping points for adding a new wagon on the straight section no longer correspond to the position of the back wagon but have an offset.
For the mod I am developing wagons added to the back of the train via script based on the back_stock position do not always attach because of this. I can probably compensate for it if you don't want to fix it.

Train on curve, the snap point is offset and the wagons are intersecting
Image

Train on straight track the snap point nicely matches the back of the train
Image

Re: [0.18.24] Rolling stock snapping offset when part of train on curve

Posted: Thu Jul 16, 2020 9:05 am
by posila
Hello, drawing trains on curves does some wild compensations for perspective shift, and sprites are shifted out of their center position. If you turn on collision rectangles in debug settings (F), you can see the last wagon is shifted back, and that's why it visually collides with building preview of the snapped wagon. That's minor visual issue.

But I don't think this is related to your issue with wagons not attaching when building them from stript. If you could provide small save and command I can run to reproduce the issue, that would be helpful. Thank you.