Elvas Tower: OR consist format - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 24 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

OR consist format Let's talk details Rate Topic: -----

#31 User is offline   YoRyan 

  • Conductor
  • Group: Status: Active Member
  • Posts: 391
  • Joined: 19-February 20
  • Gender:Male
  • Location:California, United States
  • Simulator:Open Rails/unstable
  • Country:

Posted 12 July 2020 - 07:35 AM

Wikipedia has a nice section on JSON syntax. It isn't very complicated - just collections of keys and values that map to JavaScript data types.

#32 User is offline   YoRyan 

  • Conductor
  • Group: Status: Active Member
  • Posts: 391
  • Joined: 19-February 20
  • Gender:Male
  • Location:California, United States
  • Simulator:Open Rails/unstable
  • Country:

Posted 12 July 2020 - 11:17 AM

Genericized the consist spawning code and made good progress on the JSON loader. Say hello to our very first JSON consist!

Attached thumbnail(s)

  • Attached Image: json_firstconsist.jpg


#33 User is offline   lineman 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 516
  • Joined: 19-April 08
  • Gender:Male
  • Location:Arizona
  • Simulator:Open Rails Train Simulator
  • Country:

Posted 12 July 2020 - 11:36 AM

View PostYoRyan, on 12 July 2020 - 11:17 AM, said:

Genericized the consist spawning code and made good progress on the JSON loader. Say hello to our very first JSON consist!



I like that!! Good luck in continuing to advance this, what a great idea and implementation!

#34 User is offline   YoRyan 

  • Conductor
  • Group: Status: Active Member
  • Posts: 391
  • Joined: 19-February 20
  • Gender:Male
  • Location:California, United States
  • Simulator:Open Rails/unstable
  • Country:

Posted 13 July 2020 - 01:43 PM

Implemented the ability to load rolling stock from other installation directories. Consists can now reference other consists.

{
    "Name": "Fake Acela",
    "Durability": 1.0,
    "List": [
        {
            "Engine": "3DTS_SJVRR_GP9_1754/3DTS_SJVRR_GP9_1754",
            "Profile": "Tehachapi Pass"
        },
        {
            "Engine": "3DTS_SJVRR_GP9_1754/3DTS_SJVRR_GP9_1754",
            "Flip": true,
            "Profile": "Tehachapi Pass"
        },
        {
            "Wagon": "3DTS_GATXTANKER/3dts_gatxtanker",
            "Profile": "Tehachapi Pass",
            "Count": 3
        },
        {
            "Consist": "kiha31a"
        }
    ]
}

Attached thumbnail(s)

  • Attached Image: json_consistref.jpg


#35 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,404
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 13 July 2020 - 02:40 PM

I'm trying to understand this thread...I'm liking what I see, but not completely comprehending it ( much like my first encounter some years ago wiith concept of include files. ). Eventually will there be a set of standard templates ( like your examples in this thread ) that will present a visual template for the end user?
Thanks for all your time and effort --- http://www.elvastower.com/forums/public/style_emoticons/default/sign_rockon.gif http://www.elvastower.com/forums/public/style_emoticons/default/hi.gif--- Regards, Gerry

#36 User is offline   YoRyan 

  • Conductor
  • Group: Status: Active Member
  • Posts: 391
  • Joined: 19-February 20
  • Gender:Male
  • Location:California, United States
  • Simulator:Open Rails/unstable
  • Country:

Posted 13 July 2020 - 03:13 PM

There will certainly be a written manual section. If the stars align, I might also be able to crank out some kind of consist editor. Have to learn WinForms, though...

#37 User is offline   roeter 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,419
  • Joined: 25-October 11
  • Gender:Male
  • Country:

Posted 13 July 2020 - 03:14 PM

I see that the consist still has a 'name' field, additional to the filename.
When referencing the consist, e.g. in timetable or indeed in another consist, does one have to use the filename or the 'name'?

Having to use the name can be confusing as the name is not shown on the 'outside'.
If one has to use the filename, than what purpose does the name field serve?

MSTS data was littered with these double (or even triple) names. My view is that any new datastructure should eliminate these doubles and triples.
Unless a consist file can hold more than one consist definition, I do not see any usefull purpose for a name field, as one can just as well use the filename as reference.

Regards,
Rob Roeterdink

#38 User is offline   YoRyan 

  • Conductor
  • Group: Status: Active Member
  • Posts: 391
  • Joined: 19-February 20
  • Gender:Male
  • Location:California, United States
  • Simulator:Open Rails/unstable
  • Country:

Posted 13 July 2020 - 04:12 PM

That is a good point. Note that the .con format actually has three names:

  • The filename before .con
  • The "TrainCfg" name
  • The "Name" name

The first two are usually interchangeable, but this is not necessarily true, which can lead to ambiguities. (For the record, OR always uses the filename.)

The new format drops the TrainCfg field, leaving the filename and the Name field. I think there is still value in retaining both, because the Name field is used by the launcher to present a friendly name in the consist menu, and sometimes you want to use different semantics for these names. For example, I prepend all of my personal consists' filenames with "YoRyan_"; I wouldn't want that to show up in the launcher list.

#39 User is offline   YoRyan 

  • Conductor
  • Group: Status: Active Member
  • Posts: 391
  • Joined: 19-February 20
  • Gender:Male
  • Location:California, United States
  • Simulator:Open Rails/unstable
  • Country:

Posted 14 July 2020 - 08:13 AM

Consist randomization is working!

{
    "DisplayName": "1x Marias Pass Yellow Beam Car",
    "Durability": 1.0,
    "Random": [
        {
            "Wagon": "US2FCARYE2/us2fcarye2",
            "Probability": 0.3
        },
        {
            "Wagon": "US2FCARYF2/us2fcaryf2",
            "Probability": 0.7
        }
    ]
}

{
    "DisplayName": "Fake Acela",
    "Durability": 1.0,
    "List": [
        {
            "Engine": "3DTS_SJVRR_GP9_1754/3DTS_SJVRR_GP9_1754",
            "Profile": "Tehachapi Pass"
        },
        {
            "Engine": "3DTS_SJVRR_GP9_1754/3DTS_SJVRR_GP9_1754",
            "Flip": true,
            "Profile": "Tehachapi Pass"
        },
        {
            "Consist": "beamcar",
            "Count": 16
        }
    ]
}

...but I do not yet have the locomotive picker implemented, which will require more code and some launcher changes.

Attached thumbnail(s)

  • Attached Image: json_randomcon.jpg


#40 User is offline   longiron 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 3,179
  • Joined: 25-July 08
  • Gender:Male
  • Location:Manasquan, NJ
  • Simulator:Open Rails, MSTS editors
  • Country:

Posted 14 July 2020 - 02:27 PM

congratulations. Always great to experience progress when you are working a project.

  • 24 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users