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 2.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.
    • 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
                      • IanDaemonI
                        IanDaemon @Krakatoa
                        last edited by IanDaemon

                        @Krakatoa Hmm,
                        I create custom loading images in Photoshop and put them in
                        \\[machine]\roms\\[system]\images\\[game]-launching.png.

                        I find scraped images (from Skyscraper) in
                        \\[machine]\roms\\[system]\media\screenshots\\[game].png
                        and
                        \\[machine]\roms\\[system]\media\marquees\\[game].png.

                        • 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 that’s why I am looking for the path as each scraper uses different folders. I use both AARM and Skraper https://www.skraper.net/ For scraping. I’m planning on going fully to Skraper if I can get these images loading on boot.

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

                            On my system Skraper and Skyscraper both save in the same folder.
                            (However I did select "use rom folder for scraped images" somewhere so that may be having an effect.)

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

                              @Krakatoa Changing one uniform underscore in thousands of files is no hassle at all with Bulk Rename Utility. Check out my posts here.

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

                                @IanDaemon thanks. I’ll try that.

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

                                  @WeirdH I fixed that issue by using brackets around the code.

                                  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.