User Tools

Site Tools


vpx_vr_setup

VPX VR Config

This page is to configure Visual Pinball X (VR Version) with PinUP PopperVR.

You must have VPXVR working 100% on its own and setup BEFORE adding it and the VR Tables to the frontend!

You should watch this video by Scampa to help understand how it all works together.

Make New emulator if needed in Popper called somethin like Visual Pinball VR: I suggest to put VPXVR tables into a subfolder of virtualpinball\TABLESVR

Emulator Launch setup Option 1 (Advanced suggested)

Default SteamVR launch script. Note this has many options on top for default/registry entries. Review them to your needs. Also, this launch script allows you to put overrides into your 'custom launch parameters' for each game in Games Manger.

useB2S,noDMD,noPUP

those are found in the keys config dialog in vpx-vr. You any combination separated by comma on the game in Games Manager.

Launch Script: (note you must ensure that the first line starts with ;ahk (no blank lines before))

;ahk
DetectHiddenWindows, On

;Change the following line to EnableTrueFullScreen to default FullScreen Exclusive in VPX.
FSMODE=DisableTrueFullScreen

;changle this to 1 if you want to close/restart popvr between games.
ClosePOPVR=0

;set vpxvr default values for vr
DisableB2S=1
BGSet=0
MaxTexDimension=3072
BallStretchMode=1
CapExternalDMD=1
CapPUPDMD=1

;check for overrides
CUSTOMVAR:="[CUSTOM1]"
if InStr(CUSTOMVAR,"useB2s") {
   DisableB2S=0
}
if InStr(CUSTOMVAR,"noDMD") {
   CapExternalDMD=0
}
if InStr(CUSTOMVAR,"noPUP") {
   CapPUPDMD=0
}

;update registry for vpxvr
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\Controller,ForceDisableB2S,%DisableB2S%
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\VP10\Player,BGSet,%BGSet%
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\VP10\Player,MaxTexDimension,%MaxTexDimension%
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\VP10\Player,BallStretchMode,%BallStretchMode%
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\VP10\Player,CaptureExternalDMD,%CapExternalDMD%
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\VP10\Player,CapturePUP,%CapPUPDMD%

VPXEXE=VPinballX_GL.exe
if ("[ALTEXE]" != "") {
  VPXEXE=[ALTEXE]
}

;we now launch stuffs.
TableName:="[GAMEFULLNAME]"
SetWorkingDir,[DIREMU]
Run,%VPXEXE% "[DIREMU]" -%FSMODE% -play "%TableName%" -minimized,,Min,
sleep,5000
FileAppend,,[STARTDIR]PopperVR\gamerunning.txt
sleep,500
WinWait,Visual Pinball Player SDL,,60
sleep,2500
Postmessage,1034,3,0,,PUPControlForm,, ;tell popper to hide

if (ClosePOPVR=1)
{
    WinKill,PopperVR,,3
    FileAppend,,[STARTDIR]PopperVR\startpopvr.txt
}
Loop, 5 {
sleep,1000
WinGetActiveTitle, curTitle
if ("Visual Pinball Player SDL"<>"%curTitle%") {
WinActivate,Visual Pinball Player SDL
}
}

;set vpx default values for cabinet back after launch
DisableB2S=0
BGSet=1
MaxTexDimension=0
BallStretchMode=2
CapExternalDMD=1
CapPUPDMD=1

;update registry for cabinet
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\Controller,ForceDisableB2S,%DisableB2S%
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\VP10\Player,BGSet,%BGSet%
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\VP10\Player,MaxTexDimension,%MaxTexDimension%
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\VP10\Player,BallStretchMode,%BallStretchMode%
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\VP10\Player,CaptureExternalDMD,%CapExternalDMD%
RegWrite,REG_DWORD,HKCU\Software\Visual Pinball\VP10\Player,CapturePUP,%CapPUPDMD%

;uncomment below to set your VPX_GL-defined recenter key to recenter your view (numpad 5 is key in example)
;Send {Numpad5}

Default Close Script:

;ahk
DetectHiddenWindows, On
setTitleMatchMode,2

FileDelete,[STARTDIR]PopperVR\gamerunning.txt
;if we are in restart POPVR.exe mode this file will exists from launch script.
if FileExist("[STARTDIR]PopperVR\startpopvr.txt")
{
  SetWorkingDir,[STARTDIR]PopperVR
  Run,PopperVR.exe,,,
  FileDelete,[STARTDIR]PopperVR\startpopvr.txt
  WinWait,PopperVR,,3
}
WinKill,"Visual Pinball Player SDL",,5
;Process, Close, VPinballX_GL.exe
;put popvr in focus
PostMessage, 0x112, 0xF120,,,PopperVR,,
Loop, 2 {
WinGetActiveTitle, curTitle
if ("PopperVR"<>"%curTitle%")
   WinActivate,PopperVR
sleep,1000
}
;hide poppervr force as unity needs this
PostMessage, 0x112, 0xF020,,,PopperVR,,
;tell popper to return
Postmessage,1034,4,0,,PUPControlForm,,
;now keep Popper in Focus.
Loop, 3 {
sleep,1000
WinGetActiveTitle, curTitle
if ("PinUP Menu Player"<>"%curTitle%")
WinActivate,"PinUP Menu Player"
}

Option #2 (no registry overrides, not using AHK)

Default STEAMVR launch script (using hibernation mode)

cd /d "[DIREMU]"
START /min "" VPinballX_GL.exe "[DIREMU]" -minimized -play "[GAMEFULLNAME]"
timeout 5
"[STARTDIR]Launch\VPXSTARTER.exe" 10 5 60 "Visual Pinball Player SDL" 3 0 5
echo 1>> "[STARTDIR]PopperVR\gamerunning.txt"
START "" "[STARTDIR]Launch\PopperKeepFocus.exe" "Visual Pinball Player SDL" 10

Close Script

"[STARTDIR]LAUNCH\PUPCLOSER.EXE" WINTIT "Visual Pinball" 10 1
del "[STARTDIR]PopperVR\gamerunning.txt"
timeout 2
"[STARTDIR]Launch\PopperKeepFocus.exe" "PopperVR" 2
"[STARTDIR]Launch\POPWinMin.exe" "PopperVR"
"[STARTDIR]Launch\POPWinMin.exe" "SteamVR Status"
START "" "[STARTDIR]Launch\PopperKeepFocus.exe" "PinUP Menu Player" 3

Emulator Launch setup Option #3

If you want to close/re-launch PopperVR between runs then use the following scripts;

For SteamVR OPENXR Driver use these as sample launch/close scripts:

Launch

cd /d "[DIREMU]"
START /min "" VPinballX_GL.exe "[DIREMU]" -minimized -play "[GAMEFULLNAME]"
"[STARTDIR]Launch\VPXSTARTER.exe" 10 5 60 "Visual Pinball Player SDL" 3 0 5
taskkill /im "PopperVR.exe"
START "" "[STARTDIR]Launch\PopperKeepFocus.exe" "Visual Pinball Player SDL" 10

Close

cd /d [STARTDIR]PopperVR
START "" PopperVR.exe
timeout 1
"[STARTDIR]LAUNCH\PUPCLOSER.EXE" WINTIT "Visual Pinball" 10 1
"[STARTDIR]Launch\POPWinMin.exe" "PopperVR"
"[STARTDIR]Launch\POPWinMin.exe" "SteamVR Status"
START "" "[STARTDIR]Launch\PopperKeepFocus.exe" "PinUP Menu Player" 3

Emulator Launch setup Option #4

Using NON-SteamVR as your OPENXR driver here are sample launch/close scripts:

NON-STEAMVR Launchscript:

cd /d "[DIREMU]"
START /min "" VPinballX_GL.exe "[DIREMU]" -minimized -play "[GAMEFULLNAME]"
timeout 5
taskkill /im "PopperVR.exe"
"[STARTDIR]Launch\VPXSTARTER.exe" 10 5 60 "Visual Pinball Player SDL" 3 0 5
START "" "[STARTDIR]Launch\PopperKeepFocus.exe" "Visual Pinball Player SDL" 10

NON STEAMVR-Closescript:

"[STARTDIR]LAUNCH\PUPCLOSER.EXE" WINTIT "Visual Pinball" 10 1
timeout 1
rem if using oculus for OPENXR then use the next two lines by removing REM
taskkill /im vrmonitor.exe
taskkill /im vrserver.exe
cd /d [STARTDIR]PopperVR
START "" PopperVR.exe
"[STARTDIR]Launch\POPWinMin.exe" "PopperVR"
START "" "[STARTDIR]Launch\PopperKeepFocus.exe" "PinUP Menu Player" 3
vpx_vr_setup.txt · Last modified: 2021/12/02 19:02 by scampa123