The Virtual Pinball (VPX) Platform
Related Config File Sections:
This can be useful for software and hardware development. To use the VPX platform you need to install it, along with the MPF-VPX bridge and add some VPX scripts to your VPX table.
The bridge will connect to the running MPF machine when you start your VPX table. As the VPX table is used only to emulate the hardware and should not contain any game logic.
Copy the file
register_vpcom.py to your local machine folder. To
register the bridge run a CMD shell as Administrator, then
python register_vpcom.py --register
(You can use
--unregister to uninstall the bridge)
Use VPX in MPF
config.yaml configure virtual_pinball as your platform:
or if you already have physical hardware configured start MPF with the
--vpx commandline option (similar to
mpf both --vpx
In VPX you need to adjust your script to talk to MPF. You can also looks this up in the example project inside the bridge repository. The GameName set in VPX is not used to check or validate the MPF machine.
Setup controller and timers
Set Controller = CreateObject("MPF.Controller")
- add a Timer
MPFTimerwith an interval of 10 to 50ms. Keep this well below the minimal
default_pulse_msset in MPF for solenoids
- add a
Sub MPFTimer_Timerto update all the lights and solenoids
- call Controller.run
- set the Trough switch(es) or create balls for a physical Trough (as in the demo table)
- init NC switches to False
In Drain_Hit (for 1-Ball games)
- set the Trough switch(es)
To use autofire_coils (Slings, Pops etc)
- add a droppable wall to each bumper. This will be used in
Sub CheckAutofireCoilsto disable/enable the bumper
- if necessary place an invisible wall behind the slingshots to stop the ball once the slingshots are disabled
- add each autofire object in VPX to
- use the normal
Switch_Hit/_Unhitevents. Use "" to include string type numbers
Switch_Hitevent of targets, slingshots and bumpers
Controlled Lights (all types)
- create a collection "ControlledLamps"
- assign all controlled VPX lamps (Matrix, GI, LED, Flashers) to the
collection "ControlledLamps" and call
LEDs and Lamps
Sub UpdateLampsadd a case for every MPF light and LED number, setting the state of the VPX lamp/LED. Use "" to include string type numbers
- create a collection for each GI string, assign the GI lamps to the collections as needed
- assign all GI lamps to the collection "ControlledLamps" and
Sub UpdateGIadd a case for every MPF gi string number, setting the state of the VPX GI collection. Use "" to include string type numbers
- assign all flasher lamps to the collection "ControlledLamps" and
Sub UpdateFlashersadd a case for every MPF flasher number, setting the state of the VPX flasher. Use "" to include string type numbers
- add all normal solenoids to the
Sub InitSolenoids, to initialize them as
Sub UpdateSolenoidsadd a case for every MPF coil number, setting the state of the VPX solenoid. Use "" to include string type numbers
- add the Flipper routines (
KeyUp/KeyDown) as in the demo table. Flippers are handled as autofire coils and can be enabled/disabled using hrdware rules.
To run a game
- start VPX as Administrator
- start MPF, wait until the display has been initialized
- start VPX table
To exit a game shut down the VPX table first
What if it did not work?
Have a look at our hardware troubleshooting guide.
Something missing or wrong? You can fix it!
This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?
Please help us! You can fix it yourself and be an official "open source" contributor!
It's easy! See our Beginner's guide to editing the docs.
Page navigation via the keyboard: < >
You can navigate this site via the keyboard. There are two modes:
General navigation, when search is not focused:
- F , S , / : open search dialog
- P , , : go to previous page
- N , . : go to next page
While using the search function:
- Down , Up : select next / previous result
- Esc , Tab : close search
- Enter : go to highlighted page in the results