Jump to content


Photo

Script to close The House of the Dead (PC version) on Mala


  • Please log in to reply
4 replies to this topic

#1 Wade007

Wade007
  • Members
  • 25 posts

Posted 17 July 2012 - 06:37 PM

I'm using an AHK script to launch a PC Game (The House of the Dead) on my cabinet using Mala as a frontend.

After playing the game I can exit out two ways; by pressing "Quit" through the menu system or by presing my combo two buttons AHK keys (2 + 4) at the same time. Both work to exit, but the latter somehow messes up Mala to not look right upon return. the graphics are jumbled.

If I press 'Quit' in the menu, everything jumps back to the Mala frontend screen and menu like it's supposed to. Looks fine, works fine.

If I press 2 + 4, it goes back to Mala but the Mala screen and menu layout is somewhat jumbled up - the background is pushed into and past the lower right hand corner while the game screenshot and one other graphic overlay remain where they are suppose to be. It's like there wasn't a proper switch of resolutions back to my desktop resolution for Mala to get reset on the layout correctly. The menu system still works, but it doesn't look pretty. If I try and launch The House of the Dead again, it just hangs. Nothing happens unless I reboot my system.

Why is this happening with the two button exit only and more importantly, how can if fix it?? Thanks in advance for any help.

See below for my AHK code:


#SingleInstance force
SetWorkingDir, C:\Arcade\PC Arcade Ports\The House of the Dead
Run, C:\Arcade\PC Arcade Ports\The House of the Dead\thotd.exe -d3d

WinWait, The House of the Dead
WinWaitClose, The House of the Dead ; This takes care of closing AHK if I exit the game via the built in menu system
exitAPP

LCtrl::~LButton
LAlt::~RButton
Space::~ENTER
c::~ESC
5::~ESC

a::~LButton
s::~RButton
g::~Enter
]::~ESC
]::~ESC

~2 & ~4::
Process, Close, thotd.exe ; This exit works but messes up the resolution/layout on the Mala frontend and then I can't relaunch the game.
ExitAPP
return

#2 girlgamer

girlgamer
  • Moderators
  • 2039 posts

Posted 17 July 2012 - 07:08 PM

You're slamming the process with a brute force close so the game doesn't exit properly. Think of it like if you pulled the pc's power plug out of the wall. A better method would be to have ahk press the quit button for you and let the game shutdown normally.

#3 Wade007

Wade007
  • Members
  • 25 posts

Posted 18 July 2012 - 12:57 AM

Yes. I agree. Any idea how to do that?...Have it press "Quit" for me?

I'm stumped. :?:

#4 girlgamer

girlgamer
  • Moderators
  • 2039 posts

Posted 18 July 2012 - 01:16 AM

How do you shut down the game normally? EXACTLY, step by step, what do you have to do to exit the game? Write those steps down. That becomes the outline for a script to do the same thing.

#5 Wade007

Wade007
  • Members
  • 25 posts

Posted 18 July 2012 - 10:27 PM

Thanks for your reply here girlgamer. I think I can see where you're headed.

In looking at the step by step actions that are required to close down the game I've realized that there is more than one way to have it happen. IE: Sometimes there is and extra screen to go through, Sometimes there isn't. Mmmmmm....

Nonetheless, I found a NEW a more simple workaround for my problem that works much better without the Mala layout after affects mentioned.

One unpublished way to close down the game is to simply press ALT+F4 at any time.

So, I mapped that to my selected key combo and BAM!!...I'm in business. Somehow this type of quick shutdown is not quite as harsh as the abrupt "close process" AHK way I was doing it.

So...problem solved. Thanks again for your willing assistance girlgamer. :)