Page 1 of 2

VP8, VP9, VP10, VP Physmod5, FP

Posted: Wed Dec 30, 2015 12:25 am
by Spyke
Hi,

is it possible to start Pinball Tables (VP and FP) with the right Version of VP or FP, like discribed in this tread for Hyperpin?
http://vpuniverse.com/forums/topic/328-tutorial-how-to-select-a-different-version-of-vp-or-fp-when-launch-tables-via-hyperpin/

Maybe it´s possible to use FPLaunch with mGalaxy?

Regards
Marc

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Wed Dec 30, 2015 5:54 pm
by Aeliss
I don't know visual pinball, so I don't understand exactly what you want to do.
You have several table and you want to load some of them with VP and some other with FP ?

You can use FPlauch if :
1 - it work in fullscreen
2 - if it doesn't close after you select the table, else mGalaxy will return in same time you load the table (mGalaxy wait for the application finish to come back).

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Sun Feb 28, 2016 11:09 am
by Spyke
Sorry for the late reply.
Tried different things, butI didn´t get it work untill now......

Let me explain what I want to do.
At the moment there are 3 different versions of Visual Pinball out there, VP9, VP10 and Physmod5. The tables only work with right version of VP.
The same for Future Pinball, there are varios version of Physmods out there.
It will be possible to manage them by adding new emulators to mGalaxy, but then I didn´t get a complete gamelist and have to switch between the different emulators. My idea is to have one gamelist in mGalaxy and start the table with the right version of VP and FP.

I found a nice AHK script for PinballX http://pinballvirtual.es/vplauncher-varias-versiones-de-visual-pinball-en-pinballx/ it´s only for VP, but maybe it can be changed to work with FP too.
I tried it and added vpx and Physmod5 to table name and start them outside of mGalaxy (by klicking the table itself) it starts up with the right version of VP, but therminates then because of missing files (I think it´s because of missing Pinballx files).
Is it possible to change the script to work with mGalaxy?

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Sun Feb 28, 2016 2:14 pm
by Aeliss
Yep, no problem, and your script will work because
2 - if it doesn't close after you select the table, else mGalaxy will return in same time you load the table (mGalaxy wait for the application finish to come back).
In fact your script (exe file) stay active and wait for you close the pinball application, so during this time mGalaxy will be freezed too.

But to use it in mGalaxy it's usefull to edit the data/system.xml file in mGalaxy.
  <System Type="Arcade">
    <Name>Pinball</Name>
    <AppPath />
    <RomPath />
    <SnapPath />
    <VidPath />
    <Emu selected="0">
      <Cmd id="0" name="Visual Pinball [Script]" value="-play -"%path\%file%ext"" />
      <Cmd id="1" name="Future Pinball" value="/open "%path\%file%ext" /play /exit" />
    </Emu>
    <Extensions>.vpt,.fpt</Extensions>
    <Active>False</Active>
    <Script>True</Script>
    <Database>False</Database>
  </System>
If you select your script file as executable it will receive as command line "script.exe -play table.xxx" or "script.exe /open table.xxx /play /exit" too much useless command so you can edit (or add) theses line as

Code: Select all

<Cmd id="0" name="My Pinball Script" value=""%path\%file%ext"" />
With that your script will work only with %1% param.

and you need to put the complete pinball executable path in your script if you don't want to have problem with it.
(I think it´s because of missing Pinballx files).
Exactly, you can't try it just with using it alone, you need to use command line, in cmd.exe

Code: Select all

"d:/yourscript.exe" "d:/yourtable.xxx"

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Sun Feb 28, 2016 11:11 pm
by Spyke
Hi Aeliss,

thank you for your answer.
I did what you told me, but didn´t get it work. I´m a noob to scripting, so be patient with me.

I changed System.xml to following:

Code: Select all

<System Type="Arcade">
    <Name>Pinball</Name>
    <AppPath>C:\Program Files (x86)\Visual Pinball\VPlaunch.exe</AppPath>
    <RomPath>C:\Program Files (x86)\Visual Pinball\Tables</RomPath>
    <SnapPath />
    <VidPath />
    <Emu selected="0">
      <Cmd id="0" name="My Pinball Script" value=""%path\%file%ext"" />
      <Cmd id="1" name="Future Pinball" value="/open "%path\%file%ext" /play /exit" />
    </Emu>
    <Extensions>.vpt,.fpt,.vpx</Extensions>
    <Active>True</Active>
    <Script>True</Script>
    <Database>False</Database>
  </System>
And my script looks like this:

Code: Select all

#SingleInstance force
SetTitleMatchMode 2
DetectHiddenWindows On
SetWorkingDir %A_ScriptDir%

vpt=vpt
vpx=vpx
playme=/play
editme=/Edit

Table = %1% ;Variable direct table
SplitPath, Table, Tname, Tdir, Text, Tname_no_ext, Tdrive
SplitPath, Tdir,, vpdir
If (Text=%vpt%) or (Text=%vpx%)
{
goto Tabledetected
}

Table = %2% ;Variable from PinballX or batch file personal use.
SplitPath, Table, Tname, Tdir, Text, Tname_no_ext, Tdrive
StringTrimLeft, Table, Table, 1
SplitPath, Tdir,, vpdir
StringTrimLeft, vpdir, vpdir, 1

If (Text=%vpt%) or (Text=%vpx%)
{
if playme=%1%
function=%playme%
else
function=%editme%
goto Tabledetected
}
exitapp

Tabledetected:
IfInString, Table, physmod5
{
myexe=vpinball-physmod5-accelmod.exe
}

IfInString, Table, vpx
{
myexe=vpinballx.exe
}

if myexe=
{
myexe=VPinball991.exe
}
If function=%editme%
RunMytable =%vpdir%\%myexe% /Edit -“%Table%”
Else
RunMytable =%vpdir%\%myexe% /play -“%Table%”

Run, %RunMytable%

checkprocessagain:
Process, wait, %myexe%, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain

Process, WaitClose, %NewPID%
exitapp
return
with this I receive the error shown in picture error1

If I change the script an add the complete pinball executable path

Code: Select all

myexe=C:\Program Files (x86)\Visual Pinball\VPinball991.exe
I receive the error shown in picture error2.
Any ideas what I did wrong?

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Mon Feb 29, 2016 5:58 pm
by Aeliss
%vpdir% is the directory so as you use the complete path just use

Code: Select all

RunMytable =%myexe% /Edit -“%Table%”
and I m not sure (I m using autoit, not autohkey) but I think it's better to use

Code: Select all

RunMytable ="%myexe%" /Edit -“%Table%”
or

Code: Select all

myexe="C:\Program Files (x86)\Visual Pinball\VPinball991.exe"

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Mon Feb 29, 2016 8:45 pm
by Spyke
I tried it, but didn´t get it work  >:(

Deleted %vpdir% from both RunMyTable
and get Error shown in picture without

Added quotation marks to RunMyTable
and get error shown in picture runmytable

Added quotation marks to myexe
and get error shown in picture myexe

Tried it with all versions of tables (name without anything, name within vpx, name within physmod5) and the right version of VP starts, but ends with errors. So the problem must be by starting the table itself.

I´m a little helpless.....

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Mon Feb 29, 2016 9:01 pm
by Spyke
posted the wrong picture for runmytable, it looks the same like the others.

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Mon Feb 29, 2016 10:04 pm
by Spyke
Like already told I´m a noob in scripting, but I think the problem is caused by file structure of Visual Pinball.
The tables located in a subfolder called "Tables", see attached picture.

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Tue Mar 01, 2016 4:35 pm
by Aeliss
There is a "/" to remove too with %vpdir%

But on your screenshot called "runmytable" the command is almost good, it just miss a " (or 3), all the path seems good.
If you have a space in your path you need obligatory 2 more " for path.
Can you make a c/c of your actual code pls.

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Tue Mar 01, 2016 6:12 pm
by Spyke
Played a little with it and I cant figure out how I create the mytable error.

the actual code is:

Code: Select all

#SingleInstance force
SetTitleMatchMode 2
DetectHiddenWindows On
SetWorkingDir %A_ScriptDir%

vpt=vpt
vpx=vpx
playme=/play
editme=/Edit

Table = %1% ;Variable direct table
SplitPath, Table, Tname, Tdir, Text, Tname_no_ext, Tdrive
SplitPath, Tdir,, vpdir
If (Text=%vpt%) or (Text=%vpx%)
{
goto Tabledetected
}

Table = %2% ;Variable from PinballX or batch file personal use.
SplitPath, Table, Tname, Tdir, Text, Tname_no_ext, Tdrive
StringTrimLeft, Table, Table, 1
SplitPath, Tdir,, vpdir
StringTrimLeft, vpdir, vpdir, 1

If (Text=%vpt%) or (Text=%vpx%)
{
if playme=%1%
function=%playme%
else
function=%editme%
goto Tabledetected
}
exitapp

Tabledetected:
IfInString, Table, physmod5
{
myexe=C:\Program Files (x86)\Visual Pinball\vpinball-physmod5-accelmod.exe
}

IfInString, Table, vpx
{
myexe=C:\Program Files (x86)\Visual Pinball\vpinballx.exe
}

if myexe=
{
myexe=C:\Program Files (x86)\Visual Pinball\VPinball991.exe
}
If function=%editme%
RunMytable ="%myexe%" /Edit -"%Table%”
Else
RunMytable ="%myexe%" /play -"%Table%”

Run, %RunMytable%

checkprocessagain:
Process, wait, %myexe%, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain

Process, WaitClose, %NewPID%
exitapp
return
With this VP.exe starts, but the table didn´t start and gives the error shown in actual.jpg

After I exit mGalaxy and give ok to the error, the process VPlaunch.exe stays active and must be terminated by task manager.

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Tue Mar 01, 2016 9:34 pm
by Aeliss
From the code VPlaunch.exe close itself when the app in myexe close.
So if you close VPinball991.exe VPlaunch will close.

But I can't understans why it don't work, the path seem good, the only problem I m seeing is a " at the end of the pat and not at the start.

After a look on some forum I have see the command line is

Code: Select all

C:\P-ROC\vpinballx.exe -play "C:\P-ROC\games\EvilDead\EvilDead2015.vpx"
So make a try with

Code: Select all

RunMytable ="%myexe%" -play "%Table%”
If it don't work, I can make you an autoit script, I can't test it (I have only 1 pinball application) but the code will  be easier to check.

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Tue Mar 01, 2016 10:14 pm
by Spyke
Hooray! Got it work  :)

It didn´t work with

Code: Select all

RunMytable ="%myexe%" -play "%Table%”
instead I have to use

Code: Select all

RunMytable ="%myexe%" -play "%Table%
One little difference only delete " at the end.....

For those who want to use the script, here is the working scipt:

Code: Select all

#SingleInstance force
SetTitleMatchMode 2
DetectHiddenWindows On
SetWorkingDir %A_ScriptDir%

vpt=vpt
vpx=vpx
playme=/play
editme=/Edit

Table = %1% ;Variable direct table
SplitPath, Table, Tname, Tdir, Text, Tname_no_ext, Tdrive
SplitPath, Tdir,, vpdir
If (Text=%vpt%) or (Text=%vpx%)
{
goto Tabledetected
}

Table = %2% ;Variable from PinballX or batch file personal use.
SplitPath, Table, Tname, Tdir, Text, Tname_no_ext, Tdrive
StringTrimLeft, Table, Table, 1
SplitPath, Tdir,, vpdir
StringTrimLeft, vpdir, vpdir, 1

If (Text=%vpt%) or (Text=%vpx%)
{
if playme=%1%
function=%playme%
else
function=%editme%
goto Tabledetected
}
exitapp

Tabledetected:
IfInString, Table, physmod5
{
myexe=C:\Program Files (x86)\Visual Pinball\vpinball-physmod5-accelmod.exe
}

IfInString, Table, vpx
{
myexe=C:\Program Files (x86)\Visual Pinball\vpinballx.exe
}

if myexe=
{
myexe=C:\Program Files (x86)\Visual Pinball\VPinball991.exe
}
If function=%editme%
RunMytable ="%myexe%" -Edit "%Table%
Else
RunMytable ="%myexe%" -play "%Table%

Run, %RunMytable%

checkprocessagain:
Process, wait, %myexe%, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain

Process, WaitClose, %NewPID%
exitapp
return
Compiled with AHK, the name must be VPlaunch.exe and must be placed in the Visual Pinball folder next to the VPinball exe files.
You have to change the following to your needs:
path and name for physmod5 exe

Code: Select all

myexe=C:\Program Files (x86)\Visual Pinball\vpinball-physmod5-accelmod.exe
path and name for vpinballx exe

Code: Select all

myexe=C:\Program Files (x86)\Visual Pinball\vpinballx.exe
path and name for standard Vpinball exe

Code: Select all

myexe=C:\Program Files (x86)\Visual Pinball\VPinball991.exe
The table-names for vpinballx must include vpx and for Physmod5 must include physmod5. Tables for VPinballXXX must include nothing in table-name.
For mGalaxy system.xml use:

Code: Select all

<System Type="Arcade">
    <Name>Pinball</Name>
    <AppPath>C:\Program Files (x86)\Visual Pinball\VPlaunch.exe</AppPath>
    <RomPath>C:\Program Files (x86)\Visual Pinball\Tables</RomPath>
    <SnapPath />
    <VidPath />
    <Emu selected="0">
      <Cmd id="0" name="My Pinball Script" value=""%path\%file%ext"" />
      <Cmd id="1" name="Future Pinball" value="/open "%path\%file%ext" /play /exit" />
    </Emu>
    <Extensions>.vpt,.fpt,.vpx</Extensions>
    <Active>True</Active>
    <Script>True</Script>
    <Database>False</Database>
  </System>

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Tue Mar 01, 2016 10:26 pm
by Spyke
Aeliss thank´s for helping me!

Only one small problem I figured out, VPlaunch.exe stays active in the background, I didn´t know why - but I´m happy, it works.
Maybe it can be solved, any idea?

Re: VP8, VP9, VP10, VP Physmod5, FP

Posted: Wed Mar 02, 2016 4:33 pm
by Aeliss
If VPlaunch.exe stay active in memory, it can't work in mGalaxy, because mGalaxy will wait for it to return.

The code seem ok but you can try using

Code: Select all

RunWait, %RunMytable%
instead of

Code: Select all

Run, %RunMytable%

checkprocessagain:
Process, wait, %myexe%, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain

Process, WaitClose, %NewPID%
or

Code: Select all

Run, %RunMytable%, , , NewPID
Process, WaitClose, %NewPID%
But I m not using AHK, so It s just suposition.