tkashkin / GameHub

All your games in one place
https://tkashkin.github.io/projects/gamehub
GNU General Public License v3.0
2.24k stars 128 forks source link

Support for Steam games with multiple options to launch #256

Open neuromancer opened 5 years ago

neuromancer commented 5 years ago

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.

tkashkin commented 5 years ago

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

Lucki commented 5 years ago

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.

hlechner commented 5 years ago

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

neuromancer commented 5 years ago

Can we parse this config somehow?

tkashkin commented 5 years ago

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.

Lucki commented 5 years ago

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

hlechner commented 5 years ago

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

neuromancer commented 5 years ago

Unfortunately executing:

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

still runs the first commander keen game.

hlechner commented 5 years ago

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

neuromancer commented 5 years ago

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

tkashkin commented 5 years ago

@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 commented 5 years ago

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.

Hedronmx commented 4 years ago

Can you try running with similar syntax?

steam://launch/976730/option1

Miss-Inputs commented 2 years ago

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

gerelef commented 1 year ago

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