Is there any command to get Simutrans version and build number?
On windows you can get it in the file properties dialog. Moreover, you can see it in the window title text, IIRC; probably that last works for all OS.
Thanks. But
Is there any command or parameter or way to get it programatically?
According to the wiki (http://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_start_parameter&structure=en_Index&page_ref_id=1429), there isn't such command line option.
kieron@numenor:~$ simutrans --help
---------------------------------------
Simutrans 111.2 Nightly
released Feb 25 2012
developed
by the Simutrans team.
....
The -help switch doesn't work in windows :(
But it isn't a complain, because it's not very useful such an option when you're used to right-click stuff.
Thanks, kierongreen. :)
But, just as Zeno said, it doesn't work in Windows.
It should work in Linux.
Does it not work if you run simutrans from the command prompt in windows?
Apart from the obvious potential causes - user can't use command line - SDL traps stdout and stderr, which is a pain in ****, too.
I guess that VS is right about stdout, because it appears to work (no error, no window...) but nothing is written on my screen...
What happens if you run it from within cmd though? That way window remains open after simutrans exits. This probably show I haven't seriously used windows in many many years...
Yep, that's how I did it... just nothing happens, nothing printed on screen, just the command prompt below, waiting for a new command.
(http://i.imgur.com/Gaked.png)
Quote from: kierongreen on March 31, 2012, 05:29:39 PM
[...]
This probably show I haven't seriously used windows in many many years...
Then we're twin souls. At the beginning I thought I would miss it or need something. Eventually, I erased it from all my machines...
According to code help text is printed and program exits before backend starts. Therefore I don't think this is a case of SDL trapping output. What happens with GDI version? (I suspect exactly the same but may be wrong).
I think it might have something to do with the two modes of Windows executables: console programs and GUI programs. The former requires a console, and will normally create one for itself if started from anywhere but a console. The latter doesn't want to have anything to do with a console and totally ignores even the one it was started from. From my experience, Simutrans for Windows is built to run in GUI mode, I guess so that players don't get a pesky console windows in addition to the main window. I believe it is possible to write programs that will use a console if present, but won't create one if not, or that will create a console when told to just print text. I'm not exactly sure how, but that it requires platform specific code is quite certain.
Since in Windows version, it is possible to get debug messages, it should be possible to get version information since it is printed:
~$ simutrans -debug 2 -log
[...]
parse_simuconf() at config/simuconf.tab: Reading simuconf.tab successful!
Simutrans version nightly 111.0.1 from Jan 9 2012
ERROR: obj_reader_t::read_file(): reading 'skin/ground.Outside.pak' failed!
And the same information appears in file simu.log. In my case, in directory ~/.simutrans/...
That doesn't work for me. I get a new prompt immediately. No log output in the console.
If I build a console application, I get log output in the console. -help also works.
I tried to execute Simutrans from my Java application. The app can read Simutrans' output and print it to console. 'simutrans --help' should work here too.
(http://i.imgur.com/iHv38.jpg)
It should work with another programming language or platform too.
Thanks :)
You can compiel simutrans with console and without. Just uncomment
#WIN32_CONSOLE = 1 # adds a console for windows debugging
as written in config.template. But normal user complained about the console.
You can also use the network screen to see it ingame.
Actually getting rid of console was a great improvement, it looks much more professional like this.