Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. Thank you for your support. Tom Speirs

Patreon

Launch Before problems


stigzler

Recommended Posts

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 on
set romname=%1
set romname=%romname:~1,-1%
set workpath=%2
set 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

:: -------------------------------------------------------------------
:: Code
set padfull=%demulfolder%\padDemul.ini
set controlsfull=%controlsfolder%\%romname%.ini

if NOT exist %controlsfull% (
set controlsfull=%controlsfolder%\default.ini
)

Copy /Y "%controlsfull%" "%padfull%"

cd %workpath%
Pause

::Exit

Launch After:

:: Create Controls ini for demul
:: By Stigzler 2013

@echo on
set romname=%1
set 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

:: -------------------------------------------------------------------
:: Code
set padfull=%demulfolder%\padDemul.ini
set controlsfull=%controlsfolder%\%romname%.ini

Copy /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

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

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

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. :)

  • Like 1
Link to comment
Share on other sites

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! :P

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...