Jump to content
LaunchBox Community Forums

Launching steam games from bigbox immediately returns to bigbox


Recommended Posts

I'm developing a per-game AHK script launcher in my plugin. As far as I know lb doesn't have this?

It works by running a game script on launch and then stops it on return to BB (i.e. the lb game exiting event fires)

The issue is this game exit event fires immediately after starting the game. Thus stopping the AHK script. Any ideas what's going on here?? It works fine with other emulators.

Link to comment
Share on other sites

2 hours ago, stigzler said:

The issue is this game exit event fires immediately after starting the game. Thus stopping the AHK script. Any ideas what's going on here?? It works fine with other emulators.

[Most] other emulators are "launchers" themselves.

When you start Steam using the Steam game ID, it Launches Steam.  Steam then launches the game in a different instance of Steam.  The 1st instance then closes while the game continues on the 2nd instance.

LaunchBox started that 1st instance, then sees that it's closed.  Indicating that "the game has exited".  Teknoparrot does the same thing.

 

The work around I use (only because I wanted to see "Thanks for Playing" when I exited the game) is to create a new "emulator".

This assumes the games' Application Path is what LaunchBox put in there by default.  (As opposed to manually [not recommended] changing to the games exe)

image.png.639ba9d3f2dd9384d8294f2ae188c483.png

 

Here's the script I use:

 

You'll probably need to add a parameter to the AHK script that you launch at OnBeforeGameLaunching() or OnAfterGameLaunched(), which ever one you use to start it.  Then send the IGame.ApplicationPath as the parameter.  

Then add the while loops into your script(s).

Unless you make use of (something like) the linked script as an "emulator" for Steam, OnGameExited() is still going to fire pretty much right away.

 

...Or do some sort of variation/combination of the above. 

Link to comment
Share on other sites

Thanks Joe. Will take a proper look at this tonight. Funnily enough, Sine Mora was the game that highlighted this for me, but helpfully as will need to get game launch/exit working for steam for other functions of my plugin (marquee layouts etc)

Never straightforward this gig, is it?

Link to comment
Share on other sites

From that script, Joe, I'd guess you're no stranger to pushing the envelope of any system you find yourself working in 🤣

I'd have never thought about monitoring the registry for Steam state changes! Genius. (and thanks as ever, Gabe, for making steam the kid in the playground who refuses to play with anyone else coz he thinks he's the mutts nuts)

Link to comment
Share on other sites

35 minutes ago, stigzler said:

From that script, Joe, I'd guess you're no stranger to pushing the envelope of any system you find yourself working in 🤣

I'd have never thought about monitoring the registry for Steam state changes! Genius.

Thanks!

Pushing the envelope?  Nah.  Just makin' it work using all available means. 😎

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