Jump to content
LaunchBox Community Forums
The IVI

REQUEST - Show controller mappings before launching game?

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 1

Share this post


Link to post
Share on other sites

I'm still currently in the middle of making all of the images, but here's a couple more. I don't know if anyone would want the psd file of it, so they could create their own controller maps.

3DS Setup.png

DS Setup.png

GameBoy Color Setup.png

GameBoy Setup.png

Share this post


Link to post
Share on other sites

Wow I didn't know you were making these but they look awesome and I'm sure I will find a use for them. I would like the psd file but if you create any more please share them here!

Share this post


Link to post
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 2

Share this post


Link to post
Share on other sites

@Crush could you possibly show the code that you use for AHK, I always have a hard time dealing with it.

 

Also, I have been working on X360 controller layouts, because a lot of people will probably prefer to use those over the DS4 ones I have made for myself.

GameBoy Advance Setup (X360).png

GameBoy Color Setup (X360).png

GameBoy Setup (X360).png

Nintendo Entertainment System Setup (X360).png

  • Like 2

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Forgive me I'm still learning...   but what does AHK stand for?

 

This is something I've been trying to do too. I was hacking up a theme to bastardize an ugly method.

Share this post


Link to post
Share on other sites

AHK=Auto Hot Key, its a program that lets you use a controller to use keyboard keys, like "escape" can be bound to a controller to exit emulators.

Share this post


Link to post
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
}

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks @Crush for your help, everything's running smoothly now.

Here is the SEGA edition for the controller maps, both PS4 and X360. I might start making XBONE versions, if anyone is interested.

Sega 32X.png

Sega CD.png

Sega Game Gear.png

Sega Genesis 6-Btn Setup Alt.png

Sega Master System.png

Sega Dreamcast.png

Sega 32X (X360).png

Sega CD (X360).png

Sega Game Gear (X360).png

Sega Genesis (X360).png

Sega Master System (X360).png

Sega Dreamcast (X360).png

  • Like 3

Share this post


Link to post
Share on other sites

The best option to display controller info would be the ability to right-click on the platform name and chose a custom menu option...

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I have Xbox One controllers, so I would be interested in versions for those.

Sent from my SM-G900P using Tapatalk

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

This would be a great theme marquee feature...  As a lot of people have arcade and controller controls...  Displaying the controls while playing the system would be an awesome help to keep track of all the buttons for different systems.

Share this post


Link to post
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

Share this post


Link to post
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
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...