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

    Can't see new system in EmulationStation

    Scheduled Pinned Locked Moved Help and Support
    emulationstationscriptmodulesystem
    25 Posts 4 Posters 5.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.
    • hiulitH
      hiulit @mitu
      last edited by

      @mitu Well, I've already used the "one-by-one" method, but here's what I had

      function configure_godot-engine() {
          mkRomDir "godot-engine"
      
          local bin_files
      
          if isPlatform "x86"; then
              bin_files=("godot-3.0-x11-x86-32.bin" "godot-3.1-x11-x86-32.bin")
          elif isPlatform "aarch64"; then
              bin_files=("frt_094_310_arm64.bin")
          elif isPlatform "rpi1"; then
              bin_files=("frt_094_310_pi1.bin")
          elif isPlatform "rpi2" || isPlatform "rpi3"; then
              bin_files=("frt_094_310_pi2.bin")
          fi
      
          for i in "${!bin_files[@]}"; do
              addEmulator 0 "$md_id-$i" "godot-engine" "$md_inst/${bin_files[$i]} --main-pack %ROM%"
          done
      
          addSystem "godot-engine" "Godot" ".pck .zip"
      }
      

      My little contributions to the RetroPie project:

      • Shell-Script-Boilerplate
      • Fun-Facts-Splashscreens
      • Limit-Last-Played-Games
      mituM 1 Reply Last reply Reply Quote 1
      • EfriimE
        Efriim
        last edited by Efriim

        Indirect expansion will not work in a loop, is possibly how to get only one emulator.

        Try using single quotation for the variables, so that it knows the expansion is protected and invariable.

        and/or without the indirect reference since it will be read like

        for i in godot-3.0-x11-x86-32.bin godot-3.1-x11-x86-32.bin do
        add emulator
        
        1 Reply Last reply Reply Quote 0
        • BuZzB
          BuZz administrators
          last edited by

          Ignore my previous msg. Misread (and deleted it). Run with sudo __debug=1 ./retropie_packages etc and check what's going on. Or add some debugging manually.

          To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

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

            @hiulit The code you posted seems ok. I've scoured through the existing modules and I've found something similar to your case - Oricutrun. It adds a few emulators for the same system (i.e same emulators.cfg). Incidentally, the code has a bug (i.e. always ads a default emulator instead of using $default).
            I've run the install script and the .cfg file is created correctly - has all the emulators' entries.

            Just a crazy idea - remove the emulators.cfg and re-run the configure action for your module

            sudo ./retropie_packages.sh godot-engine configure
            

            and check again the .cfg file.

            hiulitH 1 Reply Last reply Reply Quote 0
            • hiulitH
              hiulit @mitu
              last edited by

              @mitu @BuZz @Efriim I finally got it working! :D

                  local bin_file
                  local bin_files
                  local default
                  local id
                  local index
                  local version
              
                  ... some other code ...
              
                  for index in "${!bin_files[@]}"; do
                      default=0
                      [[ "$index" -eq "${#bin_files[@]}-1" ]] && default=1 # Default to the last item in 'bin_files'.
                      
                      version="${bin_files[$index]}"
                      version="$(echo $version | cut -d'_' -f 2)"
                      
                      addEmulator "$default" "$md_id-$version-$id" "godot-engine" "$md_inst/${bin_files[$index]} --main-pack %ROM%"
                  done
              

              So it seems like the error had something to do with the index variable (previously it was named i). Either it needed to be initialized as a local variable or the script didn't like that it was called i... I really don't know. But I got it working :)

              Another thing that I found and maybe it's worth mentioning (and correct me if I'm wrong) is that when I run:

              sudo ./retropie_packages.sh godot-engine configure
              

              the config file:

              /opt/retropie/configs/godot-engine/emulators.cfg
              

              seems to just add the new stuff on top of the previous configs that were already there. I mean, it doesn't delete the file and creates it again with the new configs.

              Shouldn't "deleting the old file and creating a new one" be the "correct" thing to do?

              Thanks! :)

              My little contributions to the RetroPie project:

              • Shell-Script-Boilerplate
              • Fun-Facts-Splashscreens
              • Limit-Last-Played-Games
              1 Reply Last reply Reply Quote 1
              • 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.