Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Accepting coins on PC games  (Read 2273 times)

0 Members and 1 Guest are viewing this topic.

Nacimroc

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 303
  • Last login:October 20, 2015, 03:46:25 pm
Accepting coins on PC games
« on: September 26, 2010, 05:04:19 pm »
Ok, I do realise that coins are for arcade games before anyone says it but.....

I'm wondering is there any way to make my coin slot work for newer PC games preferably driving games, i.e you can't play until you put a coin/credit in. I'd like to try make a driving wheel CP and have it accept coins but I'd want some newer games if I was going to that much hassle and would prefer if it had a coin accepted to play.  If not are there any newer arcade games that accept coins that would suit me?

Thanks



JustMichael

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1438
  • Last login:September 27, 2015, 01:19:40 am
  • Mmmmm!! Cheesecake!!
Re: Accepting coins on PC games
« Reply #1 on: September 26, 2010, 05:25:29 pm »
Think of the coin as a keypress, is there any driving games that require a certain keypress to start?

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Accepting coins on PC games
« Reply #2 on: September 26, 2010, 07:18:04 pm »
I'm pretty sure you could make this work for any game using autohotkey. Say you have 5 as your insert coin button, and 1 as your start button. You could probably set up a script where you have a variable with an initial value of 0. If the variable equals 0, the 1 key is disabled. If you press 5 (you insert a coin!) the variable increases by 1 and the start game key is enabled. Pressing it starts the game and decreases the variable by one. So essentially the only way the game can be played is if a coin is inserted first. One potential problem I see is if the key that starts the game is also needed in game, but there's probably a way to work around that if that's the case.

I'm getting fairly familar with autohotkey and I think this would be a fairly easy script to write. So if you're not familiar with it and this sounds daunting to you, let me know and I'll whip up something really quick when I have a bit of free time. :) :cheers:

Edit: Actually in the case of a key press needed to start the game, the easy thing to do would be just what JustMichael suggested, as long as you're not picky about the coin insertion starting the game rather than the start button. In the case of a game working without a specific button being pressed, ie you can just start playing it, it would just be a matter of having all keys disabled until a coin is inserted, and having all keys disabled again after the game is over.
« Last Edit: September 26, 2010, 07:21:36 pm by nitz »

RayB

  • I'm not wearing pants! HA!
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11279
  • Last login:July 10, 2025, 01:33:58 am
  • There's my post
    • RayB.com
Re: Accepting coins on PC games
« Reply #3 on: September 26, 2010, 07:34:48 pm »
Heh, depending on the game (like if it was an XBOX game) , 1 coin starts the game, a 2nd coin would pause it. ;-)
NO MORE!!

Nacimroc

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 303
  • Last login:October 20, 2015, 03:46:25 pm
Re: Accepting coins on PC games
« Reply #4 on: September 26, 2010, 08:19:45 pm »
I have no hope with the coding side of things and wouldn't even know where to start. I can follow the logic but after reading the replies I can see the main problem would be how to stop the game after a certain time/end of game.

Heh, depending on the game (like if it was an XBOX game) , 1 coin starts the game, a 2nd coin would pause it. ;-)

I could map the start button to the coin credit but how would the game stop ? after a certain period of time maybe ? I would also have to make a reset key to restart the game in case someone else didn't want to continue from the last players 'pause point'.

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Accepting coins on PC games
« Reply #5 on: September 26, 2010, 10:40:38 pm »
One way to stop the game would be to take a snap of the screen after a game ends (assuming there is at least some portion of it that is the same everytime and doesn't appear throughout the game) and cut out the unique portion of it such as the words "game over" and save it to a bmp file. You could have autohotkey continuously search for that image and when it finds it, it disables all keys unless the credit variable is still greater than 0.

I wouldn't mind writing this script for you as this would be pretty easy for me - it would probably take me like 5-10 minutes tops...

Nacimroc

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 303
  • Last login:October 20, 2015, 03:46:25 pm
Re: Accepting coins on PC games
« Reply #6 on: September 27, 2010, 06:43:36 am »
It would be fantastic if you could.  I have no games in mind at the minute though (although need for speed would be my ideal game).

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Accepting coins on PC games
« Reply #7 on: September 28, 2010, 11:04:53 pm »
OK, I came up with this (attached) - it's really kinda more a template than anything, but it works and you should be able to figure out how you could modify it to fit any game. Download and install autohotkey if you haven't already, and change the file extension on credit.txt to credit.ahk. You'll want to take a look at it to see how it works and how you can make changes. It's set up so you can test it in Notepad!

Notes:
For now I assumed that you have the mame defaults for player 1, and didn't bother setting up for player 2, but you should be able to figure out what changes/additions you would need to make to set it up for your configuration. Also, I'm assuming you can set the controls in your game to whatever you want. Having the control key send "a" is really rather arbitrary. And if you're wondering why I don't just have control sending control, it's because this would cause control to be sent ad infinitum as each control that is sent tells the script to send another control! (There might be a workaround for this, but can't remember it ATM).

Also, I've got it set up to simply reset the coin count to 0 and disable all keys after 5 seconds of inactivity - of course you could set it to how ever much time you want. Setting up to decrease the coin count based on a game over image is a bit more complicated, but we'll go into it sometime if you think you want that.

Let me know what you think! :cheers:

Nacimroc

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 303
  • Last login:October 20, 2015, 03:46:25 pm
Re: Accepting coins on PC games
« Reply #8 on: September 29, 2010, 11:00:32 am »
Thanks for that. I think I can actually follow it. Will give it go and let you know!