ORTS command line switches?
#1 Inactive_PM1225_*
Posted 20 February 2013 - 05:12 AM
Any suggestions or words of wisdom?
Thanks
PM1225
#2
Posted 20 February 2013 - 10:55 AM
PM1225, on 20 February 2013 - 05:12 AM, said:
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
Posted 20 February 2013 - 11:26 AM
#4
Posted 20 February 2013 - 12:05 PM
PM1225, on 20 February 2013 - 05:12 AM, 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
#5
Posted 20 February 2013 - 12:55 PM
Genma Saotome, on 20 February 2013 - 11:26 AM, said:
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
Posted 20 February 2013 - 12:56 PM
I can grab the active window handle on OR, but sending keystrokes doesn't work. Odd...
#7 Inactive_PM1225_*
Posted 20 February 2013 - 03:56 PM
Eldorado.Railroad, on 20 February 2013 - 12:05 PM, said:
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_*
Posted 20 February 2013 - 04:11 PM
cjakeman, on 20 February 2013 - 10:55 AM, said:
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
Posted 21 February 2013 - 10:42 AM
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_*
Posted 21 February 2013 - 11:14 AM
James Ross, on 21 February 2013 - 10:42 AM, said:
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
Posted 21 February 2013 - 07:09 PM
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
Posted 21 February 2013 - 11:59 PM
eolesen, on 21 February 2013 - 07:09 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,
#13
Posted 22 February 2013 - 09:35 AM
cjakeman, on 21 February 2013 - 11:59 PM, said:
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
Posted 22 February 2013 - 09:52 AM
cjakeman, on 21 February 2013 - 11:59 PM, said:
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
Posted 22 February 2013 - 10:31 AM
James Ross, on 21 February 2013 - 10:42 AM, said:
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