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. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

Am new to PinballX and am wanting just to use it for displaying Pinball FX 2 tables. I have a standalone install of Pinball FX 2 and have used the setup wizard of PinballX to set the folder locations of Pinball FX 2 and have disabled Visual Pinball and Future Pinball, but when i start pinballX there is not pinball fx 2 tables listed!.

Here is my config file

[Display]Monitor=0rotate=0Windowed=FalseWindowWidth=480WindowHeight=720WindowX=0WindowY=65PlayFieldBrightness=230WheelTextColor=ffffffffWheelTextOutlineColor=ff000000InfoTextColor=ffffffffInfoTextOutlineColor=ff000000FilterTextColor=ffffffffFilterTextOutlineColor=ff000000MenuColor=ffffa500[BackGlass]monitor=1x=0y=0width=1280height=1024[DMD]Enabled=Falsemonitor=2x=0y=0width=900height=300[FileSystem]EnableFileMatching=True[Interface]DesktopModeEnabled=TrueEnableAdditionalDetail=TrueShowSystem=TrueShowRatings=True[Audio]StreamVolume=90SampleVolume=90PlaySoundInVideos=True[Startup]playsound=Falseplayvideo=FalseStartWithWindows=No[KeyCodes]quit=27left=37right=39select=13rotate=82pageleft=33pageright=34exitemulator=27ingame=80screenshot=83screenshotbackglass=66instructions=73[JoyCodes]quit=10left=0right=1select=2rotate=3pageleft=4pageright=5exitemulator=6ingame=13instructions=14[Text]Line1=Free PlayLine2=Press Start[FuturePinball]Enabled=FalseWorkingPath=h:\-PINBALL-\-FUTURE PINBALL-TablePath=h:\-PINBALL-\-FUTURE PINBALL-\TablesExecutable=Future Pinball.exeParameters=/open "[TABLEPATH]\[TABLEFILE]" /play /exit /arcaderenderLaunchBeforeEnabled=falseLaunchBeforeWorkingPath=LaunchBeforeExecutable=notepad.exeLaunchBeforeHideWindow=FalseLaunchBeforeWaitForExit=TrueLaunchAfterEnabled=FalseLaunchAfterWorkingPath=LaunchAfterExecutable=notepad.exeLaunchAfterHideWindow=FalseLaunchAfterWaitForExit=TrueMouseClickFocus=True[VisualPinball]Enabled=FalseWorkingPath=h:\-PINBALL-\- VISUAL PINBALL -TablePath=h:\-PINBALL-\- VISUAL PINBALL -\TablesExecutable=VPinball_9_0_2.exeParameters=/play -"[TABLEPATH]\[TABLEFILE]"LaunchBeforeEnabled=falseLaunchBeforeWorkingPath=LaunchBeforeExecutable=notepad.exeLaunchBeforeHideWindow=FalseLaunchBeforeWaitForExit=TrueLaunchAfterEnabled=FalseLaunchAfterWorkingPath=LaunchAfterExecutable=notepad.exeLaunchAfterHideWindow=FalseLaunchAfterWaitForExit=True[ExitScreen]Enabled=TrueEnableExit=TrueEnableShutdown=True[StartupProgram]Enabled=falseWorkingPath=Executable=notepad.exeParamaters=HideWindow=trueWaitForExit=false[ExitProgram]Enabled=falseWorkingPath=Executable=notepad.exeParamaters=HideWindow=FalseWaitForExit=[AttractMode]Enabled=TrueTimer=1ShowFor=15[System_1]Name=Pinball FX2Enabled=TrueWorkingPath=D:\Program Files (x86)\PinballFX2TablePath=D:\Program Files (x86)\PinballFX2\data_steamExecutable=Pinball FX2.exeParameters=LaunchBeforeEnabled=TrueLaunchBeforeWorkingPath=D:\PinballX\ScriptsLaunchBeforeExecutable=Pinball FX2.exeLaunchBeforeHideWindow=FalseLaunchBeforeWaitForExit=FalseLaunchAfterEnabled=TrueLaunchAfterWorkingPath=D:\PinballX\ScriptsLaunchAfterExecutable=ledset.batLaunchAfterHideWindow=TrueLaunchAfterWaitForExit=FalseLaunchBeforeParameters=[TABLEFILE]

My Pinball FX 2 install is installed to D:\Program Files (x86)\PinballFX2

so does anything look out of place in the config file?, i noticed that i didnt have a script folder in my PinballX install folder what should be added to that script folder to get pinball fx 2 working if anything is needed??

thanks for any help

  • 2 weeks later...
Posted

Here's a feature rich version of the table selection script:

1. Launches single player

2. Support for the Super Football sub-menu

3. Strips title bar and borders from a second or third screen DMD

4. Vertical flip DMD for p2k style cabinets via streaming through the localhost loopback

2.

Support for the Super Football sub-menu requires that all the Super Football table game names in the xml begin with the same set of letters unique from other FX 2 tables. Here, I am using "Zen-Football" and then following up with a game name unique to the team.

The team names go into arrayf in the script in the same order as the sub-menu.

Identify the game name for the last Super Football table that you played. The game name should be typed on line 1 in a text file called in the script "FX2LastFootballPlayed.txt'. The script requires this information to move the selector back to the top leftmost item in the sub-menu before moving to the selected table.

Thanks to Gilrock for the array code which makes maintenance a whole lot easier.

Note that in my FX 2 menu layout the highlighted item is always Super Football and not the top leftmost item. I have a few lines of code that brings the selector back to the top leftmost item in the menu. If your menu does start at the top leftmost item then you can comment out the lines between Table = %1% and the array definitions. Then uncomment the lines just after "Move past main menu"

3.

Hiding title bar and borders adapted from ozon's script

4.

If you don't have a p2k cabinet or you have one but don't wish to mess with flipping the image then those lines can be commented out. This is not a turn-key solution and may require a lot of testing to get the display exactly how you want it.

There is a fraction of a second of latency in the streaming. It's not much but it is noticeable. It's very playable as I haven't seen any tables that employ the DMD for video modes.

Configuration requires the following

Windows mmpeg (static build) - http://ffmpeg.zeranoe.com/builds/

Quick installation guide - http://www.wikihow.com/Install-FFmpeg-on-Windows

Screen Capturer Recorder - http://sourceforge.net/projects/screencapturer/files/

Screen Capturer Recorder has some helper tools that require Java. You don't have to keep Java installed but it is helpful to have a Run Time Environment for configuring the capture setup with these helper tools

I'll use my setup as an example:

My DMD screen uses a custom resolution of 768 x 432. In dotmatrix.cfg, I use a width of 728 and a height of 187. As I'm not scaling the output on the stream this doesn't leave a whole lot of room. I set x position to 3855 and y to -8 to further hide some of the border.

Run the Screen Capturer Recorder helper tool "configure by resizing a transparent window". The idea is that you will move this window over the DMD and and drag the borders so that you will capture the entire DMD image. You will want to do this AFTER hiding the title bar and borders using some form of ozon's script. Or you can run this script with the streaming code commented out. Once you start a table and hide the DMD border, Alt-Tab to the Screen Capturer Recorder transparent window and drag it over the DMD. When you save, the tool will auto configure the size and location of the capture window.

The ffplay client window will have a title called "udp://localhost:1234?listen". The WinMove line allows for precisely locating the client window on the third monitor by x and y coordinates. In my case, x=3848 and y=197.

Unfortunately, the same trick for hiding the title bar and borders on the DMD does not work on the ffplay client window. I use ahk GUI to draw a black border to hide the title bar and borders.

"WinSet, Region, 0-0 762-0 762-235 0-235 0-0 14-21 744-21 744-230 14-230 14-21" - the first set of five coordinates draws the outer border of a rectangle. The second set of five coordinates draws the inner border of the rectangle. The hole in the middle will be transparent.

"Gui, Show, W762 H235 X3840 Y205 NoActivate" - moves the border I just drew precisely over the ffplay title bar and borders.
As there is barely enough room on the third screen for both the DMD and its mirror, there is some overlapping going on leaving a little bit of border, an artifact, still showing. I use the GUI command to draw a little rectangle to cover this up.
It requires some trial and error and is definitely kludgy, but if you have a p2k style cabinet, you are going to have to get used to having to do extra tweaking.

Starting up the stream does take focus away from Pinball FX2 and the desktop displays briefly. The script does bring Pinball FX2 back to focus and resumes the game automatically.

This is basically a beta. Right now, the script always launches single player games. I might try to put in a MsgBox to allow users to launch either single player or hotseat, but it might be a while before I get around to it.

I've attached my config files in case that helps

#NoEnv
#SingleInstance force
#WinActivateForce
SetTitleMatchMode 3
DetectHiddenWindows On
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Run, "%SteamDirPath%\Steam.exe" -applaunch 226980,,UseErrorLevel
Process, wait, Pinball FX2.exe
Table = %1% ;Variable from PinballX
Sleep, 11000
Send {Enter Down}, Send {Enter Up}
Sleep, 20
Send {Enter Down}, Send {Enter Up}
Sleep, 500
;Starting position on launch is Zen-Football
Send {Up Down}, Send {Up Up}
Sleep, 20
Loop, 4
{
Send {Left Down}, Send {Left Up}
Sleep, 20
}
array1 := ["TheWalkingDead", "SW-HS", "SW-D", "SW-ANH", "SW-MOTF", "Zen-SWROTJ", "Zen-SWSA"]
array2 := ["Zen-SWDV", "Zen-SWESB", "Zen-SWCW", "Zen-SWBF", "Zen-Football", "Guardians", "Deadpool"]
array3 := ["Zen-DStrange", "Zen-CaptAmer", "Zen-FFour", "Zen-Civil", "Zen-Avengers", "Zen-FearItself", "Zen-InfinityGauntlet"]
array4 := ["Zen-Hulk", "Zen-Thor", "Zen-MoonKnight", "Zen-GhostRider", "Zen-XMen", "Zen-Blade", "Zen-IronMan"]
array5 := ["Zen-SpiderMan", "Zen-Wolverine", "PlantsVsZombies", "Zen-MSplosion", "Zen-EarthD", "Zen-Mars", "Zen-Excal"]
array6 := ["Zen-Para", "Zen-Epic", "Zen-Secrets", "Zen-Biolab", "Zen-Pasha", "Zen-Rome", "Zen-Shaman"]
array7 := ["Zen-Tesla", "Zen-ElDorado", "Zen-V12", "Zen_Sorc", "locked", "locked", "locked"]
arrayf := ["Zen-Football-ZenFC", "Zen-Football-ArsFC", "Zen-Football-LivFC", "Zen-Football-FCBar", "Zen-Football-RealM", "Zen-Football-ACMil", "Zen-Football-ASRom", "Zen-Football-Juven"]
row_index := 0
col_index := 0
table_found := 0
selected_table = %table%
current_table = "locked"
l_table = "locked"
l_row_index := 0
l_col_index := 0
f_table = "locked"
f_row_index := 0
f_col_index := 0
Loop, 7
{
main_loop = %A_Index%
Loop, 7
{
current_table = % array%main_loop%[A_Index]
IfInString, selected_table, %current_table%
{
col_index := A_Index - 1
row_index := main_loop - 1
table_found = 1
;MsgBox, Found table: %current_table% Selected: %selected_table% row: %row_index% col: %col_index%
break
}
}
if( table_found = 1 )
break
}
if( table_found == 1 )
{
; Move past main menus
;Sleep, 11000
;Send {Enter Down}, Send {Enter Up}
;Sleep, 20
;Send {Enter Down}, Send {Enter Up}
;Sleep, 500
; Move down the number of rows
Loop, %row_index%
{
Send {Down Down}, Send {Down Up}
Sleep, 20
}
; Move over the number of columns
Loop, %col_index%
{
Send {Right Down}, Send {Right Up}
Sleep, 20
}
; Select the table
Send {Enter Down}, Send {Enter Up}
Sleep, 1000
if (row_index=1 AND col_index=4) ; Super League Football Sub-menu
{
Send {Up Down}, Send {Up Up}
Sleep, 20
Send {Enter Down}, Send {Enter Up}
Sleep, 500
FileReadLine, last_f_table, %A_WorkingDir%\FX2LastFootballPlayed.txt, 1
Loop % arrayf.MaxIndex()
{
l_table = % arrayf[A_Index]
if( "X" l_table = "X" last_f_table )
{
l_col_index := Mod((A_Index - 1), 3)
l_row_index := Floor((A_Index - 1) / 3)
break
}
}
; Return cursor to position 1
; Move up the number of rows
Loop, %l_row_index%
{
Send {Up Down}, Send {Up Up}
Sleep, 20
}
; Move over the number of columns
Loop, %l_col_index%
{
Send {Left Down}, Send {Left Up}
Sleep, 20
}
Loop % arrayf.MaxIndex()
{
f_table = % arrayf[A_Index]
if( "X" f_table = "X" selected_table )
{
f_col_index := Mod((A_Index - 1), 3)
f_row_index := Floor((A_Index - 1) / 3)
break
}
}
; Move down the number of rows
Loop, %f_row_index%
{
Send {Down Down}, Send {Down Up}
Sleep, 20
}
; Move over the number of columns
Loop, %f_col_index%
{
Send {Right Down}, Send {Right Up}
Sleep, 20
}
Send {Enter Down}, Send {Enter Up}
Sleep, 1000
Send {Down Down}, Send {Down Up}
Sleep, 20
Send {Enter Down}, Send {Enter Up}
FileDelete, %A_WorkingDir%\FX2LastFootballPlayed.txt
FileAppend, %selected_table%, %A_WorkingDir%\FX2LastFootballPlayed.txt
}
else ; All other tables - launch single player
{
Send {Enter Down}, Send {Enter Up}
}
}
; Mirror and flip DMD for P2k
run, ffmpeg -rtbufsize 1500M -f dshow -r 30 -i video="screen-capture-recorder" -vcodec mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,,Hide UseErrorLevel
Sleep, 1000
run, ffplay -an -sn -vf "vflip" -i -fflags nobuffer udp://localhost:1234?listen,,Hide UseErrorLevel
checkprocessagain:
Process, wait, ffplay.exe, 5.5
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
if NewPID = 0
goto checkprocessagain
Process, wait, %NewPID%
Sleep, 2000
IfWinExist udp://localhost:1234?listen
{
WinMove, , , 3848, 197
}
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 762-0 762-235 0-235 0-0 14-21 744-21 744-230 14-230 14-21
Gui, Show, W762 H235 X3840 Y205 NoActivate
; cover an artifact
Gui 2: +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, 2:Color, 000000
WinSet, Region, 0-0 W15 H40
Gui, 2:Show, W15 H40 X3840 Y190 NoActivate
; remove borders from DMD adapted from ozon - https://gist.github.com/ozon/2c3b98161329b583b4a5 Thanks
WinActivate, ahk_class PxWindowClass
IfWinExist Pinball FX2 DotMatrix
{
WinSet, Style, -0xC00000 ; hide title bar
WinSet, Style, -0x800000 ; hide thin-line border
WinSet, Style, -0x400000 ; hide dialog frame
WinSet, Style, -0x40000 ; hide thickframe/sizebox
}
WinActivate, Pinball FX2
WinWaitActive, Pinball FX2
Sleep, 1000
Send {Enter Down}, Send {Enter Up} ;Resume
process, WaitClose, Pinball FX2.exe
Run, taskkill /IM ffplay.exe,,UseErrorLevel
Run, taskkill /IM ffmpeg.exe /F,,UseErrorLevel
ExitApp

By the way, both the DMD and the mirror will be displayed. The idea is that I will cover the source DMD image with a bezel that I can take on and off. I'll probably secure it with magnets. The bezel can stay on most of the time, but it does need to be removable to accommodate reproducing the super size SEGA DMDs like Mary Shelley's Frankenstein or Baywatch.

LaunchFX.zip

  • Like 1
Posted

Update on vertically flipping the DMD image for use in p2k cabinets:

I've reduced latency a little bit more by increasing the capture and streaming framerate.

Requires using the "configure by setting specific screen capture numbers" helper tool for Screen Capturer Recorder.

Enter 120 for "default_max_fps".

The settings are stored in the registry, but it is easier to use the helper tools especially since settings that are at default do not have a key in the registry.

Then swap out the lines that call ffmpeg and ffplay with these lines:

run, ffmpeg -rtbufsize 1500M -f dshow -framerate 120 -r 120 -i video="screen-capture-recorder" -vf "vflip" -vcodec mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,,Hide UseErrorLevel
Sleep, 1000
run, ffplay -an -sn -i -fflags nobuffer udp://localhost:1234?listen,,Hide UseErrorLevel

Increasing the framerate does not appear to appreciably increase the CPU overhead over the default 30 fps.

Again, this is not a turn-key solution. I've found that 60 fps works better on my laptop test bed than 120 fps. And 120 fps worked better to reduce latency in my cabinet than 60 fps. So, it does take some experimentation. It is to the point that I can see what lag is there only when I am looking at the source and mirror image side-by-side. For interacting with the DMD during the game, selecting scenes, etc., I don't notice the lag in my opinion. Or at least it is performing better than the script in the previous post.

I've attached the new script, compiled program, registry settings for Screen Capturer Recorder along with the rest of the supporting files.

LaunchFX.zip

  • Like 2
Posted

@carny

tryed ur scriped all ok but when i choose Sorcerer's Lair it only goes to the walking dead wont got to the botten were Sorcerer's Lair is. and when i choose the one next to it its ok. just wondering if u have that problem.

Posted

Yeah, my script works given that you have purchased all the tables AND the menu always starts with Super League Football selected. I understand not everyone's menu behaves like mine.

And I have not used in the past few days. Who knows if Zen had changed something without warning in the meantime?

Also, your particular hardware configuration may require longer Sleep instructions. What I have posted is just a basis for getting the features working, but it is likely to require tweaking to get it perfect for your setup.

Posted

i changed the sleep and mine starts at football aswell, in ur script were zen_scor is i had to change the _ to - .

Posted

there is one think the script does not close when u exit back to pinballx it runs in background u can see it in the bottom right cornor, how do u kill the script.

Posted

there is one think the script does not close when u exit back to pinballx it runs in background u can see it in the bottom right cornor, how do u kill the script.

No, the script does exit as it should.

AutoHotkey might leave an icon in the system tray but there are no processes remaining active. Rollover it with your mouse and it will disappear. If you want you can customize the behavior of programs in the notification area. Right click on the taskbar and click Properties.

I don't bother because PinballX hides the taskbar anyway.

  • Like 1
Posted

u got any good wheel images but not the square ones cus cant find the other ones like vp wheels,

No, it's not VP. It's Pinball FX2. open6l's wheel images on the FTP were taken from the in-game menu. That's about as official as it gets.

Posted

cant seem to get rid of border around dmd on second screen any pointers for me. or am i missing something.

Posted

Do you have p2k-style cabinet? I assume not and that you have those lines in the script that mirror the DMD commented out. You might try uncommenting the Sleep instructions or trying different Sleep values. AHK has to detect the DMD window in order to get rid of its borders and it's possible that the script is executing those hide instructions before FX 2 has drawn the DMD

Can also try setting SetTitleMatchMode to a value of 2.

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