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

[RESOLVED] Borderless_DMD script for PFX2 not working through PinballX launch?


Recommended Posts

Posted

Hi all,

I have been setting up PFX2 in PinballX using the new direct table command line launch method. I should clarify I am using a 2 monitor cabinet.

Tables are setup individually and loading nicely using the following settings

post-28879-0-31391200-1436272945_thumb.p

and this Pinball FX2.xml file in C:\Program Files (x86)\PinballX\Databases\Pinball FX2

I am using PinballX to load Namsan's animated PFX2 backglasses in .mp4 format which are loading and working great

I would also recommend Draco's Wheel Images for anyone interested.

I have moved the DMD to my second (backglass) monitor using dotmatrix.cfg

The last piece of the puzzle requires the use of an AutoHotkey script to remove the frame/title/window/buttons around the DMD ... ie Borderless_DMD script

And here is my problem ... when I launch PFX2 on its own the script works beautifully giving you a nice clean DMD but when I launch PFX2 tables through PinballX the script doesn't work and I am left with the ugly framed DMD!

Is anyone else experiencing this problem?

Posted

Ok I have done some more trouble shooting and have narrowed down the problem a bit more ... I should also add (if you didn't notice from my PFX2 preferences posted above) that I use Xpadder to map button inputs on my cabinet.

I have managed to get the Borderless_DMD script to work through direct table launching in pinballX but I need to have the script setup in the "Launch Before" section of the "Pinball FX2" PinballX settings for it to work, which is where I normally have Xpadder setup!

So I currently can have Borderless DMD but no button controls or button controls with very ugly framed DMD!

How can I setup both Borderless_DMD script and Xpadder to launch in the Pinball FX2 "Launch Before" preferences ???

Any suggestions / help would be greatly appreciated?

Posted

Likely you will need to run them via a batch file, then place the name of the batch file (i.e prelaunch.bat) or compile an ahk script and plug the file name in the Launch Before section.

  • Like 1
Posted

I have been trying exactly that :) ... i started with a batch file and then realized there is no point when the Borderless_DMD already requires a AutoHotKey script.

So I added Xpadder launch to the Borderless_DMD script which works fine for the launch of the first PFX2 table but when you go to exit and load another PFX2 table you run into problems.

The script needs to be able to deal with an open/existing session of the script and Xpadder.

I haven't done AutoHotKey scripting before and getting the script to work correctly for exiting and loading multiple PFX2 tables is proving to be a headache.

If anyone has a working script for this function or can help in putting it together I would be very grateful :)

Posted

What happens when you launch Xpadder via the batch file with it not included within the AHK script?

Posted

Ok I have resolved the problem as Draco suggested I left the AHK scripting and went back to working on a batch file to launch both xpadder and the borderlessDMD AHK script.

Its weird, to get it working correctly I had to put an instance check in for the borderlessDMD script but not for xpadder.

Anyway, it is all working smoothly now

For anyone else having the same problem here is the batch script code I am using. I am not a programmer just pieced it together with google's help so probably not very elegant coding but it does the job :)

Create a txt file, paste this code/txt into it, and change the file extension to .bat and you have your batch file ;)

@echo offcd "C:\Program Files (x86)\xpadder"start Xpadder.exe"tasklist | find "Borderless_DMD.exe"if errorlevel 1 goto :Borderless_DMD:Endexit:Borderless_DMDcd "C:\Program Files\AutoHotkey" start Borderless_DMD.exegoto :End
  • Like 2
Posted

Thanks for the tip! I compiled the script and it works well.. except for the fact that it interferes with the next game if you are using Steam because it tries to load the Borderless_DMD.exe again for the next table. Have you encountered any similar issues?

I am not running Xpadder at the moment and using a 360 controller. I created a .bat file to kill the Borderless_DMD32.exe to Launch After.

@echo offTASKKILL /F /IM "Borderless_DMD32.exe"exit

Seems to work OK this way, but it would be nicer to have only one thing running using #Singleinstance force or #Singleinstance ignore in the AHK script which I cannot seem to get to work with only one instance. My guess this is why you have the instance check in your .bat file.

Posted

I am not running using steam but launching the game exe directly in which case my bat file has been working fine. I haven't had the need to test the launch through steam, sorry.

For those interested, I have re rendered Namsan's Pinball FX2 animated backglasses with grill and uploaded them to youtube for download.

Please note they have been uploaded at 1080p, if you are only seeing 360p in Firefox this is due to a Firefox bug (as I have just discovered myself) switch to Chrome and you will see up to 1080p :)

Set Pinball FX2 DMD to width = 762 height = 157 for aspect ratio without any distortion.

Additional PFX2 resources like 1080x1920 Table Images and other files here for anyone interested.

  • Like 1
Posted

Thanks for the tip! I compiled the script and it works well.. except for the fact that it interferes with the next game if you are using Steam because it tries to load the Borderless_DMD.exe again for the next table. Have you encountered any similar issues?

I am not running Xpadder at the moment and using a 360 controller. I created a .bat file to kill the Borderless_DMD32.exe to Launch After.

@echo offTASKKILL /F /IM "Borderless_DMD32.exe"exit

Seems to work OK this way, but it would be nicer to have only one thing running using #Singleinstance force or #Singleinstance ignore in the AHK script which I cannot seem to get to work with only one instance. My guess this is why you have the instance check in your .bat file.

Are you using my script? I put in that instance check in for that same reason, the script checks for an existing instance of "Borderless_DMD.exe" and does nor run it again if it already exists. Is the check not working for you? I noticed looking at your script you have named your AHK script "Borderless_DMD32.exe"? If that is the case then you need to change the instance check to "Borderless_DMD32.exe" for it to work?

Posted

Thanks for the share. When I went to grab from YouTube, the max format size to download is showing as 720p.

As for the .bat file, I did change the name to reflect the name I used, but it did not work. Since I am not using Xpadder presently, it could be that I fat fingered my script initially trying to remove the xpadder section. I will take another look at it later today.

Posted

This is what I scripted for my setup. I use antimicro to map a joystick to keys instead of xpadder but I'm thinking the way you might run xpadder would be similar. Just swap out the lines. I have key 'e' setup to end the session.

I have a Pinball 2000 style cab so in order to reverse the image for me to project the DMD onto the playfield I capture and stream the DMD display with ffmpeg. Anything dealing with that can be commented out if you don't need the feature.

The script is what actually launches PFX2 via Steam. PinballX launches the script. It's never really worked for me to try to have PBX itself launch anything from Steam. I always have to code a script and have PBX launch the script. This requires the later versions of PFX2 that support launching a table directly from a command line (bypassing the main menu).

I did a tweak on the code that hides the DMD title bar and borders. It only executes when the Dot Matrix window exists. No need to kill a separate program or have something sitting in memory taking up resources.

#NoEnv
#SingleInstance force
#WinActivateForce
SetTitleMatchMode, 3
DetectHiddenWindows, On
; User inputs
antimicro_Path=c:\antimicro
FFMPEG_Path=c:\ffmpeg\bin
RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath
Table=%1% ;Variable from PinballX
Run, %antimicro_Path%\antimicro --no-tray --hidden --profile "%antimicro_Path%\profiles\VP.joystick.amgp"
; Mirror and flip DMD for P2k
Run, %FFMPEG_Path%\ffmpeg -f gdigrab -framerate 120 -offset_x 5761 -offset_y 0 -video_size 1599x428 -i desktop -vf "vflip" -c:v mpeg4 -qscale:v 1 -f mpegts -threads 8 udp://localhost:1234,, Hide
Sleep, 1000
Run, %FFMPEG_Path%\ffplay -an -sn -vf "curves=r='0.149/0.066 0.831/0.905 0.905/0.98':g='0.149/0.066 0.831/0.905 0.905/0.98':b='0.149/0.066 0.831/0.905 0.905/0.98'" -i -fflags nobuffer udp://localhost:1234?listen,, Hide
Loop, 2
{
checkwindowagain:
IfWinExist, udp://localhost:1234?listen
WinMove, udp://localhost:1234?listen,, 5760, 404
Else
Goto, checkwindowagain
}
; draw a black border to hide the window borders for the mirror
Gui +LastFound +AlwaysOnTop -Caption +ToolWindow
Gui, Color, 000000
WinSet, Region, 0-0 1606-0 1606-455 0-455 0-0 4-23 1602-23 1602-451 4-451 4-23
Gui, Show, W1606 H455 X5760 Y404 NoActivate
Run, "%SteamDirPath%\Steam.exe" -applaunch 226980 "%Table%"
WinWait, Pinball FX2 DotMatrix
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
}
Process, WaitClose, Pinball FX2.exe
Run, taskkill /im antimicro.exe /f,, Hide
Run, taskkill /im ffplay.exe,, Hide
Run, taskkill /im ffmpeg.exe /f,, Hide
Gui, Destroy
ExitApp
#IfWinActive ahk_class PxWindowClass
; Exit Table
e::
Gosub killApp
Return
#IfWinActive
killApp:
Send {Esc}
Sleep, 500
Loop, 4
{
Send {Down}
Sleep, 20
}
Send {Enter}
Sleep, 20
Send !{f4}
Return

Posted

OK a complication regarding the video files on YouTube ...

It turns out YouTube are now serving some of their streams including 1080p in a new format called DASH or Dynamic Adaptive Streaming over HTTP which is an adaptive bit rate streaming technology over a new HTML 5 player involving a separate video and audio stream that I was not aware of. Chrome supports the new changes hence you can see all the streams in the browser but Firefox does not as yet so you only see the 360p stream. You can install an extension in Firefox called "YouTube Flash Video Player" which lets you switch to using a YouTube flash player rather than the newer HTML 5 that is not yet fully supported and then you can see all the streams as you use to in Firefox and that you can see in Chrome.

Regarding capture or download the problem is that we generally use 3rd party browser extensions / plugins or apps to grab video/audio from YouTube and unfortunately from what I can tell from looking around online the authors of these have not yet updated their software to deal with the new DASH streaming format. Every extension / plugin or app I have tested tonight, and I have tested over a dozen do not support DASH capture yet. I guess it is just a matter of time but the closest I came across is a Firefox extension called "Complete YouTube Saver" that looks to incorporate DASH capture support but I was unable to grab the 1080p versions of my uploaded videos even though I can view the 1080p stream.

I would suggest YouTube downloaders will be updated soon and it will be back to business as usual :)

Posted

No problem, I will upload my re rendered backglasses with grill for 2 screen setups to FTP.

I just had a look at FTP and the 3 screen original backglasses are there and I noticed the file size for many of them is between 30 to 40MB. The source files I used were 1080p mp4 downloaded from YouTube that were 10 to 15MB in size. I set my renders to around 20MB to not loose any quality. Have a look and compare the quality of my 2 screen backglass renders to the original on FTP and if there is significant difference it might be worth re rendering with the larger source files?

  • Like 1
Posted

If you don't mind, can you alone upload a copy of the backglass grill image formatted to 1920 width? I have a few ideas for still images that I would like to use with the grill as part.

Posted

These all look pretty good! I can't wait to incorporate the them and the rest into my collection! You may want to try a larger source to compare with a few just to see if it makes any difference, but even if you don't, these are great! Onnce you get the DMD coordinates figured out it looks pretty cool!

Posted

Ok re rendered backglasses with grill for 2 screen setups have been uploaded to FTP under the path -> /-PinballX-/Media/PinballFX2/Backglass Videos/Backglass Videos 2 Screens

I have also uploaded a file called "Grill.png" into the same folder which is the grill template I used.

Can I get FTP access to download some of the original backglasses on the FTP to compare video quality with the YouTube source files I used?

Posted

For those who don't have access to the FTP and are having trouble downloading from YouTube I have uploaded the backglasses with grill videos here with the additional resources.

Posted

Small update ...

I made still image backglasses with grill for the tables missing Namsan animated backglasses

MARVEL_Ant-Man.png
Portal.png
STARWARS_Rebels.png

added 1080x1920 Table Image for MARVEL_Ant-Man

Draco had already made MARVEL_Ant-Man wheel image which is already there

Also added MARVEL_Ant-Man to Pinball FX2.xml

stuff uploaded here for any interested

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