Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: OpenRails / MSTS TSECTION.DAT file format

  1. #1
    Join Date
    Feb 2022
    Location
    London, UK
    Posts
    8

    Default OpenRails / MSTS TSECTION.DAT file format

    Hi,

    I'm trying to get my head around the (global) TSECTION.DAT file. I'm new to this and am trying to create a tram route so it needs some pretty severe curves, where it would go round corners on streets. I'm just experimenting at the moment. The version of TSECTION.DAT that I am using is based on Build 00038.

    From what I can see, the track shapes, say for example the 250r curve references two other track sections, when I look at those two other track sections, they seem to reference two more track sections and it goes on. I have seen examples where they seem to reference themselves, although I have to be honest, sometimes I get a bit lost.

    I tried to create a new 100r curve at 10 degrees, and I get strange results. I'm using TSRE5 for the track builder, blender to build the objects, and Open Rails as the simulator.

    When I add the track section, and then press Z to add it to the TDB, I dont get the yellow line. It will go in but when I run OR, the train stops when it gets to the section. Also, it will crash TSRE5 if I try to delete the object or press Z to take it back out of the TDB. However, if I place it and then press X a few times to get the curve to point the other way, it works fine.

    I've looked in this forum, google and a couple of other forums to see if I can find the answer, but nothing which seems to 100% show me where I'm going wrong.

    If anyone can point me in the right direction or how the logic of the two parts in the TSECTION.DAT file are put together, I would be most grateful.

    Below are snippets from my TSECTION.DAT file



    Code:
    _Info(100m 10d)
    TrackSection ( 50003
     SectionSize ( 1.435 0 )
     SectionCurve ( 100 -10 )
    )
    		_Info (100m 10 outer curve part)
    		TrackSection ( 50103
    		SectionSize ( 1.435 0 )
    		SectionCurve ( 102.4925 -10 )
    		)
    
    		_Info (100m 10 inner curve part)
    		TrackSection ( 50203
    		SectionSize ( 1.435 0 )
    		SectionCurve ( 97.5075 -10 )
    		)
    The trackshape PArt

    Code:
    TrackShape ( 50003
     FileName ( t2c100r10d.s )
     NumPaths ( 2 )
     SectionIdx ( 1 -2.4925 0 0 0 50203 )
     SectionIdx ( 1 2.4925 0 0 0 50103 )
    )
    			TrackShape ( 50103
    			FileName ( dummy.s )
    			NumPaths ( 1 )
    			SectionIdx ( 1 2.4925 0 0 0 50103 )
    			)
    
    			TrackShape ( 50203
    			FileName ( dummy.s )
    			NumPaths ( 1 )
    			SectionIdx ( 1 -2.4925 0 0 0 50203 )
    			)

    And pictures of what I see in TSRE5

    The left hand curve (doesnt work)

    LeftHand.jpg

    The right hand curve after pressing X (Does work)

    RightHandPressedX.jpg

    Also attached is my TSECTION.DAT

    Thanks,
    Wolfgang

  2. #2
    Join Date
    Dec 2002
    Languages
    English, SQL
    Posts
    5,903

    Default

    Did you update the counts in the headers for Trackshapes and Tracksections? I don't believe pieces in the Global can be numbered higher than 39999.

    The number ranges are pretty much fixed for the global and route Tsections.

  3. #3

    Default

    Look in your list of track sections listed in the TSection.dat as 'Tram'
    They have tight radius curves.

    regards,
    ............Vince ..............
    ...... Author NECv4 .......
    .... LIRR BUILD PHOTOS ....
    ...... Eschew Obsfucation ......

    On the The Statue of Liberty in New York Harbor there is a Tablet. On it is written:
    "Give me your tired, your poor, your huddled masses yearning to breathe free,
    the wretched refuse of your teeming shore, send these, the homeless, tempest-tossed to me,
    I lift my lamp beside the golden door!"

  4. #4
    Join Date
    Feb 2022
    Location
    London, UK
    Posts
    8

    Default

    Found them. They're fitting. Cheers Vince.

  5. #5
    Join Date
    Feb 2022
    Location
    London, UK
    Posts
    8

    Default

    I did set them to 60000. I'll put them back to 40000. I see there is a block which is unallocated. I'll get the latest one from github and pick some numbers from that. Thanks.

  6. #6
    Join Date
    May 2010
    Location
    Worksop, UK
    Posts
    2,668

    Default

    Hi,
    I was under the impression that the 40000 range is reserved for dynamic tracks.

    If so, it's best not to mess with them, unless the route is NEVER to be uploaded for public use!

    Cheers,
    Ged

  7. #7
    Join Date
    Feb 2022
    Location
    London, UK
    Posts
    8

    Default

    Yes. I changed it back . There is a block of unused ones acccording to the comments (340 - 22679) so I've borrowed some around the 1000 mark. If this is decent enough to go near the public I'll apply for a reservation, but that would be a long way into the future.

    I might have been interpreting the file wrong too!......
    Last edited by wolfie2; 03-19-2022 at 10:50 AM. Reason: The penny may have dropped!

  8. #8
    Join Date
    Dec 2002
    Languages
    English, SQL
    Posts
    5,903

    Default

    You only need a reservation if you're planning to release the route publicly and you've created new geometry. For something that you only plan to have for yourself and a few friends, it's fine to just make modifications on the fly within the gaps and give instructions or the modified TSection file to anyone you plan to share with.

    If there are existing sections that already have the desired geometry, it's far easier to do a shape substitution than to add to the TSection.

    Lay the pieces using the already defined sections, and then replace the ShapeFile entry with a relative path to your route's Shapes folder and the associated filename. I've done that with sections where I needed a crossing piece that existed in XTracks, but didn't have a Scalerail equivalent.

  9. #9
    Join Date
    Feb 2022
    Location
    London, UK
    Posts
    8

    Default

    So I thought I had this conquered, but it seems I dont. I am trying to create a double piece of track with a central radius of 150m at 5 degrees.

    I created two track sections and a track Shape:-
    Code:
    TrackSection ( 1010
     SectionSize ( 1.5 0 )
     SectionCurve ( 147.5075 -5 )
    )
    
    TrackSection ( 1011
     SectionSize ( 1.5 0 )
     SectionCurve ( 152.4925 -5 )
    )
    And a track shape :-

    Code:
    TrackShape (1166
        FileName (t2c150r5d.s)
          Numpaths (2)
          SectionIdx ( 1 -2.4925 0 0 0 1010 )
          SectionIdx ( 1 2.4925 0 0 0 1011 )
    )
    when laid in TSRE5, it is OK providing I dont swap the direction, so on my test environment :-

    (1st Part : OK)
    1st Track Piece.jpg
    (2nd Part: OK)
    2nd Track Piece.jpg
    (3rd Part: After pressing 'X' to get it the in the right orientation)
    3rd Track Piece.jpg
    It alters the orientation of the first two parts, this is also reflected in OR if I run it.


    I did some experiments with my 250m 5d section which uses the existing track sections (194 and 196) and amending my two track sections 1010 and 1011 to be identical, I got the same 'jumping result' as with the 150m track shapes.

    Before, which works perfectly:
    Code:
    TrackShape ( 1156
     FileName ( t2c250r5d.s )
     NumPaths ( 2 )
     SectionIdx ( 1 -2.4925 0 0 0 194 )
     SectionIdx ( 1 2.4925 0 0 0 196 )
    )
    After (Which Jumps)

    Code:
    TrackSection ( 1010
     SectionSize ( 1.5 0 )
     SectionCurve ( 247.5075 -5 )
    )
    TrackSection ( 1011
     SectionSize ( 1.5 0 )
     SectionCurve ( 252.4925 -5 )
    )
    
    TrackShape ( 1156
     FileName ( t2c250r5d.s )
     NumPaths ( 2 )
     SectionIdx ( 1 -2.4925 0 0 0 1010)
     SectionIdx ( 1 2.4925 0 0 0 1011)
    )
    Can anyone see where I am going wrong?
    Last edited by wolfie2; 05-22-2022 at 06:37 AM. Reason: removed some accidental code copied for my example

  10. #10
    Join Date
    Feb 2022
    Location
    London, UK
    Posts
    8

    Default

    The end result in OR is interesting . . . .


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •