RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    [SCRIPT] Setup for an automatic savestate selector

    Scheduled Pinned Locked Moved Projects and Themes
    savestatesscript
    47 Posts 13 Posters 9.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jandalf81J
      jandalf81
      last edited by

      This is my next project. I wanted to create a way to select savestates more easily, just like on the SNES mini... Well, this is what I have achieved!

      https://github.com/Jandalf81/savestate_selector

      Take a look at it here: https://imgur.com/a/3zrqvyA

      Install it by entering the following into your RetroPie's console:

      wget -N -P ~/scripts/savestate_selector https://raw.githubusercontent.com/Jandalf81/savestate_selector/master/savestate_selector-install.sh;
      chmod 755 ~/scripts/savestate_selector/savestate_selector-install.sh;
      ~/scripts/savestate_selector/savestate_selector-install.sh;
      

      I haven't created any documentation so far but it should be pretty self-explanatory. Also, it's not tested very extensively, so install this at your own risk! I'd be happy to hear your feedback, though

      PokeEngineerP cyperghostC J 3 Replies Last reply Reply Quote 7
      • PokeEngineerP
        PokeEngineer @jandalf81
        last edited by

        @jandalf81

        Yo, this is pretty neat! I might have to check it out.

        Don't sweat it.
        When in doubt, take a BYTE out of life.

        😎

        1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator
          last edited by

          Looks cool, thank you for the script !

          Some ideas to improve and simplify:

          • use source to include the RetroPie bash functions instead of replicating them inline.
          • instead of using the onstart scripts, use the user menu option for the Runcommand to run your script (https://retropie.org.uk/docs/Runcommand/#runcommand-menu-custom-scripts).
          • just use ImageMagick for generating the thumbnails and install it automatically during setup if not detected, there's no point in letting the users choose which one to install.
          1 Reply Last reply Reply Quote 0
          • jandalf81J
            jandalf81
            last edited by

            @mitu Thank you for your input!

            • I haven't used source with shell scripts before... I'll have to look at the script I copied those functions from. If that script does execute anything, can I just reference those functions? As I understand it sourcetakes the whole file and puts it into my own file (in memory), which would also execute any code therein...
            • That is a good suggestion. I will make it so one can chose one option during install and switch the option with the settings menu itself
            • I don't understand this point... The install scripts does install ImageMagick which is later used to create the thumbnail preview. To be precise, montagefrom ImageMagick is used to create that. PNGView is used to display the previews on top of a simple shell dialog. Is there something I didn't get?
            mituM 1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator @jandalf81
              last edited by mitu

              @jandalf81 said in [SCRIPT] Setup for an automatic savestate selector:

              I haven't used source with shell scripts before... I'll have to look at the script I copied those functions from. If that script does execute anything, can I just reference those functions? As I understand it sourcetakes the whole file and puts it into my own file (in memory), which would also execute any code therein...

              The RetroPie setup script has dedicated shell script files that only declare functions - initfuncs.sh, helpers.sh - and don't execute code.

              I don't understand this point... The install scripts does install ImageMagick which is later used to create the thumbnail preview. To be precise, montagefrom ImageMagick is used to create that. PNGView is used to display the previews on top of a simple shell dialog. Is there something I didn't get?

              No, it's ok - that's something I didn't understand - I thought you're using ImageMagick as an alternative to PngView and let the user choose between them.

              1 Reply Last reply Reply Quote 0
              • cyperghostC
                cyperghost @jandalf81
                last edited by

                @jandalf81 Nice work!
                I would agree to @mitu, it's better to use the runcommand scripts/menus this provides all relevant enviroment to the script. I see that you also ripped out joy2key out of runcommand. If you are doing this you are not forced to stick with tab and enter
                If you invoke /0x20 you can use fselect dialog

                1 Reply Last reply Reply Quote 0
                • jandalf81J
                  jandalf81
                  last edited by

                  @mitu
                  I just updated the script so it now uses the JOY2KEY functions from ~/RetroPie-Setup/scriptmodules/helpers.sh... Had been stumped for quite a while on this. For future reference, at least the two JOY2KEY functions from that script need a variable $scriptdir set to ~/RetroPie-Setup to work correctly. Without this variable, there's no error but it doesn't work either ;-)

                  I call these functions with the same parameters as before, so it's still cursor key for axis/DPAD, ENTER for A, TAB for B, as I like that mapping.

                  @cyperghost
                  I'm fairly new to Shell scripts... What do you mean with your last sentence?

                  1 Reply Last reply Reply Quote 0
                  • L
                    legacy
                    last edited by legacy

                    awesome work.

                    Any chance the games can launch as normal and you use a hot key to open the save state menu.

                    i dont want the save menu to launch on every game.

                    Im probably just been fussy.

                    thank you. Keep up the great work

                    1 Reply Last reply Reply Quote 0
                    • jandalf81J
                      jandalf81
                      last edited by

                      @legacy Thanks!

                      If you want this script to only optionally start before the ROM, that is exactly the suggestion @mitu made. I'll implement this as an option into the installer, so this script will either start every time with the ROM or be available in the RUNCOMMAND section USER MENU

                      If you're asking for a hotkey inside of the games itself, I don't think that's possible...

                      Did I get your request right?

                      L 1 Reply Last reply Reply Quote 0
                      • L
                        legacy @jandalf81
                        last edited by

                        @jandalf81 yes im happy, il look forward to the upgraded script,

                        Also any chance of a background image on the selection screen, is it possible.

                        thank you

                        1 Reply Last reply Reply Quote 0
                        • jandalf81J
                          jandalf81
                          last edited by

                          Hopefully you won't have to wait long... ;-)
                          A background image is not possible, sorry. I'm already using some pretty hacky stuff to display the thumbnails on top of basically everything else... Basically, the dialog is in the main layer and the thumbnail previews are layered on top of that. No way to display anything behind the dialog that I know of.

                          L 1 Reply Last reply Reply Quote 0
                          • L
                            legacy @jandalf81
                            last edited by

                            @jandalf81 , no probs, its working great.

                            1 Reply Last reply Reply Quote 0
                            • jandalf81J
                              jandalf81
                              last edited by

                              @mitu @cyperghost @legacy
                              I have update the script and it's menu. SAVESTATE_SELECTOR can now be invoked by none, either or both of RUNCOMMAND-ONSTART and RUNCOMMAND-MENU. Both options can be enabled and disabled via the settings menu. When started via RUNCOMMAND-MENU it also features two more menu items to return to RUNCOMMAND-MENU or EmulationStation. I have added new screenshots to the IMGur album from the first post.
                              The installer script has not been updated yet.

                              cyperghostC 1 Reply Last reply Reply Quote 3
                              • cyperghostC
                                cyperghost @jandalf81
                                last edited by

                                @jandalf81 if you use an own joy2key session you can set any key to it. So assinig key 0x20 offers usage of space key. This can be used for radio list buttons on dialog

                                1 Reply Last reply Reply Quote 0
                                • jandalf81J
                                  jandalf81
                                  last edited by

                                  @cyperghost Ah, now I see, thanks! At the moment I'm using only menus with dialog, though...

                                  Also, I just updated both scripts so they work in conjunction. Until now, you could remove the local savestates using this script but they'd be re-downloaded on the next start (the sync process from the other script never will delete files on either side). Now, the delete dialog detects the other script and aks you to also confirm the deletion from the remote.

                                  To update, simply re-run the online installation of both scripts.

                                  1 Reply Last reply Reply Quote 2
                                  • S
                                    SuperPitendo
                                    last edited by

                                    A huuuuuuge THANK YOU for both scripts. I have now 3 Pi's (one stationary and two mobile) and customized anything possible to my needs from rewind function, til Background music. So your scripts are the cherry on the top of my build for a kind of a "luxury retrogame experience" :D

                                    1 Reply Last reply Reply Quote 2
                                    • BiZzAr721B
                                      BiZzAr721
                                      last edited by

                                      @jandalf81 I had a chance to install your scripts. The installer was as easy as can be. Surprisingly, I actually like having it automatically start when I load a rom. Some games I didn't even realize I still had a save (EVO - search for eden) and having it load only when a save is detected was an excellent idea. Thumbnails and deletions complete it.

                                      Great work. I think it is near perfect just as it is, but I'm sure it'll mature & get even better just as @cyperghost scripts have.

                                      cyperghostC 1 Reply Last reply Reply Quote 3
                                      • cyperghostC
                                        cyperghost @BiZzAr721
                                        last edited by

                                        @bizzar721 thx

                                        It is always a pleasure to see the coding of others. Everybody gets his own style in writing programs and leaves his own signature in. The way this script is made is really clever and fulfills lots of demands users wanted.
                                        At least it helps me to improve the OpenBOR script of joypad detection. I think I will implent them if OpenBOR will be run on higher version level as it now does. The keep your thumbs up for (hopefully) future development of the OpenBOR binary ;)

                                        1 Reply Last reply Reply Quote 1
                                        • jandalf81J
                                          jandalf81
                                          last edited by

                                          Thank you all for your kind words! That means a lot to me

                                          Both scripts implement vital functions (at least for me); cloud sync and easy savestate selection. I really hope they can be used by a lot more people. Also, I like to deliver "complete" solutions which is why I made the installer and menu scripts.

                                          I understand that doing these things yourself is a major aspect of RetroPie for a lot of people. It is not for all, though. Some people just like to get ready-to-play boxes already doing the things they want. Either way, you can use the scripts as they are or you can customize them to your specific needs. Of course, both scripts still offer options for optimization or added features.

                                          So, if you want to add something to my scripts or if you want to take something out of them to use in other projects, I'm fine with both. Either way, i just ask to be notified of it.

                                          I myself will definitely keep on working on these scripts. I really need to stop playing with my RetroPie and start playing with my RetroPie... ;-)

                                          A 1 Reply Last reply Reply Quote 1
                                          • A
                                            Athimar @jandalf81
                                            last edited by

                                            @jandalf81 I really like your Savestate selector menu. My friend had a copy on his retropie and pointed me to this article.

                                            When I go to perform the install, it attempts to find the PNGView binary on my system. When that shows up as Not Found, it tries to download the source and says 'Failed'. This closes out the install.

                                            My connection looks to be valid so I'm wondering if something has changed in the last two months since anyone posted on this thread.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.