Jump to content
LaunchBox Community Forums

REQUEST - Show controller mappings before launching game?


The IVI

Recommended Posts

Hello, longtime launchbox user, first time poster. I don't know if such a thing has already been implemented, but is it possible to show an image of the controller before launch of any game. I have been working on using .bat files to automate this process but it's been driving me nuts. If I use .bat files in place of the emulator, then AHK will target the .bat file instead of the emulator. I have included some of my controller layouts that I plan on using with my DS4. Before anybody asks, yes I do know about Additional Applications, but there is no bulk edit for Additional Apps, and I'm not going through 9000+ games. 

GameBoy Advance Setup.png

GameCube Setup.png

Nintendo Entertainment System Setup.png

Super Nintendo Setup.png

  • Like 2
Link to comment
Share on other sites

You can assign a controller button to an AHK script which goes into window mode, displays your image, waits for mouse click and then reverts to fullscreen.

I use a script like this to display a MessageBox with the most common keyboard shortcuts when i run Amiga games with WinUAE.

 

 

  • Like 3
Link to comment
Share on other sites

Part of the script looks like this:

;Display Help Info
4joy16::
WinUAE("EVT SPC_TOGGLEFULLSCREEN 1")
MsgBox,,INFO,END+(1 to 0): insert disks 1-10 from swapper [SHIFT+END+(1 to 0) for disks 11-20]`nCTRL+F12: Fullscreen/Windowed`nEND+PRTSCR: Screenshot`nF12: Settings`nPAUSE: Pause`nALT+F4: Quit`nPAUSE+END: Wrap`nEND+(F1 to F4): Swap disk in DFO to DF3
WinUAE("EVT SPC_TOGGLEFULLSCREEN 1")

return

Line 1 comment

Line 2 maps the script to button 16 - controller 4

Line 3 sends command to WinUAE to toggle to window mode - in most emulators you just have to Send ALT+Enter instead

Line 4 displays a MessageBox with useful info. You could open your image here instead of displaying the MsgBox

Line 5 reverts WinUAE to fullscreen

 

  • Like 1
Link to comment
Share on other sites

@Crush Hey, that's very helpful, but I've been trying to load the image before the game loads. Which I have been successful on using .bat files like this:

 

@ECHO OFF

TITLE Launching FCEUX...

ECHO Showing Controller Layout...
START /wait "" "E:\Launchbox\Images\Controllers\PS4\Nintendo Entertainment System.png"
ECHO Exiting Controller Layout
ECHO Launching FCEUX...
START "" "E:\Emulators\NESU\fceux.exe" %1
PAUSE

 

But then I come to AHK and it's a nightmare, the emulator just starts freaking out whenever I run it, can you please tell me what I'm doing wrong?

 

Joy1::
{
        IfWinExist, "ahk_exe i_view32.exe"
            WinClose, "ahk_exe i_view32.exe"
            return
}

; This section closes FCEUX when pressing Escape
Esc::
{
        WinClose, "ahk_exe fceux.exe"
        WinClose, "Launching FCEUX..."
        return
}

Link to comment
Share on other sites

First of all you can go to FCEUX, Config -> Map Hotkeys and change the keys (for example you can set ESC to exit the emulator).

The AHK script to exit the emu is simple:

; Exit
4Joy17::
   SetKeyDelay, -1, 110
   Send {ESC}
Return

You have to change the 4Joy17 (which means forth joystick, button 17) to your own joystick (for example 1Joy5, meaning that when you press the button number 5 on your Joystick 1 the script will send ESC to FCEUX)

To figure out the number of joysticks and buttons use this online tool: http://html5gamepad.com/

Keep in mind that the button numbers reported by the tool may be actually off by one, for example button 2 might actually be button 1 - you have to experiment a little here.

 

  • Like 1
Link to comment
Share on other sites

I think these work very well with RocketLauncher and Hyper pause controller menu. I'm hoping all console systems get covered but would really like to see some more obscure systems like Philips CDi, Magnavox Odyssey, 3DO and Nintendo Disk System.

20170318194636.jpg

Edited by oilertitanfan
  • Like 2
Link to comment
Share on other sites

HI IVI, if you're still looking to bulk add additional apps. try this powershell script, you'll need to edit it to suit your needs... its not fantastic but kind of does the job you want. I think this specific one adds joytokey. all you will need to do is paste the entire contents of the output file into a copied version of the xml database file:

I ended up using this code to run nomousey for each game on demul. Ive not used it lately though and I'm not sure if its gonna work with the current version of launchbox. So use it as more of a guide and I guess knowledge that id can or could be done.

 

WARNING, this could mess up your xml file completely and lauchbox could refuse to start. so, backup the xml first so that you can replace your edited xml if it screws up lauchbox.

you should paste the output at the bottom of the platform xml file just before </Launchbox>

 

$filein = read-host -Prompt 'enter the full path of the input xml file'
if (test-path -Path $filein -pathtype leaf) {
$fileout= read-host -Prompt 'enter the full path of the output file'
$input = Get-Content $filein
$array = @()
$input |ForEach-Object {
$writeobj = $false
$obj = New-Object System.Object
if ($_ -match '<ID>') {
$ID = ($_ -split '<ID>' -split '</ID')[1]
echo "<AdditionalApplication>"|out-file -append $fileout
echo  "<GameID>$ID</GameID>"|out-file -append $fileout
echo "<ApplicationPath>..\JoyToKey\BatchFiles\Joy_to_key_Dreamcast.bat</ApplicationPath>"|out-file -append $fileout
echo "<AutoRunAfter>false</AutoRunAfter>"|out-file -append $fileout
echo "<AutoRunBefore>true</AutoRunBefore>"|out-file -append $fileout
echo "<CommandLine />"|out-file -append $fileout
echo "<Name>JoyToKey</Name>"|out-file -append $fileout
echo "<UseDosBox>false</UseDosBox>"|out-file -append $fileout
echo "<UseEmulator>false</UseEmulator>"|out-file -append $fileout
echo "<WaitForExit>false</WaitForExit>"|out-file -append $fileout
echo "</AdditionalApplication>"|out-file -append $fileout
echo "<AdditionalApplication>"|out-file -append $fileout
echo "<GameID>$ID</GameID>"|out-file -append $fileout
echo "<ApplicationPath>..\JoyToKey\BatchFiles\JoyToKeyKill.bat</ApplicationPath>"|out-file -append $fileout
echo "<AutoRunAfter>true</AutoRunAfter>"|out-file -append $fileout
echo "<AutoRunBefore>false</AutoRunBefore>"|out-file -append $fileout
echo "<CommandLine />"|out-file -append $fileout
echo "<Name>Kill_JoyToKey</Name>"|out-file -append $fileout
echo "<UseDosBox>false</UseDosBox>"|out-file -append $fileout
echo "<UseEmulator>false</UseEmulator>"|out-file -append $fileout
echo "<WaitForExit>false</WaitForExit>"|out-file -append $fileout
echo "</AdditionalApplication>"|out-file -append $fileout
}
}
 }
 if (-NOT (test-path -Path $filein -PathType leaf)) {
 write-host "the File"$filein" Does Not Exist, Please Try Again"
 }
Edited by slimskinny
added more information
Link to comment
Share on other sites

@oilertitanfan That's exactly what we need in Launchbox, instead of pressing a button to go back straight into BigBox or Launchbox, it just displays an overlay over the game that provides information and detail about the game your playing.

@slimskinny I haven't had the chance to go through that script, but I will later on this afternoon.

@dragon57 I am currently working on Xbox One controller maps.

  • Like 1
Link to comment
Share on other sites

I created a Request here:

https://bitbucket.org/jasondavidcarr/launchbox/issues/2744/right-click-custom-menu-on-platforms

for the addition of custom right-click menu on Platforms. That way we could display controller images, extra info on the platform, run JoytoKey or other utilities before launching a game, or an AHK script related to this Platform.

 

Please vote if you are interested in this feature.

 

  • Like 1
Link to comment
Share on other sites

I was thinking of writing a 3rd party application, if I ever get time.  My thought for my setup was to have launchbox call this application with an argument of the game you try to launch. The application will show your control mappings, per game or console.  For me, I have a lot of per game configurations for my arcade control panel that make the games more enjoyable because the buttons flow better. The setup part of this application would be the pain point though.  Ideally, it would get the emulator and game info from launchbox, then look to that emulator for any custom configs for that game.  If none exist show the default mappings.  It would show this on screen for a designated amount of time selected by user and/or until a key is pressed.  Then Launchbox would launch the game.

I still need to do more research into what it would take to do it.  It's pretty easy if you take out the automation of finding the game and emulator and pulling the mapping info but that would be to much setup work on the user in my opinion.

Edited by zerohex
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...