News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Build Number

Started by Vonjo, March 31, 2012, 12:26:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vonjo

Is there any command to get Simutrans version and build number?

Zeno

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.

Vonjo

Thanks. But
Is there any command or parameter or way to get it programatically?

Zeno

According to the wiki, there isn't such command line option.

kierongreen

kieron@numenor:~$ simutrans --help

---------------------------------------
  Simutrans 111.2 Nightly
  released Feb 25 2012
  developed
  by the Simutrans team.

....

Zeno

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.

Vonjo

Thanks, kierongreen. :)
But, just as Zeno said, it doesn't work in Windows.
It should work in Linux.

kierongreen

Does it not work if you run simutrans from the command prompt in windows?

VS

Apart from the obvious potential causes - user can't use command line - SDL traps stdout and stderr, which is a pain in ****, too.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Zeno

I guess that VS is right about stdout, because it appears to work (no error, no window...) but nothing is written on my screen...


kierongreen

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...

Zeno

Yep, that's how I did it... just nothing happens, nothing printed on screen, just the command prompt below, waiting for a new command.


isidoro

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...

kierongreen

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).

Ters

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.

isidoro

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/...


Ters

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.

Vonjo

#18
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.

It should work with another programming language or platform too.

Thanks :)

prissi

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.

Fabio

Actually getting rid of console was a great improvement, it looks much more professional like this.