• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
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

Credits Stored In Game Select Menu

Scheduled Pinned Locked Moved Help and Support
help meidearetropie 4.4programmingscript request
12 Posts 4 Posters 1.5k 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.
  • A
    armanivers
    last edited by 23 Apr 2019, 11:22

    Hello,

    I am trying to challenge myself to programm new things since I don't have much programming experience in this field, so what my idea was back then when I played arcade games on the big arcade machines as a child, they used to store the credit (after inserting a coin) in the menu already, that means being in the menu where I could select games there was a number displaying the credits which I had.

    So when I started a game I just had to hit player 1/2 button to start the actuall game and it would decrease the credits " in the bank " which were stored in the menu.

    So does anybody have a little clue/tip on how I could implement this at my machine at home?

    Thanks in advance!

    M 1 Reply Last reply 23 Apr 2019, 11:34 Reply Quote 0
    • M
      mitu Global Moderator @armanivers
      last edited by 23 Apr 2019, 11:34

      @armanivers said in Credits Stored In Game Select Menu:

      So does anybody have a little clue/tip on how I could implement this at my machine at home?

      Is your machine at home running RetroPie ?

      A 1 Reply Last reply 23 Apr 2019, 12:49 Reply Quote 0
      • A
        armanivers @mitu
        last edited by armanivers 23 Apr 2019, 12:49

        @mitu yes, with attract mode as front end.

        1 Reply Last reply Reply Quote 0
        • M
          mitu Global Moderator
          last edited by 23 Apr 2019, 13:24

          You can probably add a button/coin acceptor that can trigger a script (using the triggerhappy daemon) and then store the # of coins somewhere (a file ?).
          You could then use the onstart/onend script support in runcommand:

          • OnStart will check the # of available coins and exit if not enough.
          • OnEnd can substract one credit from the available ones.

          The only problem is to show the available credits on the interface and to change it when it's updated - that's up to AttractMode's scripting and theming capabilities, but I have no knowledge there.

          A 1 Reply Last reply 23 Apr 2019, 14:15 Reply Quote 0
          • A
            armanivers @mitu
            last edited by armanivers 23 Apr 2019, 14:15

            @mitu is there a way to constantly check for a coin insterted/button pressed like a constant (python?) script running in the background? Like if I am in a game and have no coins I still want to be able to just look at the demo and like see what the game is first and then be able to insert a coin while in the game screen .

            And also it would be a problem if I enter a game with 1 credit and play the game and die and I would like to insert another credit to continue but the script wont trigger right? because the game checks on the # of coins only at start of the game and updates it at the end again?

            M 1 Reply Last reply 23 Apr 2019, 14:27 Reply Quote 0
            • M
              mitu Global Moderator @armanivers
              last edited by 23 Apr 2019, 14:27

              @armanivers said in Credits Stored In Game Select Menu:

              @mitu is there a way to constantly check for a coin insterted/button pressed like a constant (python?) script running in the background? Like if I am in a game and have no coins I still want to be able to just look at the demo and like see what the game is first and then be able to insert a coin while in the game screen .

              What I understood from your description is that you want to control the start-up of a game through credits, but not during gameplay. During gameplay, you could probably 'wire' the (virtual) coin acceptor to function like an actual credit input (i.e. like pressing the coin button, Select), but if you don't have enough credits, then you won't be able to start the game.

              And also it would be a problem if I enter a game with 1 credit and play the game and die and I would like to insert another credit to continue but the script wont trigger right? because the game checks on the # of coins only at start of the game and updates it at the end again?

              That's a different story - but see my reply above.

              A 1 Reply Last reply 23 Apr 2019, 16:37 Reply Quote 0
              • A
                armanivers @mitu
                last edited by 23 Apr 2019, 16:37

                @mitu said in Credits Stored In Game Select Menu:

                @armanivers said in Credits Stored In Game Select Menu:

                @mitu is there a way to constantly check for a coin insterted/button pressed like a constant (python?) script running in the background? Like if I am in a game and have no coins I still want to be able to just look at the demo and like see what the game is first and then be able to insert a coin while in the game screen .

                What I understood from your description is that you want to control the start-up of a game through credits, but not during gameplay. During gameplay, you could probably 'wire' the (virtual) coin acceptor to function like an actual credit input (i.e. like pressing the coin button, Select), but if you don't have enough credits, then you won't be able to start the game.

                Sorry for my bad description, I will try again.

                So what I find as a problem is that when I insert coins in-game like I put 5 coins/credits and maybe use only 2 of them and decide the game sucks and leave it,I would still have the 3 credits left which I could use for some other game. I want to keep overall all credits in a seperate place, as you said in a text file for example. Inserting 10 credits while in the menu would allow me to enter a game and while in the game I just have to press the player 1 button and it would decrease the 10 saved credits.

                I just don't want to loose my credits which I inserted in-game, but keep them saved and to use them in another game, if possible ofcourse. Thank you for your time.

                M 1 Reply Last reply 23 Apr 2019, 16:53 Reply Quote 0
                • M
                  mitu Global Moderator @armanivers
                  last edited by 23 Apr 2019, 16:53

                  @armanivers said in Credits Stored In Game Select Menu:

                  I just don't want to loose my credits which I inserted in-game, but keep them saved and to use them in another game, if possible ofcourse

                  That wouldn't be possible with the idea I outlined before. The front-end doesn't know what happened in the game (emulator), so it wouldn't know when to subtract and when to not subtract credits.
                  This leaves the credit counting/subtracting to the emulator, but that would require the emulator to read the credits from somewhere - I don't know how/if that's possible.

                  A 1 Reply Last reply 24 Apr 2019, 16:57 Reply Quote 1
                  • A
                    armanivers @mitu
                    last edited by 24 Apr 2019, 16:57

                    @mitu thank you for your help, I still have hope that someone else answers, as far as I am aware the advmame emulator supports reading the "credits information" stored from somewhere else.

                    O 1 Reply Last reply 25 Apr 2019, 02:12 Reply Quote 0
                    • O
                      oldspicy @armanivers
                      last edited by 25 Apr 2019, 02:12

                      @armanivers @mitu Could a text file be written where it stores the amount of credits by watching the input? Then have the runcommand-onend append that file to subtract one.

                      Runcommand OnStart could trigger another script that reads the file, and presses select (or whatever the coin button is) the number of times to equal the credits?

                      M 1 Reply Last reply 25 Apr 2019, 03:27 Reply Quote 0
                      • M
                        mitu Global Moderator @oldspicy
                        last edited by mitu 25 Apr 2019, 03:27

                        @oldspicy said in Credits Stored In Game Select Menu:

                        Runcommand OnStart could trigger another script that reads the file, and presses select (or whatever the coin button is) the number of times to equal the credits?

                        It could, but in this case all your credits will be gone to 1 game - once you start it - which is not what the author wanted. You could be starting one game, but spend only 1-2 credits on it and then exit, you then need to keep the remaining credits outside, the emulator should keep count of how many credits are left and write that info.

                        O 1 Reply Last reply 25 Apr 2019, 05:10 Reply Quote 1
                        • O
                          oldspicy @mitu
                          last edited by 25 Apr 2019, 05:10

                          @mitu sorry, must have read too quickly. I was thinking one credit per each time the emulator is started, and then drop a credit when the game exits.

                          1 Reply Last reply Reply Quote 0
                          12 out of 12
                          • First post
                            12/12
                            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.

                            This community forum collects and processes your personal information.
                            consent.not_received