stigzler Posted January 15, 2014 Share Posted January 15, 2014 Hi folks. Having a problem with Launch Before in advanced Emu Config.Basically, looking to have two bat files running before and after launch/exit of Demul. These will load and save key configs for each game. The scripts:Launch Before::: Load Controls ini for demul:: By Stigzler 2013@echo onset romname=%1set romname=%romname:~1,-1%set workpath=%2set workpath=%workpath:~1,-1%:: --------------------------------------------------------------------:: User Variables - SET HERE!:: Location of Demul Controls Folder:set controlsfolder=C:\Emulators\Dreamcast\demul_controls:: Location of Demul Folder:set demulfolder=C:\Emulators\Dreamcast\demul0582:: -------------------------------------------------------------------:: Codeset padfull=%demulfolder%\padDemul.iniset controlsfull=%controlsfolder%\%romname%.iniif NOT exist %controlsfull% (set controlsfull=%controlsfolder%\default.ini)Copy /Y "%controlsfull%" "%padfull%"cd %workpath%Pause::ExitLaunch After::: Create Controls ini for demul:: By Stigzler 2013@echo onset romname=%1set romname=%romname:~1,-1%:: --------------------------------------------------------------------:: User Variables - SET HERE!:: Location of Demul Controls Folder:set controlsfolder=C:\Emulators\Dreamcast\demul_controls:: Location of Demul Folder:set demulfolder=C:\Emulators\Dreamcast\demul0582:: -------------------------------------------------------------------:: Codeset padfull=%demulfolder%\padDemul.iniset controlsfull=%controlsfolder%\%romname%.iniCopy /Y "%padfull%" "%controlsfull%"Exit Have tested with just the Launch After command in config, and GameEx runs the emu and game fine and executes the 'after' script on exit fine. However, when I try to run the Launch Before with:C:\GameEx\AHKS_BATS\Demul_load_controls.bat "[ROM]" "[WORKINGPATH]"The script executes fine (watching debug mode) but then it returns straight back to GameEx without launching the emu/game. At this point, the cmd window is shut - so can't figure out what's going on. Had a look in the log, but didn't tell me much.Can anyone lend a hand?Have tinkered with various things - like Pause and exit commands, but these don't seem to make a difference.Cheers Link to comment Share on other sites More sharing options...
Tempest Posted January 15, 2014 Share Posted January 15, 2014 When you launch an app from gameex it watches the process, and once the process ends gameex takes over again. You can use an advanced config to watch for additional processes. Link to comment Share on other sites More sharing options...
stigzler Posted January 15, 2014 Author Share Posted January 15, 2014 Thanks Tempest. I'm sure I tried it with Exit at the end though... (without the rem outs) which should have meant that GamEx then launched the emu + game?In the end, grew frustrated and handled all via one bat with a start/wait command.Thanks for the advice though. Link to comment Share on other sites More sharing options...
Tempest Posted January 15, 2014 Share Posted January 15, 2014 I'm sorry, my answer would only have applied if you were launching running your emulator from within the bat file. Link to comment Share on other sites More sharing options...
stigzler Posted January 15, 2014 Author Share Posted January 15, 2014 Funny turn this! Your answer may be what I'm looking for after all.I'm now running a bat to do stuff, launch the emu, wait, do more stuff then close. Bat here:http://www.gameex.info/forums/topic/14066-tool-autoloadsave-individual-game-control-configs-with-demul/However, problem is that when I hit the Esc key, GameEx regains focus, but demul doesn't close (runs in background)I'm wondering whether what you're talking about is the cause of this?have the obligatory Mapping Off Exit Process Close running in advanced config. Hmmm.... befuddled. Link to comment Share on other sites More sharing options...
Adultery Posted January 15, 2014 Share Posted January 15, 2014 That's because doing it from a BAT file or script isn't gonna let GameEx monitor the correct program (GameEx will not be monitoring programs that you launch from your script). You need to create your own Advanced Config and put DEmul exe in the Process Wait tab so GameEx knows to close it. 1 Link to comment Share on other sites More sharing options...
Tempest Posted January 15, 2014 Share Posted January 15, 2014 Funny turn this! Your answer may be what I'm looking for after all.I'm now running a bat to do stuff, launch the emu, wait, do more stuff then close. Bat here:http://www.gameex.info/forums/topic/14066-tool-autoloadsave-individual-game-control-configs-with-demul/However, problem is that when I hit the Esc key, GameEx regains focus, but demul doesn't close (runs in background)I'm wondering whether what you're talking about is the cause of this?have the obligatory Mapping Off Exit Process Close running in advanced config. Hmmm.... befuddled.Yes. I gave you your answer before you knew you needed it! Link to comment Share on other sites More sharing options...
stigzler Posted January 15, 2014 Author Share Posted January 15, 2014 Stars as ever fellas. It's fun this tinkering with code lark isn't it! If only I had the faintest of ideas what I'm doing - it's the getting stuck part that sucks. Link to comment Share on other sites More sharing options...
Recommended Posts