I wanted to define a couple of custom track sections using the "<route folder>/openrails/tsection.dat" extension file. And I suspect I ran into an issue with TSRE.
The example below is not the scenario I initially encountered this in. I have boiled it down to make it simple and reproducible.
Below is the extension tsection.dat. It is merely the standard A1t1000r5d.s copied from the global tsection. Only the ID's are changed.
If we lay track like in the screenshot below, the TDB data of one of the custom A1t1000r5d.s track sections will get messed up.
Screenshot 2025-02-13 160707.png
What happens here is that the SectionIdx of the track piece that breaks gets set to ID + 1 in the TDB by TSRE.
Below is the TDB data for the two track pieces, I have marked the troublemaker in red. That number should really be 10000. 10001 is not defined anywhere, not even in the global tsection:
TrackNode ( 2
TrVectorNode (
TrVectorSections ( 2 10001 10000 -5655 15119 9 1 0 00 -5655 15119 748.9239 0.9782489 -343.3117 0 6.195919 0 10000 10000 -5655 15119 8 0 1 00 -5655 15119 745.1186 0.9782489 -256.156 0 0 0 )
)
TrPins ( 1 1
TrPin ( 1 1 )
TrPin ( 3 1 )
)
)
So the question here is: Am I doing something wrong? Or is this an issue with TSRE?
If I am doing something wrong I don't see what it is currently. It works fine for the original A1t1000r5d.s track piece, but not if I define it in the extension tsection with a new ID.
Log is attached.
The example below is not the scenario I initially encountered this in. I have boiled it down to make it simple and reproducible.
Below is the extension tsection.dat. It is merely the standard A1t1000r5d.s copied from the global tsection. Only the ID's are changed.
Code:
include ( "../../../GLOBAL/tsection.dat" )
TrackSections ( 40000
TrackSection ( 10000
SectionSize ( 1.5 0 )
SectionCurve ( 1000.0 -5 )
)
)
TrackShapes ( 40000
TrackShape ( 10000
FileName ( A1t1000r5d.s )
NumPaths ( 1 )
SectionIdx ( 1 0 0 0 0 10000 )
)
)
Screenshot 2025-02-13 160707.png
What happens here is that the SectionIdx of the track piece that breaks gets set to ID + 1 in the TDB by TSRE.
Below is the TDB data for the two track pieces, I have marked the troublemaker in red. That number should really be 10000. 10001 is not defined anywhere, not even in the global tsection:
TrackNode ( 2
TrVectorNode (
TrVectorSections ( 2 10001 10000 -5655 15119 9 1 0 00 -5655 15119 748.9239 0.9782489 -343.3117 0 6.195919 0 10000 10000 -5655 15119 8 0 1 00 -5655 15119 745.1186 0.9782489 -256.156 0 0 0 )
)
TrPins ( 1 1
TrPin ( 1 1 )
TrPin ( 3 1 )
)
)
So the question here is: Am I doing something wrong? Or is this an issue with TSRE?
If I am doing something wrong I don't see what it is currently. It works fine for the original A1t1000r5d.s track piece, but not if I define it in the extension tsection with a new ID.
Log is attached.


Comment