TSRE Doesn't Understand include ( "[[SameName]]" )

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pschlik
    Senior Member



    • Jun 2011
    • 289
    • Missouri
    • MSOR

    #1

    TSRE Doesn't Understand include ( "[[SameName]]" )

    I have some content that I set up to use include ( "..\\[[SameName]]" ) as this was easier than manually entering dozens of include ( "..\\WagonNameHere.wag" ) however TSRE has no clue how to handle this, it just doesn't load anything from the target file of the same name (for those who don't know, if OR sees "[[SameName]]" as the filename in an include statement, it replaces that text with the name of the name of the file the include statement is contained within, which in this case is a wagon file inside the OpenRails subfolder).

    The log file ends up spammed with lines like...
    [I] Eng.cpp 152 Base Engine "g:/or content/miniroutes/ortsfreeware/trains/trainset/3dtrains_wp_freight/openrails/gx-bf_wp2952lda.wag"
    [I] FileBuffer.cpp 145 "g:/or content/miniroutes/ortsfreeware/trains/trainset/3dtrains_wp_freight/../[[samename]]" not exist
    [I] FileBuffer.cpp 145 "g:/or content/miniroutes/ortsfreeware/trains/trainset/3dtrains_wp_freight/" not exist
    Obviously, [[samename]] won't exist. What should be going on here is that [[samename]] gets replaced with "gx-bf_wp2952lda.wag" as the include statement is contained within the /trains/trainset/3dtrains_wp_freight/openrails/gx-bf_wp2952lda.wag file.
    Then the include statement should be interpreted as include ( "..\\gx-bf_wp2952lda.wag" ), giving a total file path of g:/or content/miniroutes/ortsfreeware/trains/trainset/3dtrains_wp_freight/openrails/../gx-bf_wp2952lda.wag which, because of the "..\" goes up one level and simplifies to: /or content/miniroutes/ortsfreeware/trains/trainset/3dtrains_wp_freight/gx-bf_wp2952lda.wag (ie: the original .wag file, not inside the OpenRails folder).

    Since TSRE is looking for the wrong file, there's loads of missing information and it's impossible to assemble a consist with these particular wagons.

    Contributing to ORTS since 2023
    Find me on GitHub @SteelFill

    Like what I do? Join my Patreon to help me do more!
  • eric
    9500 Post Veteran and Administrator



    • Dec 2002
    • 9583
    • NS MP245.4 CNO&TP South District
    • English, SQL
    • General

    #2
    First time I'm seeing that used. When was it introduced?



    Sent from my SM-S911U using Tapatalk

    If you like what you see here at Trainsim.com, be it the discussions and knowledge in the forums, or items available in our library, I hope you'll consider a paid membership to help support keeping the site operating.... Thanks!

    Comment

    • pschlik
      Senior Member



      • Jun 2011
      • 289
      • Missouri
      • MSOR

      #3
      It's been around 2 and a half years (just before 1.5.1 released, so it should be in 1.5.1?), it showed up after the idea was suggested on an Elvas Tower thread. I know not everyone uses it, as the specific case where it's useful is quite specific, so it's easy to miss.

      Contributing to ORTS since 2023
      Find me on GitHub @SteelFill

      Like what I do? Join my Patreon to help me do more!

      Comment

      • CSRX
        13500 Post Veteran



        • Oct 2005
        • 13646
        • Lincoln, ME
        • English
        • ORTS

        #4
        Originally posted by eric
        First time I'm seeing that used. When was it introduced?



        Sent from my SM-S911U using Tapatalk
        First I've seen this as well, probably why my head can't wrap around what is being said. Lol.
        I barely got it figured out with how Erick Cantu did his include files and how to set them up properly, for everything I have done. Haha.
        -Shawn K-
        MEC Mountain Subdivision - Trackwork 70%, Scenery 35%
        ​

        Comment

        • pwillard
          3000 Post Veteran



          • Nov 1999
          • 3070
          • Cumming Ga
          • ORTS

          #5
          Shawn,

          You are not alone. This geezer brain can hardly get it right, so emulating Erick (and others who do this) is difficult for me.

          Now imagine writing the code that makes it work to support it... ouchies.

          http://www.railsimstuff.com
          Just Blender now, 3DCrafter only when I have to.
          Formerly The Keystone Works (All Permissions Granted)
          Things I work on: https://github.com/pwillard

          Comment

          Working...