Using custom script that is not runcommand.sh does not work
-
@Folly That's what I've done. I made a seperate system reserved for loading games from the disc. It also uses the custom script.
-
So what is your custom system name then ?
And how did you configure it ? -
@Folly If you look at the initial post, you can see the system entry.
-
Is that all you added ?
You will need to add much more to get it working.So you have 2 choices.
Make a module-script like the example I gave you earlier , or do all the setting manually.
You can have a look here on how to do it manually :
https://retropie.org.uk/forum/topic/28462/tutorial-handheld-and-plug-play-systems-with-mameAnd replace mame or emulator with your script and no need to use some retroarch.cfg.
-
@Folly Hmm. Seems like I've got a lot of work to do. I'll let you know how it goes.
-
Can you filter all the nonsense and pick the correct things for yourself ?
-
@Folly I can certainly try. I'm seeing some key things already, for example lines at the end that use the %ROM% argument to load a file from EmulationStation.
-
Ok, good luck.
Try this first, otherwise I recommend you to make a module-script.
Once you know how, then it's the easiest way. -
@Folly These are the lines I have narrowed down. I have a feeling they're wrong, so if they are, please tell me.
-
@RetroFloppy08 said in Using custom script that is not runcommand.sh does not work:
@sleve_mcdichael What argument am I supposed to attach to the command to load the filename?
%ROM%
in the<command>
string is used by EmulationStation and is replaced by the actual rom file you've selected. So for example if your<commamd>
isbash /test/script.sh %ROM%
and you select the game "Foorio in Foo Land" for the "Foo Bar Entertainment System" then ES is going to run:bash /test/script.sh "/home/pi/RetroPie/roms/fbes/Foorio in Foo Land (USA, Zanzibar) (Rev B).foo"
Your script will then need to parse this as
$1
or, "first argument."I wonder if the spaces are maybe tripping it up. Try wrapping
$1
in quotes, like"$1"
:[[ "$1" == *.chd ]] && /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ psx "$1"
...or try
"$*"
("all arguments") instead of"$1"
(first argument) (still in quotes). -
@RetroFloppy08 said in Using custom script that is not runcommand.sh does not work:
@Folly These are the lines I have narrowed down. I have a feeling they're wrong, so if they are, please tell me.
Not sure what you are doing with this.
My script works, but not for your purpose.
The module-script is just an example, if you want to use it you to completely rewrite it for your needs.My advise was to make a custom system manually first.
If that doesn't work we can talk about making a module-script. -
@Folly I've actually gotten the script to work. I reworked how the if statement is processed, and it works like a charm. Instead of isolating the extension (as initially suggested by @sleve_mcdichael) I instead told the program to read the last 4 characters of the filename. It works now, all I need to do is make more discs with different files, and add some else if statements. I'll post the script once it's finished.
-
Good work !
Curious what you made ;-) -
@Folly @sleve_mcdichael Alright, it's done. I present to you the script to load games based off of their filenames. This is the version I have, and it works very well. The selection is limited, but the good news is you can select for yourself what file types are supported. Have fun!
#!/bin/bash rom="$1" if [ "${1: -4}" == ".chd" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ psx "$1" elif [ "${1: -4}" == ".bin" ] || [ "${1: -3}" == ".md" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ megadrive "$1" elif [ "${1: -4}" == ".nes" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ nes "$1" elif [ "${1: -4}" == ".smc" ] || [ "${1: -4}" == ".sfc" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ snes "$1" elif [ "${1: -4}" == ".z64" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ n64 "$1" elif [ "${1: -4}" == ".gba" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gba "$1" elif [ "${1: -4}" == ".zip" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ mame-libretro "$1" elif [ "${1: -3}" == ".gb" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gb "$1" elif [ "${1: -4}" == ".gbc" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gbc "$1" elif [ "${1: -4}" == ".fds" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ fds "$1" elif [ "${1: -4}" == ".nds" ] then /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ nds "$1" fi
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.