Author Topic: Games With Interstitial Screens/Pop-Ups  (Read 4364 times)

YellowBirdAZ

  • Full Member
  • ***
  • Posts: 80
    • View Profile
Games With Interstitial Screens/Pop-Ups
« on: October 16, 2017, 07:03:05 AM »
So I have ONE game that is giving me this problem, but still I'd like to fix it. And others might have the same problem with other games that behave the same way.

I have the PC game Slain on my cabinet. Like many PC games, when you launch the executable it displays a configuration pop-up where you can select windowed/fullscreen and resolution. Basically you just click OK and move on to the game. There is, as far as I can tell, no way to side-step this interstitial.

I wrote an Autohotkey script to deal with the interstitial, so when you launch the same from AM the script runs, acknowledges the pop-up, and the game starts.

The only hang-up is AM thinks the game is closing at some point in this process. So the game launches, the pop-up is dealt with, and Slain runs... but AM comes back to life in the background. It is as though AM thinks you launched the game and quickly exited it, when in fact the game is running.

I don't think this is caused by the script EXIT command either. I have all sorts of scripts that exit and they don't bring AM back out of sleep mode.

There are three ways I can think of that could address this issue, and I'd appreciate any advice on how to make any of them work.

1. If I knew what triggers AM to wake up after going to sleep in the background, maybe I could intercept that trigger in this case? That way AM would keep sleeping until the player really exits the game.

2. I could kill AM in this case, run the game, and then relaunch AM upon exit. The only problem is I don't know how to prevent it from doing the whole intro all over again. If I could skip the intro, I assume it would just return to the last game played (which would be perfect).

3. I could add a step to force AM back into sleep mode during the game's start-up process, if there is a means to do so.

Thanks!

keilmillerjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1167
    • View Profile
Re: Games With Interstitial Screens/Pop-Ups
« Reply #1 on: October 16, 2017, 07:31:55 AM »
I am not sure. Maybe attract keeps track of the process pid? You could try launching a compiled ahk script that is a hidden process and launches your game, and exits when your actual game window closes? Just an idea of something to try.

YellowBirdAZ

  • Full Member
  • ***
  • Posts: 80
    • View Profile
Re: Games With Interstitial Screens/Pop-Ups
« Reply #2 on: October 16, 2017, 08:01:35 AM »
Good suggestion, I will give that a shot tonight. Thanks!

AHK has definitely been a lifesaver.

qqplayer

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
Re: Games With Interstitial Screens/Pop-Ups
« Reply #3 on: October 16, 2017, 08:28:42 AM »
A quick fix for me was adding this line to the emulator.cfg

Code: [Select]
minimum_run_time     10
Maybe you have to incease to 20, 30...

YellowBirdAZ

  • Full Member
  • ***
  • Posts: 80
    • View Profile
Re: Games With Interstitial Screens/Pop-Ups
« Reply #4 on: October 16, 2017, 08:49:08 AM »
That's clever too. I'd seen that setting but didn't make the connection.

Thanks guys!

I will report on results.

YellowBirdAZ

  • Full Member
  • ***
  • Posts: 80
    • View Profile
Re: Games With Interstitial Screens/Pop-Ups
« Reply #5 on: October 17, 2017, 06:50:50 AM »
Turns out it was just a case where I was too tired to see the obvious.

Basically, all of the non-emulated games are launched with AHK scripts. I do this because I am using a CRT, and I want to run them in their "native" resolutions, so I include commands to change the screen resolution before the game launches, and to change it back before returning to AM.

(I could use batch files or Perl or anything else I suppose, but AHK is handy because I can also include key re-mapping when I need to customize the controls.)

So all of these scripts basically follow this recipe...

- Load the correct IPAC or VJoy profile
- Set the correct resolution
- Run the game (with the RunWait command)
- Reset the IPAC profile to default (or turn off VJoy)
- Reset the resolution to default (in my case, 320x240)

I use RunWait to run the game so that the last two steps don't happen until you actually close out of the game.

What happened with my Slain script was that I didn't use RunWait when I launched the game. (I think I thought I couldn't because the interstitial.)

It is worth nothing though... to get around the interstitial problem I had to spawn a second AHK script from the first one. The first one pretty much follows the recipe above, but adds a step just before the game launch where it runs the secondary script (literally Run, not RunWait). The secondary script just waits for the Slain configuration pop-up to appear (using WinWaitActive), and when it does it sends a left mouse click to the "Play!" button and then exits.

When I tried doing all this in a single script it didn't work. It hangs on the pop-up.

Anyhow, it works now, and maybe someone who runs into this issue later will find this helpful.





« Last Edit: October 17, 2017, 06:53:56 AM by YellowBirdAZ »