Loading games from network device, but large ones from local
-
Okay, so first, some context:
I mounted the NAS folder into the roms directory, so that part is okay.
I created a script and placed it in
/opt/retropie/configs/all/emulationstation/scripts/game-start/script.sh
so that it gets launched when I start a game, and that's working fine.The script receives the game I'm trying to open as a parameter, checks if it weighs more than 100MB, and if so:
a) checks if the game I'm trying to launch exists in/home/pi/RetroPie/local_roms/xxx/game
b) if it doesn't exist, it's copied from/home/pi/RetroPie/roms/XXX/game
Either way, I end up with the game in the local directory. To launch it, I use
/opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ "$XXX" "$game"
, and that part is also okay. From here on, I can launch any large game without having to wait for the download each time.So, all that is okay... The tricky thing is that when I stop the game, it considers that the script in the
game-start
folder has finished, and runcommand still wants to launch the game in the remote roms folder. So, it starts downloading it and makes this whole process totally useless xDAny suggestion of how can I avoid runcommand launching the game the second time?
Thanks in advace!
-
Don't use an EmulationStation event script, but run a
runcommand
script (on-start or on-before-start), this way you don't need to launch anything yourself andruncommand
will start automatically after you game finishes copying. -
@mitu It seems very interesting and I'll try it out, but will I be able to bypass the path of the rom I'm trying to launch? I mean:
I'm reading this https://retropie.org.uk/docs/Runcommand/#runcommand-scripts
And it seems that it recives 4 arguments
$1 - the system (eg: atari2600, nes, snes, megadrive, fba, etc). $2 - the emulator (eg: lr-stella, lr-fceumm, lr-picodrive, pifba, etc). $3 - the full path to the rom file. $4 - the full command line used to launch the emulator.
But if I modify $3 on
runcommand-onstart.sh
from~/RetroPie/roms
to~/RetroPie/local_roms
this parameter will be passed to the runcommand on the launch of the script as well or will runcommand still try to launch the one in~/RetroPie/roms
-
@Kit8
runcommand
will still run$3
, you cannot change it's parameters, but you can symlink the ROM to one that's 'local'.EDIT: hm, the symlink will not work.
-
@mitu Then I don't see the point in using the runcommand script :S I can launch the local one properly, if I do a
ps -ef
this appearspi 6415 5934 0 17:43 tty1 00:00:00 bash /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ psx /home/pi/RetroPie/local_roms/psx/Medievil.bin
The thing is that after quiting the game this one also appears
pi 6436 6435 8 17:44 tty1 00:00:00 bash /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ psx /home/pi/RetroPie/roms/psx/Medievil.bin
And it take it's sweet time to download the rom again xD
-
The only way to stop that right now is the brief second before running the remote one, when te "press a con configure the launch" appears, tan I can select exit without launching, but I would love some way to send that option via script xD
-
Ok, so assuming that I can't stop runcommand from trying to run the remote game I decided to ruin his plans and now in the script before running the local rom y added a
sudo umount ~/RetroPie/roms
so when I fiinish with the local one it'll find nothing, and it's working!!!Now the thing is after finishing with the game I would like to run a sudo mount -a
I suposse I could do it with
runcommand-onend.sh
but for consistency I would like to make it with a script for the emulationstation events, the thing is that I found thegame-start
folder by chance looking on internet @mitu do you know if there is some oficial documentation with the folder names? I'm trying withgame-stop
andgame-end
but seems like guessing is not my strong piont xD -
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.