Runcommand script help for launching Steam games by name
-
I'm trying to make Runcommand launch a Steam game using moonlight/limelight by name and I'm almost got it working except games with spaces in the names will not launch. Moonlight thinks the 2nd word in the game's name is either the name or IP of a computer to connect to.
Okay this is what I've done so far...
I edited
/etc/emulationstation/es_systems.cfg
and added this for Steam/moonlight support:<system> <name>steam</name> <fullname>Steam</fullname> <path>/home/pi/RetroPie/roms/steam</path> <extension>.txt .TXT</extension> <command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ steam %ROM%</command> <platform>pc</platform> <theme>steam</theme> </system>
I made these directories:
mkdir /home/pi/RetroPie/roms/steam
mkdir /opt/retropie/configs/steam
Then I made a new emulators file
/opt/retropie/configs/steam/emulators.cfg
note: this is the file I think I need help withsteam = "moonlight stream -mapping /opt/retropie/configs/steam/xbox360.map -app $(tail %ROM%)" default = "steam"
(I've also tried the above with
$(cat %ROM%)
and I get the same results)This is an example of a game with a space in the game:
nano ~/RetroPie/roms/steam/Grim\ Dawn.txt
"Grim Dawn"
What I want it to do is when I pick "Grim Dawn" from EmulationStation, it will run this command:
moonlight stream -mapping /opt/retropie/configs/steam/xbox360.map -app "Grim Dawn"
...but this is what I get in
/dev/shm/runcommand.log
Parameters: Executing: moonlight stream -mapping /opt/retropie/configs/steam/xbox360.map -app $(tail "/home/pi/RetroPie/roms/moonlight/Grim Dawn.txt") Can't connect to server Dawn' Moonlight Embedded 2.2.2 (EMBEDDED;PI) Connect to Dawn'...
Games without spaces work using the code above.
-
@backstander call the txt files the same name as the game (empty files is fine), and use
%BASENAME%
so "Some Game.txt" will be translated to "Some Game" and you won't have any quoting issues.
In your situation, you need quotes around the
($tail blah)
or else it will think it's multiple parameters. But basename should just be simpler anyway. -
Thanks @BuZz that's what I was looking for!
%BASENAME%
did the trick!steam = "moonlight stream -mapping /opt/retropie/configs/steam/xbox360.map -app %BASENAME%"
I also tried putting quotes around
($tail blah)
but it thinks that the first quote is the end of the line so basicallymoonlight stream -mapping /opt/retropie/configs/steam/xbox360.map -app
is what's being used so the name of the game is getting cut off.For anyone else reading this, the above code only works for games that show when you run
moonlight list
(the Nvidia Geforce Experience optimized games list). I'm still having issues with games with:
in their names. I am experimenting more with this now.What I'd really like would be to use Steam's built in "steam://rungameid/" function. I posted about this at the moonlight-embedded github here:
https://github.com/irtimmer/moonlight-embedded/issues/475 -
@backstander yeah you would need to do it via a launch script to quote it or use single quotes perhaps.
-
Hello, I have been able to solve this problem like this:
in the emulators.cfg file I left like this:
list itemsteam = "/opt/retropie/configs/moonlight/start_stream.sh% ROM%"
default = "steam"And I created a file to call the moonlight command called start_stream.sh and step by step the path of the Game Name.txt
Inside the start_stream.xh script:
#! / bin / bash
game = $ (cat "$ 1") &&
moonlight stream -1080 -fps 60 -app "$ game"So I solve the problem of spaces and it calls the game itself and does not call the game as server to connect.
I also created a script to auto install and configure everything from Moonlight Embeddes in Retropie.
https://github.com/rpf16rj/moonlight_script_retropieI relied on the script I saw here
-
Hey Rodrigo, @rpf16rj
I've just updated my video to show off my latest version of my script. I've added in additional checks and an in menu script updater.
If you could do a branch instead of just creating a new repository on github it will help everyone track changes to this script and also keep acknowledgements for everyone's work so far. A lot of work was put into the script so far and it's being worked on by a few more people as well (not just me). Thanks in advance!
-
@techwiztime Sorry for the ignorance, how would you do what @rpf16rj did in his script? That is putting a text file with the game name. For example what I am trying to accomplish is I have a non-steam game let's call it ABC, I can't add it as a nonsteam game in the steam client and use your script as it will not launch the game. So I figure the alternative was to have a ABC.TXT file and let moonlight run it directly.
Thoughts? Thanks in advance!
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.