Jump to content
LaunchBox Community Forums

REQUEST - Show controller mappings before launching game?


Recommended Posts

Posted

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
Posted

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

Posted

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
Posted

@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
Posted

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
Posted

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.

Posted

@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
}

Posted

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
Posted

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
Posted (edited)

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
Posted (edited)

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
Posted

@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
Posted

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.

Posted (edited)

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

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...