Steam Controller

Steam Controller

cammelspit Aug 15, 2016 @ 3:22pm
[Need Help] Launching non-steam game Via steam WITH custom command line switches
Warning VERY complicated
Hi all, I am having a rather complicated and convoluted problem here. I am posting this here is the Steam controller discussions because my end goal is to use my steam controller in a very particular way and I need a hand because I seem to have gotten stuck. I will try and explain...
What EXACTLY do I want to do?
Ok, I want a third party app, in this case, launchbox, to launch an emulator, such as Dolphin, THROUGH steam but with passing through custom command line switches to Dolphin.
Why?
See, I normally Dolphin through steam and that works perfectly but there are drawbacks. All of my ISOs are compressed 7Z archives so I have to unpack the roms I want to play so that can be a bit annoying. I have decided to try out using launch box and it has a feature to unpack the iso at runtime into a temporary spot, run the game, and delete the temp file when you close the emulator, neat! I have an HDD space constraint so I can't unpack ALL my ISOs at the same time, even with the Dolphin built in compression because it is simply not good enough and it changes the ISO itself so I can never have the unmodified ISO again.
Why not just launch Launchbox from steam then?
YES! It works and it works quite well. There are a few ♥♥♥♥♥♥♥ that make me completely unwilling to make this the normal way I use Dolphin, I will explain.
  1. When I launch Dolphin this way it shows I am playing Launchbox and NOT Dolphin.
  2. My EXTREMELY complicated config for Dolphin is not automatically loaded since it is in fact, loading the launchbox config. Many, if not most, of my other games, are using Retroarch and still other emulators on a per system basis.
  3. These emulators do not have the exact same control setup so they would not be compatible with either the Dolphin or the Retroarch configurations.
What have you tried already?
Ok, when you make a steam shortcut to any game, steam or non-steam, you get something that looks like this. "steam://rungameid/21090" This particular shortcut would launch F.E.A.R. and it does work for non-steam games too. I have been doing some research and if you wanted to have steam pass along command line switches to the game being launched you could add it right to the end like this "steam://rungameid/21090//-Switch1 -Switch2" and it does work but ONLY for steam games! This method will not work AT ALL for non-steam games. Depending on how you set the shortcut up, you will either get the game without the switches or it simply won't work at all. If I use a shortcut to steam.exe and then add the "-applaunch GAMEID" it will also work, but ONLY for steam games and NOT non-steam games at all!
Why not just use the command line in steam itself?
This does work, yes but it can only have ONE string of switches. I would have to make a completely different shortcut in steam on a per game basis, completely ignore Launchbox and unpack half my games. With over 150,000 Roms and ISOs, you can imagine why a front end is the best way to do this. I would like to be able to have Launchbox give its own custom command line to steam and then steam will open the emulator and load the rom. This way, I can just double click the game on the front end, it launches Dolphin from steam and loads the game. I get my Dolphin config, it says I am playing Dolphin and not launch box and I am happy.

Conclusion
Is there a way anyone can think of that will allow me to launch a NON-STEAM game from steam but also be able to pass command line switches to the NON-STEAM game FROM the command line? If not, I get that this is super complicated and a VERY fringe edge case here. Thing is, what grinds my gears to no end, it that with a steam game it works, perfectly well. It seems Valve is explicitly blocking non-steam games from having the same convenience. I have been fiddling for the last few hours on this and I simply can't get this to work at all, no matter what I do.

Any insight or help with this would be GREATLY appreciated as I am at my wits end here with this thing. :steamsalty:
Last edited by cammelspit; Aug 15, 2016 @ 3:29pm
< >
Showing 1-11 of 11 comments
lagamemnon Aug 15, 2016 @ 4:35pm 
Windows, right?

Can Steam run batch files or PowerShell scripts? If so, maybe make one per game you want to launch, and have each one invoke Launchboxk with the right flags.

Make a text file like this, called game.bat:

@echo off game.exe /flag /flag exit

And then try running it from CMD.EXE. Tweak it until it does the right thing.

Then try adding game.bat to Steam?
cammelspit Aug 15, 2016 @ 4:48pm 
Originally posted by lagamemnon:
Windows, right?

Can Steam run batch files or PowerShell scripts? If so, maybe make one per game you want to launch, and have each one invoke Launchboxk with the right flags.

Make a text file like this, called game.bat:

@echo off game.exe /flag /flag exit

And then try running it from CMD.EXE. Tweak it until it does the right thing.

Then try adding game.bat to Steam?

Yes, Windows. I should have lead with that. :D

Steam ignores *.bat files so they also need to be converted to *.exe before they will work, I have done this before. The thing is, my personal reason for doing this is entirely for emulation through a front end. I can't really make an individual *.bat and convert it to a *.exe for each and every one of the 150,000 plus roms and ISOs that I have on a 4TB dedicated emulation drive. I don't know enough about scripting and such to make one that can do it all for me. This also would completely cut out the Front End altogether. There are other options to do it automatically and have each game added directly into your steam library but those have all been abysmal messes. Try using ICE one time and you see exactly what I mean by that.

I think I might also post in the Launchbox forums, someone there might have some idea but since it is explicitly steam that is actively blocking the command line switches, I am not hopeful.

It just seems strange that Valve would opt to make this specific thing impossible for non-steam games when steam games work fine and retain the switches. :steamsad:
might i recommed watching this video about steam controller and emulators such as Configuring Dolphin, PCSX2, Snes and Nes emulators all to work with the Steam Controller hope this helps https://www.youtube.com/watch?v=zH3Wz9qPyc0
cammelspit Aug 15, 2016 @ 5:31pm 
Originally posted by windows 10 updates FEELSBADMAN:
might i recommed watching this video about steam controller and emulators such as Configuring Dolphin, PCSX2, Snes and Nes emulators all to work with the Steam Controller hope this helps https://www.youtube.com/watch?v=zH3Wz9qPyc0
It doesn't. I have literally written the book on using Dolphin with the SC. I want to be able to load a non steam emulator from steam with the command line for another front end. This is a very specific method I would like to use. If not? well, whatever, I can just do it the same way I have been doing it since OCT of last year when I first got my SC.

http://steamcommunity.com/sharedfiles/filedetails/?id=571637466
Last edited by cammelspit; Aug 15, 2016 @ 5:32pm
Balderick Aug 16, 2016 @ 5:10am 
It is possible for steam to use .bat and other non exe files for launching scripts
https://steamcommunity.com/app/353370/discussions/0/458604254466665555/?ctp=2#c364042063118379310

You just need to set targets, permissions and environment variables.
lagamemnon Aug 16, 2016 @ 7:09am 
Recap to make sure I understand. This is just goals, not how to reach them.

  • You have thousands of non-Steam games you'd like to use with the Steam Controller.
  • While there are thousands of games, they all run under two or three game engines.
  • Each game engine has its own Steam Controller layout.
  • For the purpose of loading SC layouts, Steam only needs to recognize each engine.
  • This can work if a non-Steam launcher can tell Steam which engine to run, and which game to run under the engine. For example, start EngineOne and run Game867.DAT.
  • This would be a non-issue if parameters in a steam:// URI were passed to the non-Steam engines.

If that's accurate, this convoluted idea might work:

Wrap Steam in a script that saves the parameters to a temporary file. Launchbox would invoke the wrapper, which would stash the parameters somewhere safe before invoking Steam.

Wrap the emulator in a script that reads the temporary file and passes the parameters to the engine. Steam would invoke this wrapper instead of the game engine directly.
cammelspit Aug 16, 2016 @ 11:05am 
Originally posted by lagamemnon:
Recap to make sure I understand. This is just goals, not how to reach them.

  • You have thousands of non-Steam games you'd like to use with the Steam Controller.
  • While there are thousands of games, they all run under two or three game engines.
  • Each game engine has its own Steam Controller layout.
  • For the purpose of loading SC layouts, Steam only needs to recognize each engine.
  • This can work if a non-Steam launcher can tell Steam which engine to run, and which game to run under the engine. For example, start EngineOne and run Game867.DAT.
  • This would be a non-issue if parameters in a steam:// URI were passed to the non-Steam engines.

If that's accurate, this convoluted idea might work:

Wrap Steam in a script that saves the parameters to a temporary file. Launchbox would invoke the wrapper, which would stash the parameters somewhere safe before invoking Steam.

Wrap the emulator in a script that reads the temporary file and passes the parameters to the engine. Steam would invoke this wrapper instead of the game engine directly.
You are PRECISELY correct! WOOHOO! The launchbox guys seemed to think I was having a problem with my link, I don't own a link. :D Ok, so that really should work or it sounds like it would. I just don't have the foggiest on how to make a script that would do such a thing. Now, I think it is time for me to start learning how.

So, to recap your suggestion... Instead of having LaunchBox invoke steam directly, it would invoke a script that would record the parameters in a file somewhere. Then steam would, in turn, invoke another script and not the emulator itself that would read the file with the parameters that were previously saved.

This seems like a relatively simple process. For me, this will require some learning of new skills and a LOT of research but I am more than willing to learn something new. I have never found the need to do anything like this but this could be a very interesting experiment. Besides, tinkering to make things do what I want, even if they don't want them to, is kinda something I enjoy.

Thank you very much for the suggestion! I will look into it and let you know if I can figure it out. :rufussmile:
lagamemnon Aug 16, 2016 @ 11:13am 
Originally posted by cammelspit:
So, to recap your suggestion... Instead of having LaunchBox invoke steam directly, it would invoke a script that would record the parameters in a file somewhere. Then steam would, in turn, invoke another script and not the emulator itself that would read the file with the parameters that were previously saved.

Yep. The second script would then pass those parameters to your game engine. If you can't pass parameters through Steam, this might at least let you pass them around it.
cammelspit Aug 16, 2016 @ 12:00pm 
Originally posted by lagamemnon:
Originally posted by cammelspit:
So, to recap your suggestion... Instead of having LaunchBox invoke steam directly, it would invoke a script that would record the parameters in a file somewhere. Then steam would, in turn, invoke another script and not the emulator itself that would read the file with the parameters that were previously saved.

Yep. The second script would then pass those parameters to your game engine. If you can't pass parameters through Steam, this might at least let you pass them around it.
I have been doing some digging and it seems like what I want to do surely can be done but since I am new to this, I will have to take it slow and learn the basics from the ground up. I am almost a little excited at the prospect of being able to do this. Not just for this specific thing but for getting into something that I simply have never even attempted before. The way Launchbox works, I can put in pretty random stuff into its command line and it will send it, making the command line switches variables(?) should be trivial, then I redirect those to a text file. I was thinking, then it could rename that text file to a *bat. file, or save it that way directly depending on what is possible. Then it would essentially be building the batch that needs to be run from steam. Another bat converted to an EXE could be loaded into steam that does nothing but loads the saved bat and is invoked by that first bat after a few seconds, not sure if this is the right way to do it but I have only spent a half hour looking into something I have no idea how to do, sooooo... :steamhappy:
cammelspit Aug 16, 2016 @ 5:50pm 
UPDATE: ALAS! There is no way that I know of to get it to do what I want with anything that Windows batch files can do. The problem is that LaunchBox will only append the path to the game at the END of the command line. I can input a command line or a BAT that will create a text file, save the settings, call steam, open the other bat file made with steam, and the game will launch with all the command line switches intact. The only problem is LaunchBox and it having to append to the end of the command line. If I could put it anywhere I would have already succeeded! :steamsad: I think I am either going to have to start using a much more complex and intricate scripting language than just the Windows command line parsing nonsense of batch files to get this to work. If I knew how to code anything, even tiny stuff, I could just make a little app that watches for the TXT or with the command line in it to appear and then handles the handoff to steam. At that point, I would be able to just make a plugin for LaunchBox because apparently, it supports that.

I am so close I can taste it but it is just ever so slightly out of my reach!
lagamemnon Aug 16, 2016 @ 7:53pm 
Ok. I worked out a proof of concept.

Wherever there's "YOU" substitute your home directory name. If there's a space in your user name, the quotes around "YOU" are mandatory.

Create a batch file "c:\users\YOU\engine.bat"

@echo off start /wait /b c:\users\"YOU"\redirect.bat exit

Create a non-Steam game:

  • Name: TestEngine
  • Target: "c:\users\YOU\engine.bat"
  • Start in: "c:\users\YOU\"

Create a desktop shortcut for the TestEngine game. Open the properties to find the steam:// URL for the game. The URL in the "Web Document" tab may be a lie. Use the one in the "Details" tab.

Create another batch file called "c:\users\YOU\steam.bat". This will build a temporary redirect.bat file to invoke the real game engine (notepad.exe for testing).

@echo off echo @echo off > "c:\users\YOU\redirect.bat" echo notepad.exe "a %1 b %2 c" >> "c:\users\YOU\redirect.bat" echo exit >>" c:\users\YOU\redirect.bat" start /wait /b steam://rungameid/NUMBER-FROM-DESKTOP-SHORTCUT

Open a command line and run: steam.bat test ting.

An empty CMD.EXE window should open, and so should notepad. Notepad should complain about "Cannot find the a test b ting c.txt file." That's how you know your parameters reached the end game.

If you change engine.bat, it may break the Steam Library shortcut. You may need to delete and re-add the game. It will probably have a new game ID.
< >
Showing 1-11 of 11 comments
Per page: 1530 50

Date Posted: Aug 15, 2016 @ 3:22pm
Posts: 11