Jump to content
SpesoftPinballXConvert-It
Darkmeteor

Auto exit old B2S backglass

Recommended Posts

Just like a lot of people, I still have about 10% of my VP tables running these old B2S executables backglass because that's the only option right now. So I looked how it's done in fplaunch and made an autohotkey that will work with PinballX.

Basically what it will do is look at the table filename, and if it's named "sometableB2S.vpt" it will try to close a running backglass. The table HAS to be named like that (finishing with "B2S.vpt") as it's exactly what the script will look for before trying to close a B2S. Really, it's just like fplaunch, so anyone who was using this feature from fplaunch will already have all his tables with the right names !

It's a pretty simple autohotkey script, and it needs to be launched after the table exit with [TABLEFILE] as parameter, here's the content of the script :

If 0 > 0{	StringRight, ending, 1, 7	if (ending = "B2S.vpt")		{			WinKill, Form1		}}

I've added the ahk file as well as the compiled exe on my dropbox here : https://www.dropbox.com/sh/fg2ovlmtf08u6mi/viPoi3snby

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for this.

I just wanted to remind folks we have a fully featured download section on the forums so feel free to upload anything here. We also have the free FTP. There is no need to pay for or use separate services.

Share this post


Link to post
Share on other sites

Next time you setup a B2S table add the following at the bottom of a tables script.

Sub Table1_Exit():Controller.Stop:End Sub

(Table1 being the name of the table in visual pinball)

I don't expect you to go through and do every table but mine have been setup like this since the start of directb2s and controller.stop closes the b2s.

Share this post


Link to post
Share on other sites

This only works with DirectB2S files. I'm talking about B2S executables, the old ones, which are only exiting when pressing the esc key. Not all tables have a DirectB2S yet, Cirqus Voltaire for exemple.

Share this post


Link to post
Share on other sites

I have at least two tables that are using the b2s exe's instead of direct and I never had a problem with them not closing when launched from pinballx. If I launch direct from vp they can remain open, though. Circus Voltaire is one of them. I think my version of Gridiron is the old exe as well.

  • Like 1

Share this post


Link to post
Share on other sites

Ok, I get what's going on now. :rolleyes:

Didn't realize at first since it was one of the first things I changed to avoid exactly what you're going through.

The easy solution is to use the ESC key as the b2s.exe's require, and also is the default for pinballX. Bind your exit/end button on your cabinet to ESC. In the vpinball Preferences>Keys menu, check the box "Disable ESC Key" to keep the little menu from popping up when trying to close out a table and mucking things up from within pinballX. When you are using vpinball directly (in the editor), you would press Q to bring up the exit menu and just hit ESC to close the b2s. This generally is not a problem since if you're running tables from vpinball itself, you should have a keyboard nearby.

The alternative is to change the close/exit button for pinballX and the b2s exe's to match. Easily done for pinballX, but I don't know if you can do it for the b2s files, but your script takes care of it.

Share this post


Link to post
Share on other sites

Next time you setup a B2S table add the following at the bottom of a tables script.

Sub Table1_Exit():Controller.Stop:End Sub

(Table1 being the name of the table in visual pinball)

I don't expect you to go through and do every table but mine have been setup like this since the start of directb2s and controller.stop closes the b2s.

Tried to put this at the end of my vpt table script but it doesn't work, old B2S backglasses still refuse to quit.

Share this post


Link to post
Share on other sites

How can there be no answer or maybe there is but no one ever shares it...

 

Share this post


Link to post
Share on other sites

Respond to necro posts much?;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×