Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: Nbk_Orchid on February 21, 2014, 06:39:08 pm

Title: Help with AutoHotKey to Randomly select fighting game character
Post by: Nbk_Orchid 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.
Title: Re: Help with AutoHotKey to Randomly select fighting game character
Post by: Slippyblade 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
Title: Re: Help with AutoHotKey to Randomly select fighting game character
Post by: Howard_Casto 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. 
Title: Re: Help with AutoHotKey to Randomly select fighting game character
Post by: Nbk_Orchid 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.       
Title: Re: Help with AutoHotKey to Randomly select fighting game character
Post by: Malenko 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)
Title: Re: Help with AutoHotKey to Randomly select fighting game character
Post by: Howard_Casto 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. 
Title: Re: Help with AutoHotKey to Randomly select fighting game character
Post by: nitz 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 (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.