Jump to content
LaunchBox Community Forums

latin625

Members
  • Posts

    625
  • Joined

  • Last visited

Posts posted by latin625

  1. Just an Update...  That Shortcut in the script is critical.  It will not work (at least for me) without it.  Make a shortcut to the XArcade Xinput.exe, then add that location to the script.  Stiil very cool to see this working, just had to remember that trick. 

    Also steamapps on your windows drive is where all the games are downloaded to from steam, in case you need to update the location of the game.  GAME ON!

    STEAM CODE UPDATE FOR ME:

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    #SingleInstance, Force
    #Persistent
    
    Run "F:\Tools\xarcade-xinput\XArcade XInput.exe - Shortcut" --skip-ui
    Sleep, 5000
    Run, F:\SteamLibrary\steamapps\common\StreetFighterV\StreetFighterV\Binaries\Win64\StreetFighterV.exe
    Sleep, 1000
    
    SetTimer, ProcessCheckTimer, 2000
    Return
     
    ProcessCheckTimer:
    Process, Exist, StreetFighterV.exe
    pid1 := ErrorLevel
    If (!pid1)
             {
         Process, Close, XArcade XInput.exe
             ExitApp
             }
    Return

     

  2. All credit to isometrixk

     

    I updated my code from another post and now all my Mame games launch the correct recoil (semi vs automatic) type of gun that I want to fire during gameplay. A couple of things:

    1. Every game in LaunchBox must be edited to run these scripts individually. There is no workaround.

    2. When switching gun types, there is a 5 second delay after the previous executables are killed to allow time to fully close

    3. One time, only one of my Sinden guns switched. This makes me think the 5 second delay wasn't long enough.

    Besides that, it works great with LaunchBox with Mame and I'm going to try a few more emulators later.

    Prerequisites

    1. You created separate folders for each of your guns containing the Lightgun.exe. The folder path to your automatic Lightgun.exe setup must contain "auto". It doesn't matter where, it just matters "auto" is in the file path.
      C:\LightGuns\auto\..\Lightgun.exe

    2. Every Lightgun.exe is configured to "Start Application in System Tray" (bottom-right corner of Configuration tab)

    3. Save the two configurations below as Batch (.bat) files - edit each file to CD into your correct Lightgun.exe folder paths, I left my paths as examples. Obviously save them so you remember which is for automatic recoil and semi recoil.

    LaunchBox

    1. Add Additional Apps to run for each game by selecting a game, Edit > Metadata > Additional Apps

    2. Click Add Application

      1. Application Name: Type any name, doesn't matter

      2. Application Path: Browse to the appropriate batch file to run auto or semi recoil

      3. Check "Automatically Run Before Main Application" - runs the batch file before the Mame game executes

      4. Check "Wait for Exit" - waits for the batch file to complete before launching the Mame game

    That's it! Do this for each of your games, there is no easy way around this in LaunchBox.

    Batch Scripts

    Automatic --- IMPORTANT --- notice the "auto" keyword in my filepaths for this!

    @echo off
    
    setlocal enableextensions enabledelayedexpansion
    
    set "process=Lightgun.exe"
    
    for /f "usebackq skip=1 delims=" %%p in (`wmic process where "name='%process%'"
                                              get executablepath 2^>nul`) do (
      if not defined exePath (
        set "exePath=%%p"
      )
    )
    
    if not "%exePath%" == "" (
    
      if not x%exePath:auto=%==x%exePath% (
    	REM do nothing...
      ) ELSE (
    	TASKKILL /F /IM Lightgun.exe
      	TIMEOUT 5 /NOBREAK
    	CD "C:\LightGuns\sindengun1auto\SindenLightgunWindowsSoftwareV1.08\SindenLightgun\"
        	START Lightgun.exe	
        	CD "C:\LightGuns\sindengun2auto\SindenLightgunWindowsSoftwareV1.08\SindenLightgun\"
        	START Lightgun.exe
      )
    )^
    else (
    	CD "C:\LightGuns\sindengun1auto\SindenLightgunWindowsSoftwareV1.08\SindenLightgun\"
    	START Lightgun.exe	
    	CD "C:\LightGuns\sindengun2auto\SindenLightgunWindowsSoftwareV1.08\SindenLightgun\"
    	START Lightgun.exe
    )
    endlocal

    For Semi Auto setup

    @echo off
    
    setlocal enableextensions enabledelayedexpansion
    
    set "process=Lightgun.exe"
    
    for /f "usebackq skip=1 delims=" %%p in (`wmic process where "name='%process%'"
                                              get executablepath 2^>nul`) do (
      if not defined exePath (
        set "exePath=%%p"
      )
    )
    
    if not "%exePath%" == "" (
    
      if not x%exePath:auto=%==x%exePath% (
    	TASKKILL /F /IM Lightgun.exe
      	TIMEOUT 5 /NOBREAK
    	CD "C:\LightGuns\sindengun1\SindenLightgunWindowsSoftwareV1.08\SindenLightgun\"
        	START Lightgun.exe	
        	CD "C:\LightGuns\sindengun2\SindenLightgunWindowsSoftwareV1.08\SindenLightgun\"
        	START Lightgun.exe
      ) ELSE (
    	REM do thing...
      )
    )^
    else (
    	CD "C:\LightGuns\sindengun1\SindenLightgunWindowsSoftwareV1.08\SindenLightgun\"
        	START Lightgun.exe	
        	CD "C:\LightGuns\sindengun2\SindenLightgunWindowsSoftwareV1.08\SindenLightgun\"
        	START Lightgun.exe
    )
    
     

     

  3. @axman21

    You can add an extension to it by renaming it and adding .exe on the end.  It will still run with Teknoparrot alone or the through LB with no problem. Use the same file you use to run it in TP, just add .exe on the end.

  4. @The Hobgoblin

    That is the exe file.

    You can add an extension to it by renaming it and adding .exe on the end.  It will still run with Teknoparrot alone or the through LB with no problem. 

    Quote

    Jenniferpatched.exe

    Copy and pate the Jenniferpatched  if you are worried about it not working.  Save that Jenniferpatched  as a Copy, then rename the original one.

  5. No joy with the suggestion. i might have to live with it being a one player game for now.

    Everything looks right but doesnt work as expected. Ill keep tinkering ans seeing what is what.  Thanks for the help !!!!

    my latest attempt:

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    
    
    
    #SingleInstance Force
    
    l::
    while (getkeystate("l","p"))
    {
      send, {Numpad2 down}
      sleep 100
    }
    send {Numpad2 up}
    
    Return

     

  6. Still nothing.

    Just wont register.

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    
    
    
    
    a::
    while (getkeystate("a","p"))
    {
      send, {Numpad2 down}
      sleep 100
    }
    send {Numpad2 up}
    
    Return

     

  7. No joy.

    Gonna tinker a bit with it.  Cant get the Q key to send numpad2 .  I am running it separate from the other because I am not sure how to add it to the original script you sent me. It sends it on notepad and I see the number 2, but in the game nothing.  I have to press the physical numpad 2 key to give player two gas.

    q::
    while (getkeystate("q","p"))
    {
      send, {2 down}
      sleep 100
    }
    send {2 up}
    
    Return

     

  8. Super Thanks!!!!!!!!

    It worked!  Now I tried to copy and paste the code again to make it work the same way for player 2 using the "2" key on the keypad. This let's player 2 do the same as player one with the gas and boost.

    Do I need to encapsulate the remap?  Didnt work for me when I tried to use player 2.

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    
    
    
    #SingleInstance Force
    
    Space::
    while (getkeystate("space","p"))
    {
      send, {up down}
      sleep 100
    }
    send {up up}
    Return
    
    
    
    q::
    while (getkeystate("q","p"))
    {
      send, {2 down}
      sleep 100
    }
    send {2 2}
    Return

     

  9. Thanks @JoeViking245.

      I tried both and they work, kinda... The pressing (pressing up and down) of the space key send the click, but does not detect just pressing down like you would with the keyboard UP key for gas.

    A double tap of the space or UP key does Turbo boost.  Single tap or press give acceleration / gas only.

    Trying to get the space key to act like the up arrow when pressed down only to give gas, the double tap seems to be 100% good.  Ill keep tinkering and see what I get. 

    I see AHk offers something called  Send longpress

  10. I am trying to get the space key on my xarcade to register as UP arrow on Hot Wheels King of the Road and cant seem to get it going.

    This is my script.  It works!  when I test it on notepad and stuff I get the cursor going up with each space key press.  But when I am playing the game, only the up arrow on the keyboard works and give it gas.

    Any ideas?

    Left, right works too.

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    
    
    
    #SingleInstance Force
    Space::SendInput, {Up}  ; Press 2x for Boost/ just pressing will give Gas

     

  11. Hi,

     I am having to reset the clock time on this game every time I run it.  I set it and I save it but it clears again.  Cant locate the file that sets that up to make it only readable.  Anyone have a solution or knows where these setting files might be?

    I can get to the service menu.  Just doesn't keep the changes.

    Thanks,

  12. Hello, 

    Anyone have experience with reshade?  How do you save the settings for each game?

    Ive tried to do the autosave and presets, but if I exit the game and then change it for say.. a lightgun game and then come back, it is still with the border on the previous game.

    Any one have a solution for this?

    Thanks

  13. JoeVikin@g@245

    2 hours ago, JoeViking245 said:

    This won't work when running as an Additional App because you can't send parameters to them.  (EMU = %1% ROM = %2%)

    To have the parameters sent to the script, you'd need to have it as-the-emulator.**

    In your script "EMU" is always going to be "MAME" since you're only using this for MAME. Correct?  If so, replace that variable.  i.e. (replace the 1st line with the 2nd line)  This assumes your asset folder is called "MAME".

    ;ROM_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\" . EMU . "\" . ROM . ".ugc /showfeedback"
    ROM_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\MAME\" . ROM . ".ugc /showfeedback"

     

    **To set the script up as the emulator, you'd need to add a new emulator in LaunchBox that points to this script. 

    • Give it a name
    • Point the App Path to ..\LaunchBox\ThirdParty\AutoHotkey\AutoHotkey.exe
    • In quotes, set the parameters to point to your .ahk script
      • add a [space] and then %romlocation%
    • Check 2 boxes

    image.thumb.png.6f5807c207214eab6529a18a4bb68dae.png

     

    Then at the bottom of your script, you'd have it launch MAME with the ROM file.  Something (but not necessarily exactly) like this.  (added some beeps when it loads a specific config)

    romlocation = %2%
    ROM = %3%
    
    ;Process UltraStick Profiles
    ROM_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\MAME\" . ROM . ".ugc /showfeedback"
    EMU_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\MAME\MAME.ugc /showfeedback"
    DEF_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\default.ugc /showfeedback"
    
    ULTRAMAP := "D:\LaunchBox\ThirdParty\UltraMap.exe"
    
    ;Load the joystick profile
    if FileExist(ROM_STK_PROF)
    {
       SoundBeep, 750, 500
       RunWait %ULTRAMAP% %ROM_STK_PROF%
    }
    else if FileExist(EMU_STK_PROF)
    {
       SoundBeep, 750, 200
       SoundBeep, 1350, 200
       RunWait %ULTRAMAP% %EMU_STK_PROF%
    }
    else
    {
       SoundBeep, 750, 200
       SoundBeep, 1350, 200
       SoundBeep, 750, 200
       RunWait %ULTRAMAP% %DEF_STK_PROF%
    }
    
    RunWait, "D:\LaunchBox\Emulators\MAME\mame.exe" -keyboardprovider dinput -rompath %romlocation% %ROM%

     

    Not tested, but looks really good 'on paper'. ;)

    Depending on how your MAME is setup and where it's located, you may need to change something on the last line.


    Many thanks! 

    This is awesome and it will help with my 8 way 360 handling 4 way games.  LedBlinky is great, but I am not convinced it was loading my profiles.

    I modified the code to work for me, but I only get the MAME gui when I launch the game and not the game running.  Am i missing something?

    Here is mine below:

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    
    ;This script loads game & emulator specific configurations into
    ;UltraSticks. If a game (ROM) specific profile
    ;exists it will be loaded.  If not, the emulator (EMU) specific profile
    ;will be loaded. If neither a game specific nor emulator specific
    ;profile exists, a default (DEF) profile will be loaded.
    
    ;Parameters are the emulator and ROM name. ROM name is optional.
    ;Emulator names should match the assets folder name.
    
    romlocation = %2%
    ROM = %3%
    
    ;Process UltraStick Profiles
    ROM_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\MAME\" . ROM . ".ugc /showfeedback"
    EMU_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\MAME\MAME.ugc /showfeedback"
    DEF_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\default.ugc /showfeedback"
    
    ULTRAMAP := "D:\LaunchBox\ThirdParty\UltraMap.exe"
    
    ;Load the joystick profile
    if FileExist(ROM_STK_PROF)
    {
       SoundBeep, 750, 500
       RunWait %ULTRAMAP% %ROM_STK_PROF%
    }
    else if FileExist(EMU_STK_PROF)
    {
       SoundBeep, 750, 200
       SoundBeep, 1350, 200
       RunWait %ULTRAMAP% %EMU_STK_PROF%
    }
    else
    {
       SoundBeep, 750, 200
       SoundBeep, 1350, 200
       SoundBeep, 750, 200
       RunWait %ULTRAMAP% %DEF_STK_PROF%
    }
    
    RunWait, "D:\LaunchBox\Emulators\MAME 0.243\mame.exe" -keyboardprovider dinput -rompath %romlocation% %ROM%

     

  14. I am trying to make sure that when a 2 way, 4 way or 8 way game in mame loads, it also loads the .ugc file with it.  If there is none available, it will load a default map.

    Added a soundbeep to know if the file loaded, but I keep getting the 8 way default for everything regardless.  Thanks in advance for the help!!!!!  Maybe this can help out others who may be in need of a script.

    I run this as an application "before main application" on  all the MAME games only.

    My issues:

    1. how can I confirm that Im a loading the right .ugc? I see a "showfeedback" argument, but did it really load the correct file?

    2. How do you get it to load up the 8way on exiting the game so it can be defaulted back to 8 way?

    Here is my hacked up script from what I could find on the net.

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    ; #Warn  ; Enable warnings to assist with detecting common errors.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    
    ;This script loads game & emulator specific configurations into
    ;UltraSticks. If a game (ROM) specific profile
    ;exists it will be loaded.  If not, the emulator (EMU) specific profile
    ;will be loaded. If neither a game specific nor emulator specific
    ;profile exists, a default (DEF) profile will be loaded.
    
    ;Parameters are the emulator and ROM name. ROM name is optional.
    ;Emulator names should match the assets folder name.
    
    EMU = %1% 
    ROM = %2%
    
    ;--------------------------------------------
    ;Process UltraStick Profiles
    ROM_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\" . EMU . "\" . ROM . ".ugc /showfeedback"
    EMU_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\" . EMU . "\" . EMU . ".ugc /showfeedback"
    DEF_STK_PROF := "D:\LaunchBox\ThirdParty\UltraStick\default.ugc /showfeedback"
    
    ULTRAMAP := "D:\LaunchBox\ThirdParty\UltraMap.exe"
    SoundBeep, 750, 500
    ;SoundPlay, %A_WinDir%\Media\ding.wav
    
    ;Load the joystick profile
    if FileExist(ROM_STK_PROF)
       RunWait %ULTRAMAP% %ROM_STK_PROF%
    else if FileExist(EMU_STK_PROF)
       RunWait %ULTRAMAP% %EMU_STK_PROF%
    else
       RunWait %ULTRAMAP% %DEF_STK_PROF%
    

     

×
×
  • Create New...