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: Help with AutoHotKey to Randomly select fighting game character  (Read 1859 times)

0 Members and 1 Guest are viewing this topic.

Nbk_Orchid

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 35
  • Last login:June 12, 2017, 07:25:34 am
Help with AutoHotKey to Randomly select fighting game character
« on: February 21, 2014, 06:39:08 pm »
I was wondering if anyone had the skills readily available to help with an AutoHotKey script?

Basicly I am looking for a way to randomly select a character for a few different fighting games, such as streetfighter 2 & 3, Mortal Kombat, Marvel vs Capcom and others.  This could help keep my friends from always picking their best characters and whopping me ;) and keep us all trying new characters and learning new match-ups.  I think that this could be useful to the community also, if we could get something working.

Here is what I was thinking off of the top of my head: If the player one start button, coin button, and up on the joystick were pressed at the same time the AutoHotKey script could randomly send 10 or so inputs of either up,down,left, or right.

If button 1 & 5 & up are pressed
  loop 10 times   
    generate random number between 1 and 4
    if 1 input up key
    if 2 input down key
    if 3 input left key
    if 4 input right key
  end loop
end if

Any idea if this can be done with AutoHotKey?
It does not have to be through AutoHotKey but I thought that might be the easiest way.  If anyone has any other ideas I am open to them.

Any help would be greatly appreciated, 
Thanks.

Slippyblade

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3167
  • Last login:June 05, 2024, 10:30:57 am
  • And to the death god we say, "Not today!"
Re: Help with AutoHotKey to Randomly select fighting game character
« Reply #1 on: February 21, 2014, 06:43:12 pm »
I like this idea a lot.  Consider it stolen if someone is able to generate this.  >:D

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Today at 01:14:11 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Help with AutoHotKey to Randomly select fighting game character
« Reply #2 on: February 21, 2014, 07:07:40 pm »
This has been gone over numerous times in this forum... you can NOT simulate key presses and send them to mame because mame uses a raw input method.

If you need to do anything like this you must send joystick presses instead, which means installing ppjoy or vjoy or something similar. 

Nbk_Orchid

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 35
  • Last login:June 12, 2017, 07:25:34 am
Re: Help with AutoHotKey to Randomly select fighting game character
« Reply #3 on: February 22, 2014, 09:43:09 am »
 :-[ , well that is a bit disappointing.  Thanks for the input Howard.

I think AutoHotKey is able to send joystick presses though.  Could that be a possible solution?  Then I would just need to configure mame to also move up,down,left,right using the desired joystick press.

If this is not an option I would be willing to give the vjoy method a try.  I'm not quite ready to let this one die yet.       

Malenko

  • KNEEL BEFORE ZODlenko!
  • Trade Count: (+58)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14019
  • Last login:July 25, 2025, 05:49:10 pm
  • Have you played with my GingerBalls?
    • forum.arcadecontrols.com/index.php/topic,142404.msg1475162.html
Re: Help with AutoHotKey to Randomly select fighting game character
« Reply #4 on: February 22, 2014, 02:21:19 pm »
welp for MK (2 and up) you can random select by pressing up and start on the default selected character (ie on MKII P1= Lui Kand, P2=Reptile)
If you're replying to a troll you are part of the problem.
I also need to follow this advice. Ignore or report, don't reply.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Today at 01:14:11 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Help with AutoHotKey to Randomly select fighting game character
« Reply #5 on: February 22, 2014, 02:53:59 pm »
Yeah I wasn't going to say anything, but with the exception of the original sfII I think all of these games have random select.  I know sf III third strike does.  As does the mk games and I'm assuming the later Capcom titles as well. 

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Help with AutoHotKey to Randomly select fighting game character
« Reply #6 on: February 22, 2014, 07:18:59 pm »
To the OP, you can do what you want to do in mame if you're willing to make a change to the source code and compile it yourself.

See reply 5 in this thread for some info: http://forum.arcadecontrols.com/index.php/topic,134862.msg1391683.html#msg1391683

You also need to have your script send keys in a special way. To send left you would normally just do

Code: [Select]
send {left}

but for this you're going to have to use

Code: [Select]
send {Blind}{left downtemp}
send {Blind}{left up}

instead.

Normally I'm quite willing to walk people through this stuff, but I have almost zero free time these days so pointing you in the right direction is about all I can offer. Hopefully someone else can step in if you have trouble.