Jump to content
LaunchBox Community Forums

Steam Pinball FX3 Cabinet Mode won't quick exit


tmreith

Recommended Posts

Hello - I have searched the forums for days and I can't seem to find a real solution for Launchbox/Bigbox and Pinball FX3 via Steam.

PROBLEM:

Within Bigbox/Launchbox, ESCAPE key ignores the AutoHotKey script to send [ALT][F4] to exit.  Pinball FX3 goes to PAUSE screen within FX3 and you must navigate to exit out of FX3 application.

Without Bigbox/Launchbox, running the AutoHotKey script below prior to command line launch of FX3

Esc::
Send, !{F4}
return

-OR-

Esc::
Send, {Alt down}
Sleep 50
Send, {F4 down}
Sleep 50
Send, {Alt up}
Sleep 50
Send, {F4 up}
return

 

Below is the command line that I use to launch FX3 with Fish Tales table

C:\Steam\Steam.exe -applaunch 442120 -class -table_WMS_Fish_Tales

Pressing ESCAPE key properly executes the AHK logic (ALT F4) and Pinball FX3 immediately exits back to desktop.

Something is going on in Launchbox/Bigbox that is changing the behavior of how AHK and FX3 are playing together.

LAUNCHBOX Setup:

STEAM/Pinball FX3 is configured for CABINET MODE with Zen activation code.

Emulator settings for Pinball FX3:

  • Set the Emulator Application Path to wherever your "Steam.exe" is.  Do not point to "Pinball FX3.exe" (STEAM errors will occur)
  • For Default Command-Line Parameters add "-applaunch 442120 -table_"
  • Or for FX3 Classic Table add "-applaunch 442120 -class -table_" - NOTE the "-class" before table
  • Select Don't use quotes
  • Select No space before ROM
  • Select Use file name only without file extension
  • See below Sample Command shows up as "Steam.exe -applaunch 442120 -table_File"

EMULATORS.thumb.PNG.6936faf78b7132164c1bd9102fab05b7.PNGFX3_DETAILS.thumb.PNG.7b9148a5ae0e42e9028e2d29eecca280.PNGTables properly load seamlessly within Bigbox and Launchbox - No problems

Now to Exit:

FX3_RUN_AHK.thumb.PNG.94c020ce975f848328ec559b0c2a17e3.PNGFX3_EXIT_AHK.thumb.PNG.3653b37a708cc47e408428387ca5f2f6.PNG

 

 

Edited by tmreith
Link to comment
Share on other sites

SOLVED

Required AutoHotKey executable script to launch FX3 to see ESC key to exit.  I placed the FX3_Launcher_Classic.exe in the Stem root directory.

Below is the AHK script.  This needs to be compiled on your system - RIGHT click and select Compile Script to create EXE.  I had to install AutoHotKey on my system to compile script.

https://www.autohotkey.com/

 

;FX3_Launcher_Classic.EXE SCRIPT - Pinball FX3
;Use ESC from keyboard to exit FX3.

#SingleInstance, Force 
Run, "e:\steam\Steam.exe" -applaunch 442120 -class -table_"%1%"
#IfWinActive ahk_exe Pinball FX3.exe 
SendMode, Input 
$Esc::
	Process, Close, Pinball FX3.exe
	ExitApp
return

$vk07::
	Process, Close, Pinball FX3.exe
	ExitApp
return

Emulator settings for Pinball FX3:

  • Set the Emulator Application Path to wherever your "FX3_Launcher_Classic.exe" is.
  • For Default Command-Line Parameters NONE
  • Or for FX3 Classic Table add "-applaunch 442120 -class -table_" - NOTE the "-class" before table
  • Select Don't use quotes
  • Select No space before ROM
  • Select Use file name only without file extension
  • See below Sample Command shows up as "FX3_Launcher_Classic.exe File"

FX3_LAUNCHER_DETAILS.thumb.PNG.e0ccb958701ed522c99a6be81eb33b22.PNG

I removed AHK script data in the LB Running and Exit Tabs, since the launcher scipt now handles the key grabs.

 

Link to comment
Share on other sites

@tmreith  Very well done!!!  Thanks!  Added to my cab and all is good! :D

I do have to make one suggestion.  Though very effective, Process, Close is not recommended for closing emulators.  The "nice" way to do it is to use WinClose. 

$Esc::
   WinClose, ahk_exe Pinball FX3.exe
   ExitApp
return

For lack of a better analogy, it's like giving it a strong sedative before pulling the plug rather than just shooting it between the eyes. :)  (Ya, OK.. Been watching too many crime dramas. lol)

Link to comment
Share on other sites

@JoeViking245 Thanks for the suggestion.  Agree with the preference of WinClose over Process.

NOTE: The shot to the head between the eyes was intentional - due to the frustration levels to get FX3 to work within LB/BB. ☠️

Since FX3 cabinet mode supports [ALT][F4] to exit, I gave the following a go and it works too!  Maybe this is the best way out??

;FX3_Launcher_Classic.EXE SCRIPT - Pinball FX3
;Use ESC from keyboard or XBOX Guide Button to exit FX3

#SingleInstance, Force 
Run, "c:\steam\Steam.exe" -applaunch 442120 -class -table_"%1%"
#IfWinActive ahk_exe Pinball FX3.exe 
SendMode, Input 
$Esc::
  Send, !{F4}
  ExitApp
return

$vk07::
  Send, !{F4}
  ExitApp
return

 

Link to comment
Share on other sites

2 hours ago, tmreith said:

due to the frustration levels

I totally get it! lol

Alt+F4 is just as "nice" as WinClose is.  (Difference being some technical jargon about WM_CLOSE vs WM_SYSCOMMAND-SC_CLOSE. More than I really care to learn about! lol)   And since there's #IfWinActive, there shouldn't be any mishaps if focus is lost (which shouldn't happen beyond the cat on the keyboard or the kids on the cab :D).

Link to comment
Share on other sites

Interesting. My setup works fine with this code in the Running Autohotkey Script tab for FX3.  I used to use an AHK launcher exe but dispensed with that to try to keep things simple (or at least simpler). 

; Use normal ALT f4 in windows to close. ESC takes back in menu. 
Esc::
Send, !{F4}
return

Captur3e.thumb.PNG.78781806452e2e7d899768af4c224bbf.PNGCapture.thumb.PNG.56f4eaa9c506e4de1369ef3e561860c1.PNGAlso my game controller mapping in LB in Options for exiting works as well, so removed any AHK code I used to have for the Xbox One Guide button. 

Edited by sundogak
note about controller
Link to comment
Share on other sites

@sundogak the only difference in our settings appears to be that you have checked Attempt to hide console window on startup/shutdown and that your Steam/FX3 install is in the default location. (my install is at the root E: drive)

For some reason on my cabinet FX3 ignores what ever I put in the Running AutoHotKeyScript.   FX3 immediately goes to the FX3 pause screen and I  have to navigate through the menus to exit.  If I use my keyboard and press ALT F4, FX3 will exit.  Although if ESC is pressed, the LB/BB Run AHK does not intercept.

I also have ReDream on my cabinet, which uses ALT F4 to exit.  ReDream works well with LB/BB with the same Running AutoHotKeyScript.

I prefer a more streamlined solution without having to use a launch script.  Is there anything else that may be different???  I am willing to find the root cause and ideal solution.

Link to comment
Share on other sites

My FX3 seemed to ignore the running AHK script as well.  I tried it with $Esc and also just plain Esc.  Tried using Pinball FX3 as the executable (which just creates a popup from Steam saying something like "this is weird, you sure you want to run with this command line?".  Threw in some If WinActive type things too...  All of which still put it into 'Pause' when pressing Escape.

Another test I did try was having a script 'Esc...Send...ExitApp... in the Additional App - Run before (on a single game) and that did work to close FX3. (AHK full install required [or a compiled script])

In an old post here on the forums there was talk about different (eh hem..) versions/copies of the FX3 executable and also setting autohotkey.exe to run as administrator.  My executable is straight from Steam with my one free game.

I just now tried again setting it up the proper way as @sundogak shows [and had previously attempted].  1st attempt, no joy.  2nd attempt, I set the AutoHotkey.exe under ../ThirdParty/...... to run as admin and got an error saying the game needed to ran elevated.  3rd attempt, unchecked Run As Admin from test 2, loaded the game, pressed Escape and it closed the game.       ???????????????????????????????????   

Yes.  It is working like it's supposed to now.  Steam.exe as the executable and 3-lines in the Running AutoHotkey Script tab.  I have no idea if it was from setting/un-setting run-as-admin or what??????  Maybe it just needed a little of that sundogak Mo Jo. lol  Not gonna question.  Not gonna complain.:D

 

Link to comment
Share on other sites

@tmreith The attempt to hide console option really shouldn't have any impact either way on the AHK side, so doubt that is the difference.  But I have found the AHK code in the Running Autohotkey script tab can be "weird" sometimes in what works and doesn't versus an external code exe. Before the LB improvement in the Game Controller Mappings and adding in Pause feature I had very similar setup to you. However, once LB added in improved Game Controller Mapping and the Pause Menu feature I have had less issues with controller exit commands versus AHK.

Anyway, have you tried deleting the Guide portion and just mapping the exit to Button 11 within LB?  Then just using only the ESC AHK script portion?  I would try completely erasing everything in the AHK tab (select all) and closing then adding in text from say notepad. I suspect there may be times where an errant space/character in the tab is causing issues with LB, but just a theory.  Other than that, I am not much help since "should" work and I don't see anything obvious on why it wouldn't in your setup.  So may be one of those "stick with what works" if the AHK exe is working for you. 

 

Capture.thumb.PNG.f60c4e8dde65b9217bc996de8d798937.PNG

Link to comment
Share on other sites

@sundogak and @JoeViking245 thanks for the discussion.  It is helpful to understand LB/BB more in detail.  I am running the latest version of LB/BB.  I'll take a look at my mappings.  Maybe something has changed from a previous upgrade.

My primary control is a Ultimarc I-PAC2 tied to respective HAPP arcade controls.  I navigate LB/BB with the arcade controls.  I only use my Xbox controller for console games.  Pinball and Mame are through the arcade controls.

For now.....I am going to stick with what works for now.

mame_frontcontrols.thumb.jpg.da721b6ecaf326e0cd682d2761ddf5ac.jpg

  • Game On 1
Link to comment
Share on other sites

@tmreith Yup!  If it ain't broke, don't "fix it". :)  Your cab layout looks similar to mine except for the 3rd joy and you have a lot more buttons (8 vs 6 per player and more across the top).  Looks very nice!!  Are the 3 above the trackball setup as mouse buttons?  Also, is that a dial I see on there too?  Man! You got all sorts of goodies available there. Dang, mine looks so 'ordinary' now. lol  Nice cab!!!

165352387_MDControllerstop(Small)(1).thumb.jpeg.37999bdd3929ee4f2055bf355f2c5286.jpeg

Link to comment
Share on other sites

It's a terrible addiction!!!

The 4-way joystick is configured for pac-man, dig-dug, etc with a 4-way restrictor.  The 3 red buttons are in parallel with player 1 (1,2,3 buttons) - ideal for missile command, centipede, donkey kong, etc.  The spinner is to the right for Tempest, Arknoid, driving games, etc.

The top illuminated buttons are player 1/player 2 credit/start and MAME controls yellow=pause, green=enter, blue=tab, and red=esc

Side buttons are for pinball - left/right flippers and left/right magna-save

The coin-door is illuminated and works too - takes tokens

I also setup a power relay that senses the 12vdc from the PC to switch on/off the audio amp, monitor, led lights, and fans.  The switch is a momentary switch that ties to the PC power up pins on the mother board.

 

Below are my Thingiverse designs - feel free to download

 

U-Trak Arcade Trackball LED Illumination

https://www.thingiverse.com/thing:4369759

TRACKBALL_ILLUMINATION_INSTALL.thumb.png.4ae53b1d600058403d276cb12354fc86.png

 

Zippyy Classic Joystick 4 Way Restrictor Plate

https://www.thingiverse.com/thing:3898688

zippyy-classic-joystick-modification.thumb.jpg.45c05dea0d784fa78bc6153256d35df8.jpg

Arcade Power Button Sleeve Adapter
https://www.thingiverse.com/thing:4001913

ARCADE_PWR_01.thumb.png.b39b76fb2a1a54f2f73c369ebb21b7e0.png

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
On 8/23/2020 at 12:30 PM, tmreith said:

SOLVED

Required AutoHotKey executable script to launch FX3 to see ESC key to exit.  I placed the FX3_Launcher_Classic.exe in the Stem root directory.

Below is the AHK script.  This needs to be compiled on your system - RIGHT click and select Compile Script to create EXE.  I had to install AutoHotKey on my system to compile script.

https://www.autohotkey.com/

 

;FX3_Launcher_Classic.EXE SCRIPT - Pinball FX3
;Use ESC from keyboard to exit FX3.

#SingleInstance, Force 
Run, "e:\steam\Steam.exe" -applaunch 442120 -class -table_"%1%"
#IfWinActive ahk_exe Pinball FX3.exe 
SendMode, Input 
$Esc::
	Process, Close, Pinball FX3.exe
	ExitApp
return

$vk07::
	Process, Close, Pinball FX3.exe
	ExitApp
return

Emulator settings for Pinball FX3:

  • Set the Emulator Application Path to wherever your "FX3_Launcher_Classic.exe" is.
  • For Default Command-Line Parameters NONE
  • Or for FX3 Classic Table add "-applaunch 442120 -class -table_" - NOTE the "-class" before table
  • Select Don't use quotes
  • Select No space before ROM
  • Select Use file name only without file extension
  • See below Sample Command shows up as "FX3_Launcher_Classic.exe File"

FX3_LAUNCHER_DETAILS.thumb.PNG.e0ccb958701ed522c99a6be81eb33b22.PNG

I removed AHK script data in the LB Running and Exit Tabs, since the launcher scipt now handles the key grabs.

 

Thank you for this

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