GameHub icon indicating copy to clipboard operation
GameHub copied to clipboard

Support for Steam games with multiple options to launch

Open neuromancer opened this issue 5 years ago • 15 comments

Some Steam game pack (e.g. Commander Keen ) require you to select which game exactly you want to run. GameHub only runs the first one and I can't see how to select the other ones.

neuromancer avatar Jun 20 '19 00:06 neuromancer

GameHub uses steam:// protocol and I don't think it's possible to get launch options or show Steam's selection dialog.

tkashkin avatar Jun 20 '19 00:06 tkashkin

If it's the same executable with different appended arguments it should be possible. Example for different arguments on windows executables But this doesn't seems to be the case for your provided game.

steam://run/<id>//<args>/ Runs an application. It will be installed if necessary. The //<args> is optional, args are passed to the application as launch parameters.

Lucki avatar Jun 20 '19 10:06 Lucki

@Lucki it's possible to launch using the args, for example: steam://rungameid/225160//-addon1 steam://rungameid/225160//-addon2 steam://rungameid/225160//-addon3 etc

But the problem is: how to get the information of the addons/pack/etc? I was looking into the link provided by @tkashkin and seems that there is no way to get this information, which is crucial for this feature.

hlechner avatar Jun 20 '19 15:06 hlechner

Can we parse this config somehow?

neuromancer avatar Jun 20 '19 23:06 neuromancer

It seems to be possible to get this info with Steam console or SteamCMD.

steamcmd.sh +login anonymous +app_info_print <appid> +quit

I haven't found a way to run a console command in a regular Steam client so SteamCMD is probably required to be installed separately.

However I don't know how to run game with a different executable.

tkashkin avatar Jun 21 '19 02:06 tkashkin

I haven't found a way to run a console command in a regular Steam client

You can access the console by using this link: steam://open/console

Lucki avatar Jun 21 '19 09:06 Lucki

@tkashkin I believe you don't need to launch the executable manually, from what I googled to launch the addon you just need to use the args on the steam protocol: "-addon1" for the first one, "-addon2" for the second, etc.

@neuromancer can you confirm this? try to launch it in your browser: steam://rungameid/9180//-addon1 steam://rungameid/9180//-addon2 steam://rungameid/9180//-addon3 steam://rungameid/9180//-addon4

And let us know if each one launch a different addon.

hlechner avatar Jun 21 '19 13:06 hlechner

Unfortunately executing:

$ steam "steam://rungameid/9180//-addon3"

still runs the first commander keen game.

neuromancer avatar Jun 21 '19 15:06 neuromancer

@neuromancer Could you try again with run instead of rungameid? steam "steam://run/9180//-addon3"

hlechner avatar Jun 21 '19 15:06 hlechner

Still same result. It tries to run the first game, but using the "-addon3" parameter (which is going to do nothing with dosbox)

neuromancer avatar Jun 21 '19 15:06 neuromancer

@Lucki

You can access the console by using this link: steam://open/console

I know about that. What I meant is that it's possible to run app_info_print in steam://open/console, but it seems to be impossible to run it from with actual CLI parameters. It's required to install SteamCMD even though app_info_print is available in a regular client.

tkashkin avatar Jun 21 '19 21:06 tkashkin

f88b0a4 improves binary vdf parser so it can now read appinfo.vdf and packageinfo.vdf.

It's possible to get launch options from appinfo.vdf. It will allow to run games with args via steam://rungameid/<app>//<args>. However I don't know what to do with options that use different binaries. I don't know if it's possible to run them through Steam.

tkashkin avatar Jun 25 '19 13:06 tkashkin

Can you try running with similar syntax?

steam://launch/976730/option1

Hedronmx avatar Jun 13 '20 09:06 Hedronmx

I've been poking around with Steam command line options for my own purposes and found steam://launch/<appid>/<anything except a slash or empty string goes here>/<launch option in appinfo> works! So that may be of use here for this project. steam://launch/9180/blah/3 launches Commander Keen: Secret of the Oracle for example.

Edit: As it turns out, this actually isn't the keys in the launch array, it's a 0-based index into that array. That would be the same thing 99% of the time but then there are annoying cases like Doom II where it isn't, so to launch TNT: Evilution you actually use steam://launch/2300/something/2

Miss-Inputs avatar Aug 23 '22 22:08 Miss-Inputs

I was toying around for personal use and I found (for CSGO specifically, untested with other games) you can launch Steam games with commands as such: steam -applaunch 730 -w 1280 For example, this will launch CSGO with the "-w 1280" launch option specifically. I am unsure if this will work with non-Steam games through steam, however the topic is specifically about games with a steam id...

gerelef avatar Dec 16 '22 01:12 gerelef