1

I'm successfully launching Factorio through steam on windows via

steam -applaunch 427520

but unfortunately, I need the stdout for the project I'm working on and the steam process that this command starts exits leaving me with no stdout. I've also launched Factorio directly, but then all I get on the stdout is:

0.000 Initializing Steam API.
0.000 Steam requires game restart, restarting...

And then nothing...

When I launch the non-steam version I can successfully get all sorts of output from stdout. Is steam hijacking the stdout, and if so where can I find it?

Additional testing I've done includes sending extra parameters to Factorio

steam -applaunch 427520 --version

Seems to work in that the game doesn't start, and it doesn't return an error like it does with an unknown parameter, but I don't know where the output is being sent. Launching the game directly with the version parameter returns:

Version: 1.1.59 (build 59719, win64, steam)
Binary version: 64
Map input version: 0.18.0-0
Map output version: 1.1.59-0 

Similar tests should be possible with the demo which has appid 452280

2
  • "Is steam hijacking the stdout" - Probably. Have you tried launching the stream version directly with the executable in the installation directory? If the answer to that question is no, I probably know the reason you have not, wouldn't want to deal with those corner conditions either.
    – Ramhound
    Commented Jun 24, 2022 at 18:54
  • @Ramhound I have. That gave me the output from the second code block. It looks like it doesn't like getting started directly, and then restarts, but stops outputting to stdout.
    – Eph
    Commented Jun 25, 2022 at 16:41

1 Answer 1

0

Point the steam launcher to execute your program instead of the game.

to do this you can edit the launch parameters to be something like:

myLauncher %command%

Where myLauncher is the path to your launcher. Then when steam launches "the game" it actually executes your launcher and the path to the game executable will be passed as the first argument.

This allows you to launch the game yourself so you can capture the stdout, and critically steam is expecting the game to launch so when the game checks in with steam it knows it was launched appropriately.

If you still want the user to initiate the launching from your app you can just set your app to tell steam to launch the game if it didn't receive an argument, and then just exit. Steam will then re-launch your app and that second instance will work as expected.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .