emphatic Posted February 15, 2006 Share Posted February 15, 2006 I'm going crazy with setting up my PC games. I have a lot of freeware shooters from Japan that I want to play in my cabinet (pictures of it will show up as soon as it's done) and the keymapping isn't configurable ingame. I've configured AutoHotKey scripts for each game but I can't get GameEx to "also launch" them. I've tried "launch before" as well. They have the same names for example:"68 K.lnk" (I figured shortcuts are easiest and I have a folder called "Shortcuts" for my PC games."68 K.exe" (this is a compiled .ahk-file that I need to "also launch"I've tried putting the .exe-files in the same folder as my shortcuts but that didn't work.I then tried to put them in the same folder as the game.exe with the appropriate name (68 K.exe) but that didn't work either.The weirdest thing is that I can't see any reference to "also launch" in the GameEx .log file. I have attached both the part of the log-file that is needed to see as well as my Oh, and I can't get "Roms in folders" to work either (for this config, haven't tried it before). Does anyone use this and confirm that it actually does work?From log file:22:50:36.2 2006-02-15: Running: cmd.exe /c H: H:\Spel\PC-SPEL\CH050820\LATEST.exe22:50:59.7 2006-02-15: Exiting GameEx!My Config for PC-Games:SendKeys_25=[Emulator_1]Enabled=TrueStartPageName=PC GAMESTitleText=PC GAMESStartPageLogo=RomFilter=*.lnkRomsInFolders=FalseROMPath=H:\Shortcuts\SnapPath=H:\Spel\PC-SPEL\PC_SNAP_&_TITLE_SCREENS\snapsWorkingPath=H:\Shortcuts\MapKeys=TrueWaitBeforeKeys=SendKeys=ReplaceDash=FalseReplaceUnder=FalseCapitals=FalseRemoveBrackets=FalseAlsoLaunch=ShowDesktop=FalseDebug=FalseMapFile=OLDatZip=Command=[ROMPATH]\[ROMFILE]TitlePath=H:\Spel\PC-SPEL\PC_SNAP_&_TITLE_SCREENS\titlesBoxPath=H:\Spel\PC-SPEL\PC_SNAP_&_TITLE_SCREENS\controllersLaunchBefore=[ROMPATH]\[ROMFILE].exeLaunchAfter=C:\Program\Spel\GameEx\taskkill.exe /F /IM [ROMFILE].exeCartPath=configFile=ExcludedFiles=CustomBackground=bak Link to comment Share on other sites More sharing options...
Tom Speirs Posted February 15, 2006 Share Posted February 15, 2006 I can confirm Roms in folders is not implemented. Sorry.[Glad you figured out the Num Lock script. So much more fun when you do it yourself] Link to comment Share on other sites More sharing options...
emphatic Posted February 16, 2006 Author Share Posted February 16, 2006 I tried the debug mode and got the idea to look at the runitgame.bat and this is what it looks like now:H:CD "H:\Spel\PC-SPEL\CH050820"H:\Shortcuts\Cho_Ren_Sya_68_K.lnk.exe"H:\Spel\PC-SPEL\CH050820\LATEST.exe"c:\program\spel\gameex\taskkill.exe /f /im Cho_Ren_Sya_68_K.lnk.exeI also have learned that in order for my "[ROMPATH]\[ROMFILE].exe" to work, the .exe-file has to be called [ROMFILE].lnk.exe I don't understand why though.What happens now is that GameEx launches the runitgame.bat but when the AutoHotKey exe's (called [ROMFILE].lnk.exe, nothing else happens until I kill it. Bah! I'm too tired to keep trying tonight. Better get some sleep.I'm running Windows XP Home on my laptop btw if this has anything to do with it.Emph Link to comment Share on other sites More sharing options...
mec11 Posted February 16, 2006 Share Posted February 16, 2006 Well... if you ever get that working let me know Currently I have my PC games set up in the other apps section. Was much easier. Link to comment Share on other sites More sharing options...
emphatic Posted February 16, 2006 Author Share Posted February 16, 2006 mec11: But when you have about 20 games, it's a lot easier and cleaner on the start page to only have a "PC Games" category instead of 20 items. And you can't add your apps to appear as favorites, can you?I just want to be able to browse through my favorites with MAME, Dreamcast and PC games all in one big, happy family. I will do some more testing after work tonight.Emph Link to comment Share on other sites More sharing options...
emphatic Posted February 17, 2006 Author Share Posted February 17, 2006 More testing but I'm beginning to think that GameEx isn't 100% compatible with any of my Windows installations. Maybe Swedish XP is different? The issues I have so far:ANY emulation that involves any mounting or other processes starting other than started "directly" by GameEx fails.Example 1:I've tried to use Headkaze's Chankast emu setup, but a simple mounting operation that works 100% EVERY TIME outside of GameEx now never happens. So now I have to have ALL of my cd images mounted before entering GameEx should I want to play any of them. That's a LOT of friggin' virtual devices.Example 2 (PC game "Cho Ren Sya 68 K"):This is what I made this thread about, PC Games listed as Emulators.I've come as far now as to getting GameEx to "allow" my AutoHotKey script to run and then launch the corresponding game.To get that far I had to do this incredibly complicated list of aaarrgh! (sorry) "measures":I had to rename all files (I only did this for one test game since I'm not completely daft) per game:Cho_Ren_Sya_68_K.exe (ahk script, must be launched by GameEx as the emu/shortcut)Cho_Ren_Sya_68_K.exe.lnk (this is the "proper" game shortcut, launched "before") (Weird thing, I had to add the .exe to the .lnk-fle for it to work)Cho_Ren_Sya_68_K.exe.bat (batfile that launches taskkill.exe "after" to kill the corresponding AutoHotKey script, in this case "Cho_Ren_Sya_68_K.exe")(I tried to use the "launch after" command: taskkill /F /IM [ROMFile].exe but that never worked)So, what happens, you ask? Well, if I choose to run the game "Cho Ren Sya 68 K" from my PC Games folder, here's what I expect to be excecuted in the following order;Cho_Ren_Sya_68_K.exe (launch akh script)Cho_Ren_Sya_68_K.exe.lnk (launch game)When pressing the game thus exiting the game:Cho_Ren_Sya_68_K.bat (closing the ahk script so that the GameEx interfaceing will work)The .bat file won't run. So I'm confused. Is there a current "launch before/launch after" bug with the current build that I'm unaware of, or is this a system specific issue? I'm doing all the testing on my Laptop running XP Home sp2 (swedish).I did tests on my regular computer running XP Professional sp2 with the same results, so I don't think it's a Home issue.The config used:[Emulator_1]Enabled=TrueStartPageName=PC GAMESTitleText=PC GAMESStartPageLogo=RomFilter=*.exeRomsInFolders=FalseROMPath=H:\Shortcuts\SnapPath=H:\Spel\PC-SPEL\PC_SNAP_&_TITLE_SCREENS\snapsWorkingPath=H:\Shortcuts\MapKeys=TrueWaitBeforeKeys=SendKeys=ReplaceDash=TrueReplaceUnder=TrueCapitals=TrueRemoveBrackets=TrueAlsoLaunch=ShowDesktop=FalseDebug=FalseMapFile=OLDatZip=Command=[ROMPATH]\[ROMFILE]TitlePath=H:\Spel\PC-SPEL\PC_SNAP_&_TITLE_SCREENS\titlesBoxPath=H:\Spel\PC-SPEL\PC_SNAP_&_TITLE_SCREENS\controllersLaunchBefore=[ROMPATH]\[ROMFILE].lnkLaunchAfter=[ROMPATH]\[ROMFILE].batCartPath=configFile=ExcludedFiles=CustomBackground=bakAttached is my GameEx.iniPlease, Tom, tell me it's a bug!EmphGameEx.zip Link to comment Share on other sites More sharing options...
headkaze Posted February 17, 2006 Share Posted February 17, 2006 Sounds like your over complicating things. Personally I would do away with using lnk's if you have to do all this mounting and running Autohotkey scripts. I would just be using .bat files. Or possibly just one batch file to do it all.For example, lets call this batch file "RunPCGame.bat". It has to do a few things to run a PC game, namely run an autohotkey file, mount an image, run the game, kill the script, unmount the image.Okay, so here is one I'll knock up now and it will be untested, so you will have to fix up the bugs.-- RunPCGame.bat --@ECHO OFFREM -- Run Autohotkey scriptStart RunAHKScript.bat %1.exeREM -- Mount the image (using DT 4+)C:\Program Files\DAEMON Tools\daemon.exe -mount 0,%1REM -- Wait for image to finish mountingC:\Program Files\GameEx\Sleep.exe 5000REM -- Run gameStart /WAIT %1.lnkREM -- Unmount imageC:\Program Files\DAEMON Tools\daemon.exe -unmount 0REM -- Kill Autohotkey scripttaskkill /F /IM %1.exeexit-- End --You need to have a separate batch file to run the Autohotkey script otherwise the batch file will wait until the script task has finished. This way it will continue running the batch file after launching the script.-- RunAHKScript.bat --@ECHO OFF%1EXIT-- End --The way to run this batch file would be something like..RomFilter=*.cue;*.iso;*.cdi;*.mds;*.nrgCommand=[ROMPATH]\RunPCGame.bat [ROMPATH]\[ROMFILE]You will need the following files for each game (the extension is the games CD image file's extension)MyGame.iso <- Image file of gameMyGame.iso.lnk <- link to run actual gameMyGame.iso.exe <- Autohotkey scriptHope this helps Link to comment Share on other sites More sharing options...
headkaze Posted February 17, 2006 Share Posted February 17, 2006 I just found out that using the Start /WAIT switch with a shortcut will not always wait for the process to end properly. This means it will continue running the script unmounting the image and closing the Autohotkey script. So I have written a little program that will launch a shortcut and wait for it to finish before continuing.Change...Start /WAIT %1.lnkTo..runwaitlnk %1.lnkDownload runwaitlnk.zip Link to comment Share on other sites More sharing options...
emphatic Posted February 17, 2006 Author Share Posted February 17, 2006 headkaze: A BIG thank you -> THANK YOU!I will test this tonight after work and family matters. Emph Link to comment Share on other sites More sharing options...
emphatic Posted February 17, 2006 Author Share Posted February 17, 2006 Testing has begun.I've tried using these .bat files with my "problem apps" i.e. PC Games & Dreamcast games. The Dreamcast games needs to mount. None of my PC games does. Since I'm not using DaemonTools, but Alcohol 120% instead (more virtual drives), I want the Autohotkey script to send Alcohol mounting hotkeys.Btw, can .bat-files send keys by itself? This way, I wouldn't need to open any .ahk-scripts for my DC games.This is my RunPCGame.bat:@ECHO OFFREM -- Run Autohotkey scriptStart RunAHKScript.bat %1.exeREM -- Wait for RunAHKscript.bat to loadC:\Program\Spel\GameEx\Sleep.exe 5000REM -- Run gamerunwaitlnk %1.lnkREM -- Kill Autohotkey scriptC:\Program\Spel\GameEx\taskkill /F /IM %1.exeexit-- End --This is my RunDCGame.bat:@ECHO OFFREM -- Run Autohotkey scriptStart RunAHKScript.bat %1.exeREM -- Wait for image to finish mountingC:\Program\Spel\GameEx\Sleep.exe 5000REM -- Run gamerunwaitlnk %1.lnkREM -- Kill Autohotkey scriptC:\Program\Spel\GameEx\taskkill /F /IM %1.exeexit-- End --This is my RunAHKScript.bat (I use identical files for both PC & DC):@ECHO OFF%1EXIT-- End --I've tested these methods in both debug and regular mode, but they don't work for me, so if you can point to my mistakes, I'd be as happy as a pig in fresh mud.Now I'm gonna play some games and wait for some kind soul to help me out with this.Emph Link to comment Share on other sites More sharing options...
emphatic Posted March 1, 2006 Author Share Posted March 1, 2006 It looks like I'm a minority here with all the hassle setting up emulators that involves loading of AutoHotKey scripts or mounting of disc images and I'd like to know why, not only for me but for other that will run into the same problems.I had an idea that I was sure was going to work but it didn't. The idea was that instead of loading a .bat file or letting GameEx handle the loading of more than one process (which NEVER works on either of my systems, WIN XP Pro SP2, WIN XP Home SP2) I would include the starting of the program in my AutoHotKey script.Like this:Run c:\game.exe;Contents of Auto Hot Key scriptThis OF COURSE works fine OUTSIDE of GameEx but OF COURSE (by Murphy's Law) NEVER inside GameEx. When I launch the .ahk or the compiled .exe, the game.exe is launched and the keys are mapped as they should be. But WHY won't GameEx let processes start as I want them to? What is it that I'm missing?The above statement is 100% factual. I have gotten some help from Headkaze, but I still ain't gettin' anywhere and I just don't see how I can. I'm very frustrated as you all can see by the CAPS! Again, this is what I need to happend:1. Start the game.ahk2. Then start the game.exe3. On exit (escape key) quit the game.exe and kill the game.ahkExample 2:1. Mount game.iso (cdi, cue, nrg, etc)2. Launch game.exe.lnkBoth examples work outside of GameEx without errors, so my configuration must be flawless. Conclusion, GameEx is to blame.End of story. Please help me. I need it.Emph Link to comment Share on other sites More sharing options...
incubus158 Posted March 1, 2006 Share Posted March 1, 2006 I have a solution for your first problem. I have created map files that pass both the folder name and the EXE to an AHK script. The script has a key event (ESC) that when escape is pressed, it kills both the application and the AHK script (which gameex is tracking).I can post it when I get home. I thought I have posted it before, maybe you can search all my messages.While developing the script, I had to essentially put gibberish text in between where folder "\" character would be, because gameex parses it out and attempts to just run the exe. WEIRD!The Also launch functionality is very funky, essentially the bat file has to be in the same working path I thought. I just do not use it anymore because I was frustrated with how it worked. You definitely are not in the minority with trying to run PC games in gameex. I will release my full gameex configuration for all DOS games that will be passed into DOSBox in a few days if I can get some more work done. Link to comment Share on other sites More sharing options...
emphatic Posted March 2, 2006 Author Share Posted March 2, 2006 I have a solution for your first problem. I have created map files that pass both the folder name and the EXE to an AHK script. The script has a key event (ESC) that when escape is pressed, it kills both the application and the AHK script (which gameex is tracking).I can post it when I get home. I thought I have posted it before, maybe you can search all my messages.While developing the script, I had to essentially put gibberish text in between where folder "\" character would be, because gameex parses it out and attempts to just run the exe. WEIRD!The Also launch functionality is very funky, essentially the bat file has to be in the same working path I thought. I just do not use it anymore because I was frustrated with how it worked. You definitely are not in the minority with trying to run PC games in gameex. I will release my full gameex configuration for all DOS games that will be passed into DOSBox in a few days if I can get some more work done.<{POST_SNAPBACK}>THANK YOUEmph Link to comment Share on other sites More sharing options...
emphatic Posted March 2, 2006 Author Share Posted March 2, 2006 I have a solution for your first problem. I have created map files that pass both the folder name and the EXE to an AHK script. The script has a key event (ESC) that when escape is pressed, it kills both the application and the AHK script (which gameex is tracking).I can post it when I get home. I thought I have posted it before, maybe you can search all my messages.While developing the script, I had to essentially put gibberish text in between where folder "\" character would be, because gameex parses it out and attempts to just run the exe. WEIRD!The Also launch functionality is very funky, essentially the bat file has to be in the same working path I thought. I just do not use it anymore because I was frustrated with how it worked. You definitely are not in the minority with trying to run PC games in gameex. I will release my full gameex configuration for all DOS games that will be passed into DOSBox in a few days if I can get some more work done.<{POST_SNAPBACK}>Just a reminder to incubus158, please upload your map-file or whatever I need to get my games+ahk-scripts to run! Do I need any additional software for this? Like AutoIt or something?Emph Link to comment Share on other sites More sharing options...
Tom Speirs Posted March 2, 2006 Share Posted March 2, 2006 Just to let you know the issue when you had a setting in quotes in the config such as "[ROMPATH]\[ROMFILE]" and the config application would remove the quotes is fixed in the latest release. It now saves the quotes. Link to comment Share on other sites More sharing options...
Tom Speirs Posted March 2, 2006 Share Posted March 2, 2006 Just to let you know the issue when you had a setting in quotes in the config such as "[ROMPATH]\[ROMFILE]" and the config application would remove the quotes is fixed in the latest release. It now saves the quotes.Also dont forget the config app now supports input and export for emulators, really should be little need for manual ini editing. Also any truncation issues are fixed now, and the config app also runs must faster. In addition the emulator settings are now laid out individually for each emulator in the config app, no more 1-5 etc. Link to comment Share on other sites More sharing options...
emphatic Posted March 2, 2006 Author Share Posted March 2, 2006 Also dont forget the config app now supports input and export for emulators, really should be little need for manual ini editing. Also any truncation issues are fixed now, and the config app also runs must faster. In addition the emulator settings are now laid out individually for each emulator in the config app, no more 1-5 etc.<{POST_SNAPBACK}>Great, Tom! I'll be sure to export my PC game .ini when I get it to work. If just everything would work like it should (i.e. the "launch before" and "also launch" etc) nothing really would be complicated at all. I will try setting it up this way again now that everything is saved individually and correctly.Edit: I tried it the "real" way, with GameEx loading my compiled .ahk script with "launch before" and then the .lnk. GameEx now successfully loads the AutoHotKey .exe, and nothing else happens. I had to hit Ctrl+Alt+Delete and manually kill my script.exe.This is at last, some progress. Or is it not? I see that incubus158 has posted his map and .exe-script, but since I don't know what to change in the script for it to work for my setup. I will do some more testing and see what I find.Emph Link to comment Share on other sites More sharing options...
incubus158 Posted March 2, 2006 Share Posted March 2, 2006 heres the ahk script and map file i promised. it seems pretty retarded how i did it, but during my testing gameex did parse out the folder name and tried to just run the exe name it recognized. Tom can you affirm that this does this and let me know if you ever change that logic.MAP file:Archon (1984)(Electronic Arts Inc)stupidgameexwillparseourforwardslashesthisisaworkaroundarchon.com|Archon (1984)(Electronic Arts Inc)Code for EXE:IfInString, 1,thisisawindowsonlyexe{StringReplace, 1, 1, thisisawindowsonlyexe,, AllStringReplace, 1, 1, )stupidgameexwillparseourforwardslashesthisisaworkaround,)\, AllRun, E:\Games\[More Great Computer Games]\%1%}else{StringReplace, 1, 1, )stupidgameexwillparseourforwardslashesthisisaworkaround,)\, AllRun, "C:\Program Files\DOSBox-0.63\dosbox.exe" -conf "C:\Program Files\DOSBox-0.63\dosbox.conf" "E:\Games\[More Great Computer Games]\%1%"}ESCAPE::;this leaves the EXE running so gameex doesnt go back into the interfaceSend, {ALTDOWN}{ENTER}{ALTUP}Run, killdosbox.batExitAppreturnLet me know if this helps. Link to comment Share on other sites More sharing options...
emphatic Posted March 2, 2006 Author Share Posted March 2, 2006 Okay, now I got it to work (95% sure, haven't tried it with my X-Arcade yet but the .log file tells me everything has been loaded) so my guess is, whatever was broke has been fixed. Perhaps an issue with the Configuration tool not saving everything correctly?I tried to put the .ahk script uncompiled in "also launch" and it worked!Ini filed is attached. PC_Games_With_AutoHotKey_Support.zip For working .ahk support (95%, when 100% it will be in user submitted ini thread also) you need the following:A folder named "Shortcuts" or what you like to call it. In it you need two files per game:A shortcut to your game .exe and a .ahk script (haven't tried with compiled scripts yet but it should work) with a corresponding name. Just be sure to name give it double extensions like this ".lnk.ahk" That's it.No more hassle. I don't know if GameEx will continue to load the game is the .ahk is missing, so for games that don't need key alteration, just use a blank text file with that romame and the .ahk extension.Edit: I noticed that in order for this to work you need to have taskkill.exe (XP Pro users have it, Home users need to google for it and change the "launch after" accordingly.Oh, what a happy day!Edit: No it didn't work. The log file isn't being truthful.22:12:56.8 2006-03-02: Running: cmd.exe /c H: H:\Spel\PC-SPEL\CH050820\LATEST.exe22:12:58.4 2006-03-02: Also Launching: "[rompath]\[romfile].ahk"22:13:13.6 2006-03-02: Exiting GameEx!22:13:13.6 2006-03-02: Saving Settings22:13:13.7 2006-03-02: Writing Game List to disk22:13:16.3 2006-03-02: Checking for applications to Launch On ExitI checked in the task manager and the ahk file was never loaded.Emph Link to comment Share on other sites More sharing options...
headkaze Posted March 3, 2006 Share Posted March 3, 2006 The ahk file would only launch if Tom is using "Start *" to launch it. He may not be using that method, in that case the ahk would not be executed. Try compiling the ahk script to an .exe file and trying that instead. You may need to browse to your AutoHotkey directory to find the compiler but it's in there somewhere. Link to comment Share on other sites More sharing options...
emphatic Posted March 3, 2006 Author Share Posted March 3, 2006 The ahk file would only launch if Tom is using "Start *" to launch it. He may not be using that method, in that case the ahk would not be executed. Try compiling the ahk script to an .exe file and trying that instead. You may need to browse to your AutoHotkey directory to find the compiler but it's in there somewhere.<{POST_SNAPBACK}>I will try that. Btw, you do know that you can just right-click an ahk-script and choose "compile to exe", don't you? Or does the compiler work differently?Emph Link to comment Share on other sites More sharing options...
Recommended Posts