stigzler Posted Monday at 08:55 AM Share Posted Monday at 08:55 AM 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. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted Monday at 12:39 PM Share Posted Monday at 12:39 PM 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) 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. Quote Link to comment Share on other sites More sharing options...
stigzler Posted Monday at 01:05 PM Author Share Posted Monday at 01:05 PM 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? Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted Monday at 04:27 PM Share Posted Monday at 04:27 PM 3 hours ago, stigzler said: Never straightforward this gig, is it? Depends on your demands. Quote Link to comment Share on other sites More sharing options...
stigzler Posted Monday at 05:32 PM Author Share Posted Monday at 05:32 PM 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) Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted Monday at 06:21 PM Share Posted Monday at 06:21 PM 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. 😎 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.