Starting a game from a script file
-
Alrighty, so with the help of you guys I was able to get the kill script to work for this loader, and then was able to hook it into the godot game to run on a key stroke (yay!) my next conundrum I am having is running a game after the kill, I have tried a few different combinations but the closest I have gotten is an emulationstation BSOD, here is the code I have in the kill script:
#!/bin/bash ps -ef | awk '/godot-engine/ {print $2}' | xargs kill ; sleep 2s && /home/pi/RetroPie/scripts/startmk3.sh
and then in the startmk3.sh:
#!/bin/bash /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ arcade ~/RetroPie/roms/arcade/mk3.zip && emulationstation
So in theory it will kill the godot engine/loader and then wait 2 seconds and then run the second script, but it either hangs or BSODs, I have tried getting rid of the script and just going direct with it too, quite the head scratcher :(
I'm thinking it might be because the script kills the "godot" processes which includes the script itself? Therefore when the second script attempts to boot it emulationstation it stops it half way through on the kill command? If so would I have to run a second "job" for the script/action to be autonomous?
-
Why don't you just have your code exit cleanly from the game/Godot engine ?
Why are you usingruncommand
instead of launching the game directly ?What's the error from
runcommand
? Look into the log file/dev/shm/runcommand.log
.EDIT: EmulationStation also has a log file in
$HOME/.emulationstation
, you can check here also for errors. -
@mitu from that log file i have the following:
/dev/shm/runcommand.log: line 1: Parameters:: command not found /dev/shm/runcommand.log: line 2: Executing:: command not found /dev/shm/runcommand.log: line 3: ERROR:: command not found /dev/shm/runcommand.log: line 4: At:: command not found /dev/shm/runcommand.log: line 5: WARNING:: command not found /dev/shm/runcommand.log: line 6: At:: command not found /dev/shm/runcommand.log: line 7: ERROR:: command not found /dev/shm/runcommand.log: line 8: At:: command not found
I thought runcommand was the best way to launch the game, what would be the best way to do that?
I tried the following and got this resultpi@retropie:~ $ bash ~/RetroPie/roms/arcade/mk3.zip && emulationstation /home/pi/RetroPie/roms/arcade/mk3.zip: /home/pi/RetroPie/roms/arcade/mk3.zip: cannot execute binary file
I probably could just have the launcher/godot game exit on it's own without a kill script, I for some reason didn't think of that lol.
-
@teethree89 said in Starting a game from a script file:
I thought runcommand was the best way to launch the game, what would be the best way to do that?
Just launch the program you want ?
runcommand
is just a wrapper over the actual emulator that does a few other things that are RetroPie specific./home/pi/RetroPie/roms/arcade/mk3.zip: /home/pi/RetroPie/roms/arcade/mk3.zip: cannot execute binary file
Why would you try to execute a
.zip
file ? You'll need to start the emulator needed to load and run the ROM contained in the.zip
file. If you're unsure how to start it and what parameters you need, just launch the game from EmulationStation and then look in/dev/shm/runcommand.log
to see what's the actual command used.EDIT: to see the contents of the
/dev/shm/runcommand.log
, use either a text editor likenano
or theless
/more
pagers (i.e.less /dev/shm/runcommand.log
). -
@mitu basically I am trying to make a loader similar to what the 6-in-1 pacman arcades have except for mortal kombat 1,2, and 3, from which the user can just select the game they want and launch it directly, godot gives me a lot of control over interface, effects etc and has the export I need to run on retropie linux/android etc, thats why I am using the script to try to launch a game without opening the emulator, and the runcommand seemed to have worked for the initial launch sh script to boot directly into a game, if that all makes sense :)
so my path of logic was as follows: Boot into loader (works) > choose game and close loader (works) > launch script for new game to open after close (BSOD or hangs)
-
@teethree89 said in Starting a game from a script file:
basically I am trying to make a loader similar to what the 6-in-1 pacman arcades have except for mortal kombat 1,2, and 3, from which the user can just select the game they want and launch it directly
That what EmulationStation does, seems to me you're trying to re-invent the wheel.
-
@mitu kind of lol, I just want better control of the interface and graphic effects etc for a more classic feel vs having a list of games to scroll through. I know I can re-skin emulationstation but that limits what I can do with it, and I don't see a good custom-izable loader bouncing around the community yet :)
-
@teethree89 said in Starting a game from a script file:
I don't see a good custom-izable loader bouncing around the community yet :)
The no.1 most popular topic in the forum - https://retropie.org.uk/forum/topic/9598/announcing-pegasus-frontend, not mentioning Attract-Mode.
-
@mitu welp, there goes this right into the bin, thank you!
-
2 old projects of mine, perhaps something to peek in :
https://github.com/FollyMaddy/retropieXstation
and
I always use this in the desktop environment, running games directly from the explorer :
https://github.com/FollyMaddy/RetroRun
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.