Jump to content
LaunchBox Community Forums

stonev

Members
  • Posts

    19
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

stonev's Achievements

8-Bit Processor

8-Bit Processor (3/7)

3

Reputation

  1. Ok, so I peeked in at the AHK forums and yet another helpful internet friend tweaked the code so that the LCtrl variable issue is fixed AND the script works for a second player! Holding down the fire to get a powered attack while autofire is on can be hit-and-miss but I don't think that's fixable given the absolute barrage of button presses the game has to take in. In any case, for anyone who finds this, here's the working script: ; --- Configuration --- SetKeyDelay, 0, 50 ToggleKey1 := "LShift" ; Key to turn P1 autofire on/off FireKey1 := "LCtrl" ; The P1 button to spam (Left Control) ToggleKey2 := "w" ; Key to turn P2 autofire on/off FireKey2 := "a" ; The P2 button to spam (Left Control) Interval := 50 ; Milliseconds between fire button presses (adjust for speed) ; --- Variable --- AutoFire1 := AutoFire2 := false ; Start with P1/P2 autofire off ; --- Toggle Hotkey --- Hotkey, %ToggleKey1%, ToggleAutoFire1 Hotkey, %ToggleKey2%, ToggleAutoFire2 ; --- Main Autofire Timer (Controlled by the toggle) --- Hotkey, ~%FireKey1%, FireKey1 Hotkey, ~%FireKey2%, FireKey2 Return FireKey1: ; When the P1 FireKey is pressed down (~) If (AutoFire1) { ; If P1 autofire is ON Send,% "{" FireKey1 "}" ; Press the P1 fire button SetTimer, FireKey1, -%Interval% } Return FireKey2: ; When the P2 FireKey is pressed down (~) If (AutoFire2) { ; If P2 autofire is ON Send,% "{" FireKey2 "}" ; Press the P2 fire button SetTimer, FireKey2, -%Interval% } Return ; --- Function to Toggle --- ToggleAutoFire1: AutoFire1 := !AutoFire1 ; Flip the P1 state (true to false, false to true) SoundBeep, (%Autofire1%+1)*250 Return ToggleAutoFire2: AutoFire2 := !AutoFire2 ; Flip the P2 state (true to false, false to true) SoundBeep, (%Autofire2%+1)*250 Return ; --- Exit Script --- Esc:: { WinClose, ahk_exe mame.exe ExitApp } Happy gaming!
  2. A little update: I tweaked the original exit script: $Esc:: { WinClose, ahk_exe mame.exe ExitApp } ..and removed the "$" so now it's just Esc:: { WinClose, ahk_exe mame.exe ExitApp } ...and this seems to work. Would there be any unforeseen consequences of removing the "$" that might make this change inadvisable? Also, I got rid of the Tooltip code and replaced it with: ; --- Function to Toggle --- ToggleAutoFire: AutoFire := !AutoFire ; Flip the state (true to false, false to true) SoundBeep, (%Autofire%+1)*250 Return Now there's an audible beep when I toggle AutoFire on and off. The tone is higher for "on" (500hz) and lower for "off" (250hz).
  3. Thanks for sticking with me on this, @JoeViking245. That option didn't work for me. I couldn't exit from the pause screen and when I hit Esc, the game ended but the script was still running. Although the script I'm using is relatively complex, I'd be interested to know how folks navigate using, say, a simple key remapping script for specific Mame games. Surely they don't want the remapping to persist after the game is over. I've looked online for solutions, but many of the involve "IfWinActive", which would be problematic for a script that is meant to work with a few games. Also, for me, the window title seems to include the Mame version so I'd have to remember to change the script with every Mame update. I'd still be interested in having the ahk close command within the script itself, but failing that, is there a way to globally shut down ahk upon exiting a game?
  4. Ok, you guessed correctly! I'm using this script on a game-by-game basis; the use case (for me) is pretty narrow. That said - and sorry I didn't explain this - the above script works when I press the Esc key (i.e., mame and ahk script exit). However, I typically exit a game using the Exit Game option on the pause screen, which I naively assumed was identical to pressing Esc. It seems that it's not though: Exiting via the pause screen exits mame but the ahk script is still running. I have to press Esc again to close the ahk script. Is there an way to close the ahk script upon exiting mame via the pause screen?
  5. Additionally, I've added the following to the bottom of the script: Esc::ExitApp Unfortunately, this kills the script with the first Esc and kills the game (as usual) with the second. Is there a way to kill the script and the game with a single press? Or better yet, kill the AHK script as a result of Mame exiting?
  6. Progress! So adding that line made it work in Mame!!! Just to clean up the script a little... I still can't seem to use the %FireKey% variable on the first line of the Autofire loop. So to snip out part of my code: <FireKey := "{LCtrl}"> and <Send %FireKey%> work in tandem. However, if I use <~%FireKey%::>, I get the "invalid hotkey" error on that line. The only way to fix this is to change that line to <~LCtrl::>, that is, hard-code the key instead of using the variable. Not a deal-breaker by any means, but still a little strange.
  7. Thanks for the idea. Unfortunately, the same "invalid hotkey" error remains. I tried testing a bit further, abandoning the %FireKey% variable altogether and just hard-coding {LCtrl} in the appropriate places. The good news is that when I run the script with a keylogger/checker, it acts as intended: F1 turns on the script with tooltip confirmation, pressing left control begins an auto press of left control every 50ms or so, with the ability to press left control during the sequence without interrupting it, and pressing F1 again turns it off (with tooltip confirmation). The bad news is that trying this with an actual game (Forgotten Worlds) does *not* work. I can see the tooltip when I press F1, but pressing left control doesn't seem to start the firing sequence. I've heard-tell of AHK and MAME not playing well together; maybe this is one of those instances?
  8. Hi All--I'm looking for an AHK script to help me play games like Forgotten Worlds and Eco Fighters on my arcade. For those who are unfamiliar, these games are shoot 'em ups that involve using a joystick for moving around the screen, a spinner for rotating the turret/gun on your character, and a button (or buttons) for firing. For those of you who are good at math, you'll notice that 3 controllers is greater than the two hands that many of us have. Gemini provided the following script based on my quick Google search: ; --- Configuration --- ToggleKey := "F1" ; Key to turn autofire on/off FireKey := "LButton" ; The button to spam (Left Mouse Button) Interval := 50 ; Milliseconds between clicks (adjust for speed) ; --- Variable --- AutoFire := false ; Start with autofire off ; --- Toggle Hotkey --- Hotkey, %ToggleKey%, ToggleAutoFire ; --- Main Autofire Loop (Controlled by the toggle) --- ~%FireKey%:: ; When the FireKey is pressed down (~) If (AutoFire) ; If autofire is ON { Loop { Send {Click} ; Click the button Sleep %Interval% If (!AutoFire) ; Check if toggle key was pressed during loop Break ; Exit the loop if autofire turned off } } Return ; --- Function to Toggle --- ToggleAutoFire: AutoFire := !AutoFire ; Flip the state (true to false, false to true) ToolTip, Autofire % (AutoFire ? "ON" : "OFF") ; Show status SetTimer, RemoveToolTip, -1500 ; Hide tooltip after 1.5 secs Return RemoveToolTip: ToolTip ; Clear the tooltip Return I like the general idea of this script: Set one button to turn the auto-fire ability to ON (or OFF, depending on current state), then pressing the normal fire button to actually start (auto) firing, with the option of still pressing the fire button while it is auto-firing. I also like the idea of setting the press interval. Although games like Forgotten Worlds have a continuous stream of fire while holding the fire button down, I'd rather emulate (very quick) individual button presses. Games like Eco Warriors have a "charge" function where holding the fire button down charges your weapon. I *don't* want the charged weapon to fire unless I manually hold the button down (difficult, yes, with only two hands but maybe possible in a pinch). The problem with the code above is that I can't seem to set my fire button to be Left Control. Setting FireKey := "LControl" at the top gives me an "Invalid hotkey" error in the first line of the Main Autofire Loop. Because this is Gemini-generated, I also have no idea if it'll actually work within LB. Perhaps I'm barking up the wrong tree with the code; I'd be grateful if someone could assess the script I've pasted or even come up with a different way to achieve the autofire toggle functionality I'm looking for. Thank you!!!
  9. Unfortunately, that's what I've got already. It seems that for Model 3 light gun games, I can either have them work or have a pause screen, but not both. For now, I'll choose to have them work! UPDATE: In fact, @JoeViking245, I was not following your script *exactly*. I had MOUSE1_XAXIS and MOUSE1_YAXIS instead of MOUSE_XAXIS and MOUSE_YAXIS. When I changed them to *just* MOUSE_XAXIS and MOUSE_YAXIS (no "1"), it worked! As I *think* I understand it, the rawinput setting allows 2 light guns to be playing simultaneously. Since I have 0 light guns and only 1 trackball, that's not something I need. For folks reading this and encountering problems with the pause screen on Model 3 aside from the issues above, I also found that for it to work in Big Box (i.e., not crash), I had to un-check "Suspend Emulator Process While Paused" and "Forceful Pause Screen Activation" on the Pause Screen emulator settings in LB. Happy gaming!
  10. Oh man, I only checked the Mame controls for pause and resume and, seeing nothing, I never thought to look at the others! Duh. Sufficed to say, your solutions worked…mostly. Everything seems to be fine for most games, but the commands are being ignored for light-gun games, like The Lost World. This may be getting too deep into the Supermodel weeds, but using @Warped Polygon’s AMAZING presets, specifically DINPUT ini.zip, I noticed that those games have an extra parameter: InputSystem=rawinput. If I comment that out, the pause screen scripts work, but my trackball no longer moves the light-gun target, making the game unplayable. I don’t suppose there’s any way for the script to go into direct input for the pause screen and go back to raw for the game? Or maybe I’m misdiagnosing the problem?
  11. Hi All--I've managed to integrate Supermodel into LB and unlike Mame and Retroarch, it appears that I need to set up pause screen buttons manually. It seems like it would be easy to set up AHK scripts under the Pause Screen options for Supermodel, but I can't quite seem to figure it out. For reference Supermodel uses the following keys: Pause: Alt+P Reset: Alt+R Load State: F7 Save State: F5 I can confirm that these commands work when I'm using the keyboard. I just can't seem to map them to the Pause Screen commands. It's very likely that I'm just doing AHK wrong. For instance, for Reset, I've tried "Send !r", "Send {Alt down}r{Alt up}", "Send, !r", and a few other iterations. The Reset option appears on my pause screen, but it doesn't really do anything. Although I can confirm that the game does pause when the pause screen is up. Thanks for any help folks can provide!
  12. Gotcha. Maybe I’ll keep the box checked for now and will remember to uncheck it next time a bug pops up.
  13. Turning off Extract Roms worked!!! It saves remap files with the right name (as opposed to Temp). Thank you @Headrush69 and @skizzosjt for coming up with the solution and to everyone in this thread for their help and patience. You're all a credit to this community. @skizzosjt: out of curiosity, what does the "hide console on startup/shutdown" option do? And how would unchecking it help (beyond this issue)?
  14. Ok, here goes. I'm not sure I'm doing this exactly correctly, so please correct me if I've done something wrong. First, I've created a "retroarch_debug.cfg" file that differs from me regular retroarch.cfg in only a few ways: frontend_log_level and libretro_log_level = "0" (instead of "1") log_to_file, log_to_file_timestamp, and log_verbosity = "true" (instead of "false") When I test "straight" RA, I use the following command line from the RA directory: retroarch -f -L ".\cores\genesis_plus_gx_libretro.dll" -c ".\retroarch_debug.cfg" "..\..\Games\Sega Genesis\Aladdin (USA).zip" When I test via LB, I've added the following to the Sega Genesis "Associated Platform" (genesis_plus_gx_libretro core) to the "Extra Command-Line Parameters: -f -c ".\retroarch_debug.cfg" These both create a log file whenever I launch content (in this case, Aladdin). I'm using WinMerge to compare differences between the RA and LB logfiles. That way, I only need to present the sections that differ. Test #1: Launching Aladdin without any remaps (core, content directory, or game): RA: [INFO] [Core]: Loading dynamic libretro core from: ".\cores\genesis_plus_gx_libretro.dll" [INFO] [Overrides]: Content dir-specific overrides found at "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\\Sega Genesis.cfg". [INFO] [Overrides]: Game-specific overrides found at "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\Aladdin (USA).cfg". [INFO] [Overrides]: Game-specific overrides stacking on top of previous overrides. [INFO] [Config]: Loading config: ".\retroarch_debug.cfg". [INFO] [Config]: Appending override config: "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\\Sega Genesis.cfg". LB: [INFO] [Core]: Loading dynamic libretro core from: "cores\genesis_plus_gx_libretro.dll" [INFO] [Overrides]: Game-specific overrides found at "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\Aladdin (USA).cfg". [INFO] [Config]: Loading config: ".\retroarch_debug.cfg". Test #2: Launching Aladdin without any remaps and then creating a content-directory remap: RA: [INFO] [Core]: Loading dynamic libretro core from: ".\cores\genesis_plus_gx_libretro.dll" [INFO] [Overrides]: Content dir-specific overrides found at "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\\Sega Genesis.cfg". [INFO] [Overrides]: Game-specific overrides found at "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\Aladdin (USA).cfg". [INFO] [Overrides]: Game-specific overrides stacking on top of previous overrides. [INFO] [Config]: Loading config: ".\retroarch_debug.cfg". [INFO] [Config]: Appending override config: "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\\Sega Genesis.cfg". [INFO] [Content]: Loading content file: "..\..\Games\Sega Genesis\Aladdin (USA).zip#Aladdin (USA).md". [INFO] [Content]: CRC32: 0xed427ea9. [INFO] [Remap]: File saved successfully: "D:\LaunchBox\Emulators\RetroArch\config\remaps\Genesis Plus GX\\Sega Genesis.rmp". LB: [INFO] [Core]: Loading dynamic libretro core from: "cores\genesis_plus_gx_libretro.dll" [INFO] [Overrides]: Game-specific overrides found at "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\Aladdin (USA).cfg". [INFO] [Config]: Loading config: ".\retroarch_debug.cfg". [INFO] [Content]: Loading content file: "D:\LaunchBox\ThirdParty\7-Zip\Temp\Aladdin (USA).md". [INFO] [Remap]: File saved successfully: "D:\LaunchBox\Emulators\RetroArch\config\remaps\Genesis Plus GX\\Temp.rmp". Test #3: Launching Aladdin with remaps created in Test #2 loaded: RA: [INFO] [Core]: Loading dynamic libretro core from: ".\cores\genesis_plus_gx_libretro.dll" [INFO] [Overrides]: Content dir-specific overrides found at "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\\Sega Genesis.cfg". [INFO] [Overrides]: Game-specific overrides found at "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\Aladdin (USA).cfg". [INFO] [Overrides]: Game-specific overrides stacking on top of previous overrides. [INFO] [Config]: Loading config: ".\retroarch_debug.cfg". [INFO] [Config]: Appending override config: "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\\Sega Genesis.cfg". [INFO] [Remaps]: Content-dir-specific remap found at "D:\LaunchBox\Emulators\RetroArch\config\remaps\Genesis Plus GX\\Sega Genesis.rmp". [INFO] [Content]: Loading content file: "..\..\Games\Sega Genesis\Aladdin (USA).zip#Aladdin (USA).md". [INFO] [Content]: CRC32: 0xed427ea9. LB: [INFO] [Core]: Loading dynamic libretro core from: "cores\genesis_plus_gx_libretro.dll" [INFO] [Overrides]: Game-specific overrides found at "D:\LaunchBox\Emulators\RetroArch\config\Genesis Plus GX\Aladdin (USA).cfg". [INFO] [Config]: Loading config: ".\retroarch_debug.cfg". [INFO] [Remaps]: Content-dir-specific remap found at "D:\LaunchBox\Emulators\RetroArch\config\remaps\Genesis Plus GX\\Temp.rmp". [INFO] [Content]: Loading content file: "D:\LaunchBox\ThirdParty\7-Zip\Temp\Aladdin (USA).md". So there are clearly a few differences at the top of the log file, but I'm not sure how they'd translate into the problem I'm having. Perhaps they're just reflections of the differences in how I've launched the content. Are there any other tests you'd like to see me try? Before I try re-installing, I'd like to have a very clear sense of what to save. Will the media downloaded through LB still work when I re-install? There's also a "reinstall" option for RA in LB. Would that work too?
  15. Ok, I'm happy to turn on debugging, but I'll need a little guidance on that. Can someone guide me through turning on verbose logging of RA from within LB? I've tried using "-v --log-file retroarch.log" as a default command line parameter, but that doesn't seem to create a log for me. I can launch the game and turn on logging from within RA, but that starts the logging process after the content is loaded and will (I assume) miss potentially important information. For what it's worth, here's the sole entry to the log file after launching RA content in LB and saving a content directory remap: [INFO] [Remap]: File saved successfully: "D:\LaunchBox\Emulators\RetroArch\config\remaps\Genesis Plus GX\\Temp.rmp". And here's the corresponding entry to the log after starting RA directly and turning on logging before loading any content (this is a single line of a much longer log): [INFO] [Remap]: File saved successfully: "D:\LaunchBox\Emulators\RetroArch\config\remaps\Genesis Plus GX\\Sega Genesis.rmp". But clearly there's more information to be gained if I could get the full log when loading through LB. So @Headrush69 and @dragon57, would you mind giving me a step-by-step on how you would go about turning on RA debugging from within LB, including the logging levels you'd use (if applicable)? Thank you!
×
×
  • Create New...