Credits Stored In Game Select Menu
-
@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 ?
-
@mitu yes, with attract mode as front end.
-
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 inruncommand
:- 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.
-
@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?
-
@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.
-
@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.
-
@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. -
@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.
-
@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?
-
@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.
-
@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.
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.