Jump to content
LaunchBox Community Forums

Launching Steam Game and Launchbox thinks it's closed before it's even opened?


vaderag

Recommended Posts

I'm trying to set up a steam game (Back to Bed) which I'm having some odd issues with
I need to run an AHK script to remap some keys at launch so I have that file in the run before, and an exit AHK in the run after.

Basically, it gives me the exit screen and runs my post-game file before the game is even open.
From what I can tell during launch the game quits itself and re-opens itself for some reason

I also use LED Blinky and while the preview works it never kicks in during the game (presumably due to the above)
I've tried messing with some of the startup settings, but nothing seems to affect how it works, nor does changing the steam launch to the exe itself

Can anyone give me some additional troubleshooting steps? Or is it just destined not to work

 

EDIT: Just tried a different steam game (Bit Trip Runner) and same issue... works with some steam games tho (Arcade Moonlander)

Edited by vaderag
Link to comment
Share on other sites

Steam games don't really play well with the Before/After functionality because the process we start isn't the true game process, it's that stupid "Launching Game..." popup Steam displays. Because of this the before/after logic fires before and after THAT window closes which isn't at all what you want.

Link to comment
Share on other sites

Not really sure what to say about the game(s) that launch using "steam:..." where Run Before AND the Run After both do work.  I wonder if you rebooted your computer and tried these games again, if it (Run After) will still work?

The ones where you tried the exe directly and run after doesn't work, those few might have a similar 'launcher' affect.

 

2 hours ago, vaderag said:

is it just destined not to work

That all depends on how determined and creative you're feeling. ;) 

 

  • Haha 1
Link to comment
Share on other sites

8 minutes ago, JoeViking245 said:

Not really sure what to say about the game(s) that launch using "steam:..." where Run Before AND the Run After both do work.  I wonder if you rebooted your computer and tried these games again, if it (Run After) will still work?

The ones where you tried the exe directly and run after doesn't work, those few might have a similar 'launcher' affect.

 

That all depends on how determined and creative you're feeling. ;) 

 

Sounds like exactly the same issue as I have... Will investigate deeper when I get back to the machine tomorrow

Btw, I have never got the post launch script to work with steam, but I have got t LEDblinky to work. On these troublesome games they flash (sometimes inpercievably) and then revert to my frontend LEDs

It's exactly the same issue as in the other thread...

Not sure how to solve for LED Blinky even though eventually I can likely will solve for ahk

What I really need is a way for LB to wait before it tries to detect the game running 

Link to comment
Share on other sites

So... a little troubleshooting...

- It seems that if Steam is NOT open (in taskbar) then LEDBlinky works as expected... if Steam IS open, then it fails... not a clue why

I have managed to create a workaround... so far works from Launchbox and timings are okay, no idea if this will still be okay once I start using Bigbox or not, but nevertheless

In case anyone is looking I have created two AHK scrips - one with the key remapping and one with the functions to handle the various needed actions - I'm sure this might be doable as one file but I couldn't find a way to have them both. Note, they both run before launch

BackToBed.ahk:

1::f
a::Space
c:: send, {Wheelup 6} 
d:: send, {WheelDown 6}
s::f 

 

BackToBedExit.ahk:

WinWait, ahk_exe backtobed.exe   											; wait for the exe to load
Sleep 5000    				     											; wait 5 seconds to allo for the random re-opening
Run, C:\Users\Arcade\LaunchBox\LEDBlinky\LEDBlinky.exe BACK_TO_BED WINDOWS  ; Run LEDBlinky with the correct ROM
WinWaitClose, ahk_exe backtobed.exe											; Wait for game to close
; MsgBox Closed Back to Bed													; here for testing - ignore
Run, C:\Users\Arcade\LaunchBox\LEDBlinky\LEDBlinky.exe 4					; Tell LED Blinky game has closed
Process, Close, AutoHotKey.exe												; Kill all AHK processes to ensure keychanges revert
ExitApp

 

  • Like 1
Link to comment
Share on other sites

20 minutes ago, vaderag said:

I'm sure this might be doable as one file but I couldn't find a way to have them both

Nicely done.  And it shouldn't be any different when running in BB.

;One file, set to Run Before
WinWait, ahk_exe backtobed.exe                                              ; wait for the exe to load
Sleep 5000                                                                  ; wait 5 seconds to allow for the random re-opening
Run, C:\Users\Arcade\LaunchBox\LEDBlinky\LEDBlinky.exe BACK_TO_BED WINDOWS  ; Run LEDBlinky with the correct ROM
WinWaitClose, ahk_exe backtobed.exe                                         ; Wait for game to close
Run, C:\Users\Arcade\LaunchBox\LEDBlinky\LEDBlinky.exe 4                    ; Tell LED Blinky game has closed
ExitApp

1::f
a::Space
c::Send, {Wheelup 6}
d::Send, {WheelDown 6}
s::f

 

  • Like 1
Link to comment
Share on other sites

32 minutes ago, JoeViking245 said:

Nicely done.  And it shouldn't be any different when running in BB.

;One file, set to Run Before
WinWait, ahk_exe backtobed.exe                                              ; wait for the exe to load
Sleep 5000                                                                  ; wait 5 seconds to allow for the random re-opening
Run, C:\Users\Arcade\LaunchBox\LEDBlinky\LEDBlinky.exe BACK_TO_BED WINDOWS  ; Run LEDBlinky with the correct ROM
WinWaitClose, ahk_exe backtobed.exe                                         ; Wait for game to close
Run, C:\Users\Arcade\LaunchBox\LEDBlinky\LEDBlinky.exe 4                    ; Tell LED Blinky game has closed
ExitApp

1::f
a::Space
c::Send, {Wheelup 6}
d::Send, {WheelDown 6}
s::f

 

Just tried this but it doesn't seem to work - presumably because it never gets to the bit below ExitApp?

Link to comment
Share on other sites

24 minutes ago, vaderag said:

Just tried this but it doesn't seem to work

Sure it does. :D

The top half is the Auto Execution Section and the bottom half are the HotKeys.

As soon as you start the script, the hotkeys are all active, while the top half executes in-order.  (At least it does when I changed your game and LEDBlinky to notepad and wordpad. ;))

Does the auto execution section seem to be working properly when you run the game with the single script?  It's just when, in-game, pressing "1" doesn't "press F"?  If instead, you press "f" directly, does that work (like it's supposed to)?  I presume 1, a, c, d, s are all used for the game (vs some LEDBlinky function)?  I've never used LED-B, so I have no idea how all it works.

Maybe put the test MsgBox back in (for testing/troubleshooting).  Also test with exaggerating the Sleep timer (10 seconds?).  Coul also try adding another WinWait, ahk_exe backtobed.exe after the Sleep timer.?.?.

But it 'should' work as one script.

 

....or just stick with the 2 scripts.  😊

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