PinballX Launching NoxPlayer
So I managed to upload a quick video of what im up to so far. Here's the rundown
1. Pinball X Launches
2. Im able to select my arcade table from the menu
3. Loading screen appears (then as you will notice eventually flips on its side - Screen rotation kicking in)
4. NoxPlayer appears in Full Screen shows an annoying random advertisement (Trying to figure out how to get rid of this if possible? or Hide it behind Loading screen?)
5. NoxPlayer Opens and you can briefly see the Android Emulator before it launches the Game (Also want to hide if I can...)
6. Playing the game, as you can see im still using the mouse at the moment, this will eventually be configured for Joystick (So ill need to hide the mouse cursor)
So whats going on in the backgound….
Starting with the Software: Im running (Pinball X, Visual Pinball, Pinball FX2, Nox Player and iRotate)
Everything has been installed and is running off my G Drive.
Here is the current settings in Pinball X
As you can see I have some Powershell scripts and Batch files doing all the work for me. Ill post these up for everyone to use.
There was some back and forth checking the log files to see how this all worked, heres a snippet of the log files.
Starting with Launch Before
The Batch file simply calls another Powershell script within the same directory called Rotate_Nox.ps1
/k "cd /d G:\PinballCabinet\PinballX\Scripts" & Powershell -file .\Rotate_Nox.ps1
Rotate_Nox.ps1 is shown below, as you can see this script is where the monitor rotation occurs. It then Proceeds to Launch NoxPlayer (The Fullscreen code in this script may not actually work, I need to review this and update the code accordingly)
#Rotating Screen
Start-Process -WorkingDirectory "G:\Program Files (x86)\iRotate" -FilePath ".\iRotate.exe" -ArgumentList "/rotate=90"
Sleep 2
#Launch Nox
Start-Process -WorkingDirectory "G:\Program Files\Nox\bin" -FilePath ".\Nox.exe" -ArgumentList "-screen:vertical -resolution:768x1360"
#Fullscreen
$wshell.SendKeys('^4')
Now on to Launching the System 2:NoxPlayer
I made a copy of cmd.exe and pasted it in the working directory for the NoxPlayer, I then used this to launch the Powershell script.
You will notice that im parsing an external paremeter into my Powershell script which I will try explain as best as I can. First you need to see the script.
The first few lines is where we obtain our external parameter which is the ID for the android application
State Package Name: This was used in earlier stages to troubleshoot, to ensure the Android ID was being seen correctly by Powershell
Initialise Keyboard: This enables me to execute keyboard commands
Rotating Screen: You may be wondering why this appears again....(Good observation, it may not be required)
Launch Android Game: Telling Powershell where Nox is installed, what executable to run followed by Vertical Mode, my current resolution and the package (Android ID)
Fullscreen: Remember I enabled the keyboard commands...after sleeping for 20sec it will send a CTRL + 4 command and put Nox in Full Screen (This needs work because I believe sometimes this command executes before Nox has loaded the game)
Param([parameter(Mandatory=$true,
HelpMessage="Enter name and key values")]
$TABLEFILE)
Sleep 20
#State Package Name
Write-Host $TABLEFILE
#Initialise Keyboard
$wshell = New-Object -ComObject wscript.shell;
#Rotating Screen
Start-Process -WorkingDirectory "G:\Program Files (x86)\iRotate" -FilePath ".\iRotate.exe" -ArgumentList "/rotate=90"
Sleep 2
#Launch Android Game
Start-Process -WorkingDirectory "G:\Program Files\Nox\bin" -FilePath ".\Nox.exe" -ArgumentList "-screen:vertical -resolution:768x1360 -package:$TABLEFILE"
sleep 20
#Fullscreen
$wshell.SendKeys('^4')
So how am I passing the TABLEFILE when this is not a VPX table?
Simple, all my Pinball tables currently live in the folder G:\Pinball Cabinet\Visual Pinball\Tables\
My Arcade "DUMMY FILES" sit in G:\Pinball Cabinet\Visual Pinball\Tables\Arcade
Lets use Crossy Road as an example, I opened notepad clicked Save As and changed the Save as Type to All Files and used the name "com.yodo1.crossyroad" Sure its not a real file but it works.
So when Pinball X runs the command line im able to parse the TABLEFILE into the Powershell script so NoxPlayer knows what game it needs to launch.
Im also able to manage my games in the Games List Manager
Launch After
So When I push Q to quit the game the following script is launched with Powershell Nox_Skill.ps1
iRotate kicks in again and rotates the monitor back to normal
The Nox Processes are then killed off to Allow PinballX to be in focus once again for menu selection.
#Rotating Screen
Start-Process -WorkingDirectory "G:\Program Files (x86)\iRotate" -FilePath ".\iRotate.exe" -ArgumentList "/rotate=0"
#Killing Nox
Stop-process -name Nox
Stop-Process -name NoxVMSVC
This is all I have for now, I will update this as I go, and of course if anyone has any recommendations or tips for me on how I can do anything better, please don't hesitate to let me know.
If you have any further questions about my setup im also happy to try and help you out.