RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Launch custom images on boot of games

    Scheduled Pinned Locked Moved Help and Support
    imagevieweronstartruncommand
    26 Posts 5 Posters 1.8k 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.
    • KrakatoaK
      Krakatoa
      last edited by Krakatoa

      Pi 4
      RetroPie is v4.6

      How can I make boxart images launch using image path

      LAUNCHIMAGE="/home/pi/RetroPie/roms/$1/downloaded_images/$ROM_BN_screenscraper_boxart_arrm.png"
      

      from /opt/retropie/configs/all/runcommand-onstart.sh?

      it works if I change the image name to "-" instead of "_"

      LAUNCHIMAGE="/home/pi/RetroPie/roms/$1/downloaded_images/$ROM_BN-screenscraper-boxart-arrm.png"
      

      I'm guessing need to figure out to swap - for _ in the code?

      It based on this code

      #! /bin/bash
      ARCH=$(uname -m)
      SYSTEM="$1"
      RACORE="$2"
      ROMPATH="$3"
      ROM_BN_EXT="${ROMPATH##*/}"
      ROM_BN="${ROM_BN_EXT%.*}"
      LAUNCHIMAGE="/home/pi/RetroPie/roms/$1/images/launching/$ROM_BN-launching.png"
      case $ARCH in
        armv7l)
          fbi -1 -t 0 -noverbose -a "$LAUNCHIMAGE" </dev/tty &>/dev/null &
          IMAGEVIEWER="fbi"
          ;;
        i386 | i686 | x86_64)
          feh -F -N -Z -Y -q "$LAUNCHIMAGE" & &>/dev/null &
          IMAGEVIEWER="feh"
          ;;
        *)
          ;;
      esac
      
      1 Reply Last reply Reply Quote 0
      • IanDaemonI
        IanDaemon
        last edited by IanDaemon

        On my 3B+ I just added a dkong-launching.png in the roms/images directory so that dkong would have a launching image. I don't have a "4", but this is simple on the 3B+. No script customization necessary.

        The ROM name must match with -launching.png at the end.

        • 5 Favorite Arcade Games in MAME
        • Cocktail Cabinet Games
        • Check out the MAME RoW
        KrakatoaK 1 Reply Last reply Reply Quote 0
        • johnodonJ
          johnodon
          last edited by

          @Krakatoa said in Launch custom images on boot of games:

          $ROM_BN_screenscraper_boxart_arrm.png

          So...silly question...

          Are your files actually named like this (as an example): zaxxon_screenscraper_boxart_arrm.png)

          You should just be able to change that part of the code from '-' to '' and save the file (unless the '' is somehow impacting the variable).

          John

          KrakatoaK 1 Reply Last reply Reply Quote 0
          • KrakatoaK
            Krakatoa @johnodon
            last edited by Krakatoa

            @johnodon yes the files are named like that. Its how the ARRM scraper names the files automatically.

            I figured changing the code would work, my question though is where do I make the change?

            johnodonJ 1 Reply Last reply Reply Quote 0
            • KrakatoaK
              Krakatoa @IanDaemon
              last edited by

              @IanDaemon My images are automatically scrapped so renaming them all to -launching.png at the end will require renaming thousand of files. That's why I want to change the code to use "_" instead of "-"

              IanDaemonI WeirdHW 2 Replies Last reply Reply Quote 0
              • IanDaemonI
                IanDaemon @Krakatoa
                last edited by IanDaemon

                @Krakatoa I actually use different images for the "launching images" than the ones scraped for ES selection. If you want the scraped images to be the same as the launching images that should be even easier. I think there is a setting in RetroPie menu under Runcommand settings to do that.

                • 5 Favorite Arcade Games in MAME
                • Cocktail Cabinet Games
                • Check out the MAME RoW
                KrakatoaK 1 Reply Last reply Reply Quote 0
                • KrakatoaK
                  Krakatoa @IanDaemon
                  last edited by

                  @IanDaemon I tried that setting in the runcommand for doing that and it fails, I think its because of the way ARRM names the files, but I am not entirely sure. That why I went this route.

                  To be honest I am good with whatever way is the easiest, as long as it works.

                  johnodonJ 1 Reply Last reply Reply Quote 0
                  • johnodonJ
                    johnodon @Krakatoa
                    last edited by

                    @Krakatoa said in Launch custom images on boot of games:

                    @johnodon yes the files are named like that. Its how the ARRM scraper names the files automatically.

                    I figured changing the code would work, my question though is where do I make the change?

                    If you are following my process, it would be in /opt/retropie/configs/all/runcommand-onstart.sh

                    KrakatoaK 1 Reply Last reply Reply Quote 0
                    • johnodonJ
                      johnodon @Krakatoa
                      last edited by

                      @Krakatoa said in Launch custom images on boot of games:

                      @IanDaemon I tried that setting in the runcommand for doing that and it fails, I think its because of the way ARRM names the files, but I am not entirely sure. That why I went this route.

                      To be honest I am good with whatever way is the easiest, as long as it works.

                      The problem with doing it in runcommand.sh is if that script is updated, you will lose your changes.

                      KrakatoaK 1 Reply Last reply Reply Quote 0
                      • KrakatoaK
                        Krakatoa @johnodon
                        last edited by

                        @johnodon Doesn't your script call variables from the runcommand.sh?

                        ROM_BN="**${ROM_BN_EXT%.*}**"
                        LAUNCHIMAGE="/home/pi/RetroPie/roms/$1/images/launching/$ROM_BN-launching.png"
                        

                        The bolded is what I'm assuming needs to change. I don't really want to mess wit the runcommand though because it changes with updates. So that's where I'm stumped.

                        johnodonJ 1 Reply Last reply Reply Quote 0
                        • KrakatoaK
                          Krakatoa @johnodon
                          last edited by

                          @johnodon I agree I don't want to change to touch he runcommand.sh. Maybe I can copy the variable from the script, rename it and add it to the runcommand-onstart.sh.

                          1 Reply Last reply Reply Quote 0
                          • johnodonJ
                            johnodon @Krakatoa
                            last edited by

                            @Krakatoa said in Launch custom images on boot of games:

                            @johnodon Doesn't your script call variables from the runcommand.sh?

                            Yes...my runcommand-onstart.sh captures the values for the runcommand.sh variables so they can be used for my purposes:

                            #! /bin/bash
                            ARCH=$(uname -m)
                            SYSTEM="$1"
                            RACORE="$2"
                            ROMPATH="$3"
                            ROM_BN_EXT="${ROMPATH##*/}"
                            ROM_BN="${ROM_BN_EXT%.*}"
                            LAUNCHIMAGE="/home/pi/RetroPie/roms/$1/images/launching/$ROM_BN-launching.png"
                            case $ARCH in
                              armv7l)
                                fbi -1 -t 0 -noverbose -a "$LAUNCHIMAGE" </dev/tty &>/dev/null &
                                IMAGEVIEWER="fbi"
                                ;;
                              i386 | i686 | x86_64)
                                feh -F -N -Z -Y -q "$LAUNCHIMAGE" & &>/dev/null &
                                IMAGEVIEWER="feh"
                                ;;
                              *)
                                ;;
                            esac
                            export RACORE
                            export IMAGEVIEWER
                            ( /opt/retropie/configs/all/pause.sh ) &
                            

                            These two lines get the romname.extension and trims off the extension (i.e. zaxxon.zip --> zaxxon) and writes it to a local variable (ROM_BN)

                            ROM_BN_EXT="${ROMPATH##*/}"
                            ROM_BN="${ROM_BN_EXT%.*}"
                            

                            The LAUNCHIMAGE variable is then constructed by concatenating the full path to the romfile (/home/pi/RetroPie/roms/$1/images/launching/ <-- where $1 = the system name) + $ROM_BN (zaxxon) + -launching.png

                            This translates into /home/pi/RetroPie/roms/arcade/images/launching/zaxxon-launching.png

                            I don't see why this wouldn't work...

                            LAUNCHIMAGE="/home/pi/RetroPie/roms/$1/downloaded_images/$ROM_BN_screenscraper_boxart_arrm.png"

                            ...again, unless the _ after the variable is screwing it up. Launch a games and then look at the runcommand.log by doing cat /dev/shm/runcommand.log. Sometimes you will catch the error in there.

                            KrakatoaK 1 Reply Last reply Reply Quote 0
                            • KrakatoaK
                              Krakatoa @johnodon
                              last edited by Krakatoa

                              @johnodon Thanks for the detailed info. I will do some debugging when I get home from work tonight.

                              Actually the more I think about it, that's the issue. If I place the variable in braces it should work. Basically escaping it.

                              LAUNCHIMAGE="/home/pi/RetroPie/roms/$1/downloaded_images/${ROM_BN}_screenscraper_boxart_arrm.png"
                              
                              ClydeC 1 Reply Last reply Reply Quote 0
                              • ClydeC
                                Clyde @Krakatoa
                                last edited by

                                @Krakatoa Just to throw another possible solution on the table, I recently wrote a little script to link Skyscraper's cover artwork to the corresponding launching images. Maybe with a little rewrite, you could use that for your undertaking.

                                See https://retropie.org.uk/forum/post/223113 for the script.

                                KrakatoaK 1 Reply Last reply Reply Quote 0
                                • KrakatoaK
                                  Krakatoa @Clyde
                                  last edited by

                                  @Clyde Thanks, I'll take look.

                                  1 Reply Last reply Reply Quote 0
                                  • KrakatoaK
                                    Krakatoa
                                    last edited by

                                    Ok, Adding the curly braces works, but its very buggy. It loads the screens when exiting games, also loads it when going into config menus. So it must be caching it somewhere.

                                    Does anyone know the directories/files it looks for when setting this up from the run command?

                                    IanDaemonI 1 Reply Last reply Reply Quote 0
                                    • IanDaemonI
                                      IanDaemon @Krakatoa
                                      last edited by

                                      @Krakatoa Can't you use -onstart.sh and -onend.sh?

                                      • 5 Favorite Arcade Games in MAME
                                      • Cocktail Cabinet Games
                                      • Check out the MAME RoW
                                      KrakatoaK 1 Reply Last reply Reply Quote 0
                                      • KrakatoaK
                                        Krakatoa @IanDaemon
                                        last edited by

                                        @IanDaemon Maybe. though that's probably beyond my skills. Does anyone know what folders the runcommand looks for when it runs lunch menu art?

                                        "Launch Menu Art: If enabled, any scraped box art you have for a game will show up as a splashscreen while your game loads up."

                                        IanDaemonI 1 Reply Last reply Reply Quote 0
                                        • IanDaemonI
                                          IanDaemon @Krakatoa
                                          last edited by

                                          @Krakatoa Depending on where you have the system save it could be \\THINCOCKTAIL\roms\arcade\media\screenshots where the machine is named "THINCOCKTAIL" and the system is "arcade".

                                          • 5 Favorite Arcade Games in MAME
                                          • Cocktail Cabinet Games
                                          • Check out the MAME RoW
                                          KrakatoaK 1 Reply Last reply Reply Quote 0
                                          • KrakatoaK
                                            Krakatoa @IanDaemon
                                            last edited by Krakatoa

                                            @IanDaemon Is that path hardcoded? My path to the images are

                                            \\retropie\roms\atomiswave\media\images\game.png

                                            IanDaemonI 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.