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

Allrighty, I tried to compile the following script:

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#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, "C:\Program Files (x86)\Microsoft Game Studios\Pinball FX2\Pinball FX2.exe" "%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

I also copied your System_1 to my .ini. When I select a table (or run the script outside of PinballX) it attempts to loads FX2 but crashes instantly saying it cannot respond. Ideas? Do my script look good?

Posted

If you are compiling to an executable, I'd set it to run as administrator.

I'd set Pinball FX2.exe to run as administrator also.

If you open a cmd window and navigate to where the Pinball FX2 executable is and then run Pinball FX2.exe "your table name", does it work then?

Perhaps the non-Steam version does not yet support launching tables from the command line. If not, then you may want to incorporate NukeLauncher into the script.

Are you using the table names as they appear in the data_steam folder or whatever the equivalent is for the non-Steam version? This is the folder with the pxp files.

  • 6 months later...
Posted

I know this is an older topic but I was wondering if you could help. I seem to have an issue with Pinball X and backglass / dmd videos freezing whenever i need to rotate my playfield screen for pinball arcade.

There are no problems at all with videos continuing to play while launching and playing The Pinball Arcade or anything else.... but only if I don't have to rotate the PF screen as a "Launch-before". TPA is the only thing I need to do a rotation for.

I have tried using Pinball X's auto rotate as well as my own method using mutlitmonitor tool. Still images look fine after being rotated, but any videos used seem to freeze upon rotating. It seems like PBX loses focus like you said. When I exit the game and come back PBX videos are good to go again.

I have tried LAV, ffdshow, native Windows 10 codecs.... no change.

Has anyone else out there had luck with rotating your PF and not having your videos freeze in the backglass or dmd?

Posted

I'd suggest waiting until Tom remedies the other issue you reported with the rotation issues as it may also fix this.

Since this is an old thread, I am locking it accordingly. Please open a new thread with the required files if still an issue after Tom issues an update. Thanks.

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