Jump to content



Photo
- - - - -

Pinball HD Collection working on my cabinet (with table selection in frontend)

autohotkey pinball hd collection frontend table selection

  • Please log in to reply
3 replies to this topic

#1 joyrider3774

joyrider3774

    Hobbyist

  • Members
  • PipPip
  • 22 posts

  • Flag: Belgium

  • Favorite Pinball: fish tales

  • PS3 Gamer Tag: joyrider3774
  • 360 Gamer Tag: joyrider3774

Posted 18 August 2021 - 02:24 AM

Hey i made an autohotkey script to be able to select tables in pinball hd collection game. The script seems to work fine on my cabinet when i tested it and you should be able to use it in any frontend once compiled to an exe:

 

The script works by accepting 1 (table) parameter and then it launches the games, waits for the game to become visible / active and then in the menu it will first move left about 16 times so i know i'm on the 1st table and then depending on the table parameter move right X Number of times to select the correct table. I also remapped keyboard controls as the game buy default comes with no keyboard remapping and no support for joypads as far as i'm aware (although you can use steam input remapping to make a joypad work by assigning keyboard keys to your joypad inside steam input config). One last nasty thing the game has is high score entering screen, you can not input anything using the flipper buttons, the game only accepts Escape to cancel the dialog but this posed a problem as i also use escape with pinballx to quit a game. I found a way around it by using a different button than escape inside to send escape a few times  so it first cancels input, then cancels the high score list then brings up the main menu (so 3x escape) and then pressing enter to play again so it works like a restart button.
 

I tried documenting the script a bit and you will need to change a few values depending on your system (like keyboard shortcuts remapping) and possibly the timeout value for launching the game and becomming visible. I will not provide an executable so you will have to compile the script yourself using autohokey and adapt where needed. You also need to use this launcher script instead of the game's exe to launch the game. The script will remain running as long as the game is running, you can place the script anywhere you'd like. You will also need to make sure the game is running in portrait mode before launching the launcher, i personally use irotate in a launch before and launch after script to  do this. you will also need to start the game once normally from within steam to change the camera style to fixed instead of flyby and exit the game. 

 

 

Table parameters (exactly as written here always in lowercase):

  • wildwest
  • fantasy
  • zombie
  • deep
  • jungle
  • halloween
  • davinci
  • snow
  • arcade
  • pirates
  • redplanet
  • tanks
  • streetracing
  • dreamland
  • mafia
  • vikings

 

you can view a video of it in action here :

 

Here is the script, you need to modify it and adapt to suit your own needs (mostly timeouts & keyboard keys)

; Created by joyrider 3774 18/08/2021 
;--------Run Before (Need to be compiled)----Start------

#SingleInstance force
SetTitleMatchMode, 3
DetectHiddenWindows, On
DetectHiddenText, On

; User inputs
;lower this value if your game loads and displays the main menu faster and you don't want to idle on main menu
;increase if your game starts too slow on your system

WaitBeforeActivate = 3500; before activating the windows if it's found
KeyDelay = 50
SetWorkingDir %A_ScriptDir%


;--------Run Before (Need to be compiled)----End------
 


;From here run your pinball wicked

RegRead, SteamDirPath, HKCU, Software\Valve\Steam, SteamPath

Run, "%SteamDirPath%\Steam.exe" -applaunch 448670


WinWait, Pinball HD Collection ahk_class GPPBWndClass,, 20000
if ErrorLevel
{
    MsgBox, WinWait timed out.
    exitapp
}

Sleep, WaitBeforeActivate

WinActivate, Pinball HD Collection ahk_class GPPBWndClass
;SoundBeep, 500, 500


;Send Enter + assumes correct position
StartGame() {
	global KeyDelay
	
	Send {Enter down}
	Sleep, %KeyDelay%
	Send {Enter up}
	Sleep, %KeyDelay%
	Return
}

GotoFirstTable(X) {
	global KeyDelay
	LoopXCount := (X)
	
	Loop, %LoopXCount%
	{
		Send {Left down}
		Sleep, %KeyDelay%
		Send {Left up}
		Sleep, %KeyDelay%
	}
	Return
}

SelectGame(X) {
	global KeyDelay
	
	GotoFirstTable(17)
	
	LoopXCount := (X)
		
	Loop, %LoopXCount%
	{
		Send {Right down}
		Sleep, %KeyDelay%
		Send {Right up}
		Sleep, %KeyDelay%
	}
	
	Return
}

if (A_Args[1] = "wildwest")
{ 
	SelectGame(0)
	StartGame()
}

if (A_Args[1] = "fantasy")
{ 
	SelectGame(1)
	StartGame()
}

if (A_Args[1] = "zombie")
{ 
	SelectGame(2)
	StartGame()
}


if (A_Args[1] = "deep")
{ 
	SelectGame(3)
	StartGame()
}

if (A_Args[1] = "jungle")
{ 
	SelectGame(4)
	StartGame()
}


if (A_Args[1] = "halloween")
{ 
	SelectGame(5)
	StartGame()
}

if (A_Args[1] = "davinci")
{ 
	SelectGame(6)
	StartGame()
}

if (A_Args[1] = "snow")
{ 
	SelectGame(7)
	StartGame()
}

if (A_Args[1] = "arcade")
{ 
	SelectGame(8)
	StartGame()
}

if (A_Args[1] = "pirates")
{ 
	SelectGame(9)
	StartGame()
}

if (A_Args[1] = "redplanet")
{ 
	SelectGame(10)
	StartGame()
}

if (A_Args[1] = "tanks")
{ 
	SelectGame(11)
	StartGame()
}

if (A_Args[1] = "streetracing")
{ 
	SelectGame(12)
	StartGame()
}

if (A_Args[1] = "dreamland")
{ 
	SelectGame(13)
	StartGame()
}

if (A_Args[1] = "mafia")
{ 
	SelectGame(14)
	StartGame()
}

if (A_Args[1] = "vikings")
{ 
	SelectGame(15)
	StartGame()
}


;SoundBeep, 500, 500

Process, WaitClose, PinballHDCollection.exe

;SoundBeep, 500, 500

ExitApp

;REMOVE EVERYTHING BELOW IF YOU DO NOT WANT CONTROLS REMAPPING

#IfWinActive Pinball HD Collection ahk_class GPPBWndClass
; info about keys can be found here : https://autohotkey.com/docs/KeyList.htm

; in my cab i use the esc key to quit a game but the esc key is also needed to cancel highscore input and return to menu and start new game
; so u see another button C on my cabinet to send 3 times ESC to the game and then return when i am at the high score screen 
c::
	ControlSend ,, {ESC}, Pinball HD Collection ahk_class GPPBWndClass
	Sleep, 750
	ControlSend ,, {ESC}, Pinball HD Collection ahk_class GPPBWndClass
	Sleep, 750
	ControlSend ,, {ESC}, Pinball HD Collection ahk_class GPPBWndClass
	Sleep, 750
	ControlSend ,, {Enter}, Pinball HD Collection ahk_class GPPBWndClass
return

;left flipper on my cabinet is left shift and ingame is left
LShift::Left

;Right flipper on my cabinet is right shift and ingame is right
RShift::Right

;Left Control and Right Control are my extra flipper buttons for nudges ingame up is nudge 
LControl::Up
RControl::Up

;enter key on my cabinet is launch key which is down key ingame
Enter::Down





#2 joyrider3774

joyrider3774

    Hobbyist

  • Members
  • PipPip
  • 22 posts

  • Flag: Belgium

  • Favorite Pinball: fish tales

  • PS3 Gamer Tag: joyrider3774
  • 360 Gamer Tag: joyrider3774

Posted 18 August 2021 - 09:21 PM

Created the media also now which you can grab from here a lot is based on the game assets or just plain renames, the video's are only 1080p as i don't have 4k cabinet:

 

Grab the media from here

https://mega.nz/fold...5pl1x0lsPRSyxVg

 

you can see how it all looks now in video below as well as the dmdext mirroring

 


Edited by joyrider3774, 18 August 2021 - 09:22 PM.


#3 gokwh

gokwh

    Hobbyist

  • Members
  • PipPip
  • 14 posts

  • Flag: ---------

  • Favorite Pinball: usa 94

Posted 02 June 2022 - 10:00 AM

Gracias, buen aporte para los aficionados a pinball o los que recién empezamos como yo. Tengo muchísimas preguntas..-Uso un gabinete y me gustaría integrar el sistema. ¿Cómo haces para girar la pantall? ¿Para mostrar los backglass? Podrías poner una captura de la configuración de Pinball x? Gracias de antemano, se que es un tema de hace un año, pero me llamó la atención y me gustaría integrarlo. SALU2



#4 mdienstl

mdienstl

    Hobbyist

  • Members
  • PipPip
  • 18 posts
  • Location:Marchfeld

  • Flag: Austria

  • Favorite Pinball: Indiana Jones

Posted 04 March 2024 - 12:38 PM

GREAT! Thanks a lot!

Can't wait to get it on my cab too!







Also tagged with one or more of these keywords: autohotkey, pinball hd collection, frontend, table selection