Jump to content
LaunchBox Community Forums

CXBX Reloaded script needed


smpetty

Recommended Posts

When running CXBX-Reloaded from LB/BB, I am able to load games (default.xbe), but I need an AHK script that will do the following, after the game is loaded:

Pass keypress F5 to the emulator (starts emulation)

Pass keypress ALT-RETURN to the emulator (goes full screen)

There are no command line arguments that will do the same.  

 

Also, when quitting CXBX-Reloaded, I need an AHK script which will do the following:

Pass keypress F6 to the emulator (stops emulation)

Pass keypress ALT-F4 to the emulator (closes/exits the emulator)

Many thanks in advance!

Link to comment
Share on other sites

You can autolaunch an executable bypassing the GUI entirely by using the "/load" command line flag.
It's not officially suported behavior, so you may need to update your scripts for later Cxbx-R versions, but changes to this will be rare. 
 

cxbx.exe /load "path to xbe"

 

  • Thanks 1
  • Game On 1
Link to comment
Share on other sites

I have used the /load command line flag, combined with the “Use exclusive full screen mode” setting, with a video resolution of “Automatic (default)”.  This will sometimes work, but after one or more successes in LB/BB, it stops working.  When it stops working, if I double click a game in LB, there is a small pause where my arrow icon turns to a spinning circle icon, but CXBX never loads and after a few seconds I am back to LB with an arrow icon.  I have to reset the default settings of CXBX and delete the CXBX Reloaded folder in AppData to get everything working again.  The only other setting that I had changed is “Allow Admin Privilege”.  I don’t run CXBX as an administrator, but choosing this setting lets me skip warnings about “XBE Signature Failed.”  I am running only known working games that I have run multiple times successfully with CXBX.  

When I run the same titles outside of LB, running CXBX, choosing an .xbe file, loading it, starting emulation (F5), stopping emulation (F6), and then closing the emulator (ALT-F4 or just closing the window by clicking the top right corner), I don’t have the same problems.  As long as I am meticulous in starting and stopping the emulator in this fashion, CXBX continues to work.  I suspect that LB/BB are not shutting down CXBX completely or correctly, although I can’t find an open CXBX.exe with Task Manager when I have the problems.

I’m stumped.  Any ideas?

Link to comment
Share on other sites

  • 3 months later...
  • 4 months later...
  • 6 months later...

Hello, in case anyone sees this and needs help with CXBX Reloaded, this is what worked for me with the most recent version of the emulator as of right now:

The emulator auto loads the game now as long as you point Launchbox to the default.xbe file

There is also an alternative you can use if you want to compress the game's files. All you do is either rename the default.xbe to default.cue OR you can copy the default.xbe file and paste it in the same directory and rename it ANYTHING.cue  All that matters is that the file extension is CUE and launchbox will send it to the emulator and it will automatically load.

As far as making it go fullscreen and being able to exit, this script works for my system:

Sleep, 3000
Send !{enter}

$Esc::
{
  Send {f6}
  Send !{f4}
  Return
}

Put it in the Running AutoHotKey Script tab and you're good to go!

***Unless things work for you, be sure that the emulator's Video config settings has Use Exclusive Fullscreen Mode UNCHECKED ***
On my system that causes issues and the game screen goes black and the emulator won't close without using Task Manager to End Task.

 

Hope that all makes sense and helps someone!

 

Link to comment
Share on other sites

  • 3 weeks later...
On 10/1/2020 at 1:25 AM, Dark Fact said:

Hello, in case anyone sees this and needs help with CXBX Reloaded, this is what worked for me with the most recent version of the emulator as of right now:

The emulator auto loads the game now as long as you point Launchbox to the default.xbe file

There is also an alternative you can use if you want to compress the game's files. All you do is either rename the default.xbe to default.cue OR you can copy the default.xbe file and paste it in the same directory and rename it ANYTHING.cue  All that matters is that the file extension is CUE and launchbox will send it to the emulator and it will automatically load.

As far as making it go fullscreen and being able to exit, this script works for my system:

Sleep, 3000
Send !{enter}

$Esc::
{
  Send {f6}
  Send !{f4}
  Return
}

Put it in the Running AutoHotKey Script tab and you're good to go!

***Unless things work for you, be sure that the emulator's Video config settings has Use Exclusive Fullscreen Mode UNCHECKED ***
On my system that causes issues and the game screen goes black and the emulator won't close without using Task Manager to End Task.

 

Hope that all makes sense and helps someone!

 

This ahk script:

Sleep, 3000
Send !{enter}

$Esc::
{
  Send {f6}
  Send !{f4}
  Return
}

doesnt work for me. It closes the emulation but the cxbx window is still there, so i must double click the exit key. Im using the newest launchbox version (11.6)

any ideas?

Edited by FR0NZ
Link to comment
Share on other sites

2 hours ago, Koroth said:

With CXBX Reloaded I have set cxbxr-ldr.exe as my emulator .exe. That way CXBX's gui doesn't start and only one window is opend. For closing CXBX I use the following autohotkey script:

$Esc::
{
WinClose, Cxbx-Reloaded ahk_exe cxbxr-ldr.exe
}

It works with the cxbx-ldr.exe and the /load argument in the command line :)

thanks!

Link to comment
Share on other sites

It works for me as well, although in some games, I start to play for let's say 30 seconds, LB window "closing game" pops up, and the Cxbx screen goes windowed from fullscreen, but game is still running. So something is causing LB to close and something makes Cxbx still run, although in windowed mode. 

Link to comment
Share on other sites

3 hours ago, DeadVoivod said:

It works for me as well, although in some games, I start to play for let's say 30 seconds, LB window "closing game" pops up, and the Cxbx screen goes windowed from fullscreen, but game is still running. So something is causing LB to close and something makes Cxbx still run, although in windowed mode. 

Are you using an ahk script to send an Alt + Enter to go to fullscreen? In the CXBX videosettings I have ticked "Use Exclusive Fullscreen Mode". CXBX automatically goes fullscreen and that workes well for me. But i can't say I have tested all games.

Link to comment
Share on other sites

I'm using both scripts mentioned here, doesn't work otherwise, together with the /load option. 

If I tick "Use Exclusive Fullscreen Mode" I get exactly the problem that Fr0nz mentioned:

***Unless things work for you, be sure that the emulator's Video config settings has Use Exclusive Fullscreen Mode UNCHECKED ***
On my system that causes issues and the game screen goes black and the emulator won't close without using Task Manager to End Task.

The problem happens with Blood Wake and Crimson Skies. Did not notice it in any other game so far (10 tested).

Edited by DeadVoivod
Link to comment
Share on other sites

7 minutes ago, DeadVoivod said:

***Unless things work for you, be sure that the emulator's Video config settings has Use Exclusive Fullscreen Mode UNCHECKED ***

 

On my system that causes issues and the game screen goes black and the emulator won't close without using Task Manager to End Task.

In my experience, sometimes black screens are caused by startup screens. Have you tried fiddling with those settings?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...