Elvas Tower: ORTS command line switches? - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

ORTS command line switches? Rate Topic: -----

#1 Inactive_PM1225_*

  • Group: Status: Passengers (Obsolete)

Posted 20 February 2013 - 05:12 AM

Here's what I'm trying to accomplish - set up a train sim for use in a museum for use by visitors. In the interest of simplicity, we'd like for it just to run one or two "canned" activities with the emphasis on easy use. We'd like to see the track monitor window, the display switch window and the display train operations window (that's F4, F8 and F9) open upon starting. We're aware that some sort of macro editor such as macroworks 3.1 or jitbit may work for us, but don't really know if there are any options in ORTS for how it starts up.

Any suggestions or words of wisdom?
Thanks
PM1225

#2 User is offline   cjakeman 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 3,031
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 20 February 2013 - 10:55 AM

Hi PM1225,

View PostPM1225, on 20 February 2013 - 05:12 AM, said:

Here's what I'm trying to accomplish - set up a train sim for use in a museum for use by visitors.

You don't say what you want your visitors to do and, perhaps, to not do.

The existing Replay facility will repeat a saved activity and the user can switch the camera views and steer the cameras. There is currently nothing to stop the user from also adjusting the cab controls so the train will no longer follow its recorded trajectory. It might then fail to stop in the next station.

You would probably want a batch file to kill off the Replay once it has had time to complete the activity and then restart from scratch.

I have a small extension to OR, tested but not yet committed, which adds a narrator's sound track to the Replay.

Hope that helps,

#3 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 15,661
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 20 February 2013 - 11:26 AM

We have had some team discussions about what kind of new features might be added to activity events but we've been too busy trying to complete the MSTS emulation to turn any attention to completely new things like that. I mention this as one discussion was about what circumstances were there that would be suitable to trigger playing a sound file of a voice message... we "talked" about routine radio chatter that occurred at random times, the dispatcher informing the player he is going to be stuck in the hole until some hotshot train passes, stuff like that. WHEN we get to the point of adding such things your museum "demo" could be enhanced with the playing of explanation messages, anything from "Now Press the D key" to "Railroad signaling blah blah blah...". But we're just not there yet.

#4 User is offline   Eldorado.Railroad 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,021
  • Joined: 31-May 10
  • Gender:Male
  • Country:

Posted 20 February 2013 - 12:05 PM

View PostPM1225, on 20 February 2013 - 05:12 AM, said:

We'd like to see the track monitor window, the display switch window and the display train operations window (that's F4, F8 and F9) open upon starting. We're aware that some sort of macro editor such as macroworks 3.1 or jitbit may work for us, but don't really know if there are any options in ORTS for how it starts up.


If you have any success with sending keys via software to the render window (yeah, the one where the trains are!) please let us know. I have tried a scripting program with Open Rails to automate certain things like keypresses and that has not been very successful at all. The only thing that might work is a programmable keyboard (hardware) that can send sequences to the computer and thus any program. I have not found a programmable keyboard that will resend a timed sequence of keys without user intervention (this means the user needs to be pressing the trigger key).

I would clearly support/prefer some kind of scripting language for Open Rails if it were native to the program.

Thanks,

Eldorado

#5 User is offline   cjakeman 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 3,031
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 20 February 2013 - 12:55 PM

View PostGenma Saotome, on 20 February 2013 - 11:26 AM, said:

We have had some team discussions about what kind of new features might be added to activity events but we've been too busy trying to complete the MSTS emulation to turn any attention to completely new things like that.

I remember that thread and made some notes to help in developing activities.

However we were talking then about sound files triggered by events in the simulator.

As I said above, I have a small extension to OR, tested but not yet committed, which adds a sound track to OR. The sound track isn't synchronised to the sim. It's just a wma file (one for each replay) played through the default player (usually Windows Media Player) that starts playing when the Replay starts.

Sounds (!) just right for a museum installation :-)

#6 User is offline   eric from trainsim 

  • Waste Disposal Engineer
  • Group: Private - Open Rails Developer
  • Posts: 1,795
  • Joined: 30-October 10
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 20 February 2013 - 12:56 PM

I've managed to use Delphi5 to grab the active window handle of the RE, and send keystrokes using the SendKeys function.

I can grab the active window handle on OR, but sending keystrokes doesn't work. Odd...

#7 Inactive_PM1225_*

  • Group: Status: Passengers (Obsolete)

Posted 20 February 2013 - 03:56 PM

View PostEldorado.Railroad, on 20 February 2013 - 12:05 PM, said:

If you have any success with sending keys via software to the render window (yeah, the one where the trains are!) please let us know. I have tried a scripting program with Open Rails to automate certain things like keypresses and that has not been very successful at all. The only thing that might work is a programmable keyboard (hardware) that can send sequences to the computer and thus any program. I have not found a programmable keyboard that will resend a timed sequence of keys without user intervention (this means the user needs to be pressing the trigger key).

I would clearly support/prefer some kind of scripting language for Open Rails if it were native to the program.

Thanks,

Eldorado


I wonder if there is anything here that is useful. These are the raildriver people.

http://www.piengineering.com/xkeys.php

Also have a look at this video: http://www.jitbit.co...video-tutorial/

Fred

#8 Inactive_PM1225_*

  • Group: Status: Passengers (Obsolete)

Posted 20 February 2013 - 04:11 PM

View Postcjakeman, on 20 February 2013 - 10:55 AM, said:

Hi PM1225,


You don't say what you want your visitors to do and, perhaps, to not do.

The existing Replay facility will repeat a saved activity and the user can switch the camera views and steer the cameras. There is currently nothing to stop the user from also adjusting the cab controls so the train will no longer follow its recorded trajectory. It might then fail to stop in the next station.

You would probably want a batch file to kill off the Replay once it has had time to complete the activity and then restart from scratch.

I have a small extension to OR, tested but not yet committed, which adds a narrator's sound track to the Replay.

Hope that helps,


let me ponder some of the information you kind folks have posted here. What we are trying to come up with is a simplified activity that your average joe-blow museum visitor can sit down with and not be intimidated by when he/she sits down to play. I've got a REALLY simple activity I'm working on, GE 25 tonner, one boxcar and a caboose on about 2 miles of track with one stub siding. Thinking about written directions on how to run down to the switch, throw it behind the caboose, back into the siding and cut the cars off. Congratulations - you're done -good job, etc. Next person, please. Maybe add a second activity that is more difficult once you've built up their confidence.

I don't know how I got stuck with this job. . . . . . .

Fred

#9 User is offline   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,514
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 21 February 2013 - 10:42 AM

Okay, firstly let me thank you for using Open Rails!

There are a couple of candidates for setting up the environment you want:

1. Macros I'm afraid I cannot name any macro software known to work with Open Rails, as I have never used any myself. That said, any macro software that sends distinct key-down and key-up commands though the standard key-simulating Windows API call keybd_event will work if there is a pause between down and up events of more than one frame. I admit this isn't obviously useful information but I know this works because I've done it with my own code and I expect other variants of simulating input will not work because Open Rails samples the keyboard state (like most games, I believe), rather than listening for change messages.

2. Saved games Although there exist no options to control the initial visibility of the aid windows yet, their position and visibility is saved in saved games. Thus, you can start the activity you've created, set up the UI exactly how you'd like, and hit Save (F2). Then, resume the same saved game each time.

In either case, you'll need to launch Open Rails with some command-line options that you might not be familiar with, so I'll describe the relevant ones here:

RunActivity "C:\Path\To\The\Activity.act" This starts the game with the given activity.

RunActivity -resume "C:\Path\To\The\SavedGame.save" This starts the game with the saved game.

You can view these paths by starting an activity or resuming a saved game and looking at the start of the log/text window.

And finally, we're quite willing to add options that will make things easier for you - like setting the initial window visibility - if you have problems with other suggestions.

#10 Inactive_PM1225_*

  • Group: Status: Passengers (Obsolete)

Posted 21 February 2013 - 11:14 AM

View PostJames Ross, on 21 February 2013 - 10:42 AM, said:

Okay, firstly let me thank you for using Open Rails!

There are a couple of candidates for setting up the environment you want:

1. Macros I'm afraid I cannot name any macro software known to work with Open Rails, as I have never used any myself. That said, any macro software that sends distinct key-down and key-up commands though the standard key-simulating Windows API call keybd_event will work if there is a pause between down and up events of more than one frame. I admit this isn't obviously useful information but I know this works because I've done it with my own code and I expect other variants of simulating input will not work because Open Rails samples the keyboard state (like most games, I believe), rather than listening for change messages.

2. Saved games Although there exist no options to control the initial visibility of the aid windows yet, their position and visibility is saved in saved games. Thus, you can start the activity you've created, set up the UI exactly how you'd like, and hit Save (F2). Then, resume the same saved game each time.

In either case, you'll need to launch Open Rails with some command-line options that you might not be familiar with, so I'll describe the relevant ones here:

RunActivity "C:\Path\To\The\Activity.act" This starts the game with the given activity.

RunActivity -resume "C:\Path\To\The\SavedGame.save" This starts the game with the saved game.

You can view these paths by starting an activity or resuming a saved game and looking at the start of the log/text window.

And finally, we're quite willing to add options that will make things easier for you - like setting the initial window visibility - if you have problems with other suggestions.


Solid gold. Thank you, James

#11 User is offline   eric from trainsim 

  • Waste Disposal Engineer
  • Group: Private - Open Rails Developer
  • Posts: 1,795
  • Joined: 30-October 10
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 21 February 2013 - 07:09 PM

Is there a trick to getting save files to work?...



Error: System.IO.InvalidDataException: Open Rails save file is not compatible with VX.1427 (0.0.4791.35700 Fri 08/02/2013  12:33).Save files must be created by the same version of Open Rails.
   at ORTS.Program.ValidateSave(BinaryReader inf)
   at ORTS.Program.Resume(UserSettings settings, String[] args)
   at ORTS.Program.<>c__DisplayClass6.<Main>b__3()
   at ORTS.Program.Main(String[] args)


#12 User is offline   cjakeman 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 3,031
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 21 February 2013 - 11:59 PM

View Posteolesen, on 21 February 2013 - 07:09 PM, said:

Is there a trick to getting save files to work? . . .

Yes - Don't update to a newer release.

That sounds harsh, but anything smarter is a major piece of work. I'm afraid.

The F2 Save saves the state of every object in the sim in sequence without any formatting or structure. Resume reads it back in again. If the next release adds a new property, or changes/corrects a property then the new Resume will misread the state saved by the older release. If we allowed this, OR might crash or do unexpected things, so we check and disable it.

You can override this check when debugging, as Resuming is a valuable tool for testing.

Hope that makes sense,

#13 User is offline   eric from trainsim 

  • Waste Disposal Engineer
  • Group: Private - Open Rails Developer
  • Posts: 1,795
  • Joined: 30-October 10
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 22 February 2013 - 09:35 AM

View Postcjakeman, on 21 February 2013 - 11:59 PM, said:

Yes - Don't update to a newer release.

That sounds harsh, but anything smarter is a major piece of work. I'm afraid.

The F2 Save saves the state of every object in the sim in sequence without any formatting or structure. Resume reads it back in again. If the next release adds a new property, or changes/corrects a property then the new Resume will misread the state saved by the older release. If we allowed this, OR might crash or do unexpected things, so we check and disable it.

You can override this check when debugging, as Resuming is a valuable tool for testing.

Hope that makes sense,


Yes, I get that, but the save was done on the X release, and I'm trying to open with the X release. During the same run session that I saved in, I can see a save listed, but it's always invalid.

Is there a switch to force debug mode?... I didn't see one in the menu.

#14 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 15,661
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 22 February 2013 - 09:52 AM

View Postcjakeman, on 21 February 2013 - 11:59 PM, said:

View Posteolesen, on 21 February 2013 - 07:09 PM, said:

Is there a trick to getting save files to work? . . .

Yes - Don't update to a newer release.

That sounds harsh, but anything smarter is a major piece of work. I'm afraid.


What I do is set up folders named after the version number and each has only that version in them. Then a different folder used as the target of a desktop shortcut (think of it as a Run Time folder). Whichever version I want to use is simply copied from its version folder into the run time folder (after clearing it out) and run by clicking on the one shortcut. The sum of all of this is I can run any version I want, so long as I have it on hand, a trick that's rather useful when testing and I don't have my desktop cluttered with a whole lot of shortcuts that see little use.

#15 User is offline   Eldorado.Railroad 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,021
  • Joined: 31-May 10
  • Gender:Male
  • Country:

Posted 22 February 2013 - 10:31 AM

View PostJames Ross, on 21 February 2013 - 10:42 AM, said:

1. Macros I'm afraid I cannot name any macro software known to work with Open Rails, as I have never used any myself. That said, any macro software that sends distinct key-down and key-up commands though the standard key-simulating Windows API call keybd_event will work if there is a pause between down and up events of more than one frame. I admit this isn't obviously useful information but I know this works because I've done it with my own code and I expect other variants of simulating input will not work because Open Rails samples the keyboard state (like most games, I believe), rather than listening for change messages.


I found this AutoHotKey, and if you scroll down to the "Repeating or Holding Down a Key" section you will find a reference to the "To hold down or release a key" which is the method required for Open Rails. I do not have this application installed, but it is Open Source GNU General Public License. If it is painless to install and uninstall I will try it out with Open Rails to see if it works.

Thanks for letting us know what the "secret" is! I wondered why sending keystrokes was a hit and miss affair, which most of the time would not work. I should have asked and I would have seen what the impediment was.

Thanks,

Eldorado

  • 2 Pages +
  • 1
  • 2
  • 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