Jump to content
LaunchBox Community Forums

Help with Ultimarc 360 Script


latin625

Recommended Posts

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%

 

Link to comment
Share on other sites

8 hours ago, latin625 said:

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

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.

  • Unusual Gem 1
Link to comment
Share on other sites

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%

 

Edited by latin625
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...