This is the documentation the latest work-in-progress version of MPF!

This is the documentation for MPF 0.57, which is the “dev” (next) release of MPF that is a work-in-progress. This is probably ok, and means you’ll be on the latest, cutting-edge version of MPF.

However, if you want a more stable version, select the v:stable version from the lower-left corner of this page. You can always update to the latest at any time.

Machine Variables

MPF uses the concept of machine variables to track dynamically- created variables that apply on a machine-wide basis. Machine variables are similar in concept to player variables, except machine variables are machine-wide instead of per-player. Examples of things that are stored in machine variables include:

  • The number of credits on the machine (if you’re using the credits mode and not set to free play)
  • The scores of the last game played (which are typically shown in the attract mode display loop)
  • The names and scores of the high scores (which are also shown in the attract mode display loop and in the “status” screen when a player holds a flipper button in during a game).

Machine variables can be set to persist, meaning they are saved to disk and available to MPF the next time it boots up. (For example, if you first turn on a pinball machine, it will still show the scores of the last game played in the attract mode.) These machine variables are stored in the <your_machine_folder>/data/machine_vars.yaml file. Machine variables that are saved to disk can optionally be written with an expiration time which means they’re cleared out if MPF boots after the time has passed. (For example, the number of credits on the machine might only persist for a few hours.)

Like player variables, you can use machine variables in your config files, particularly in text display widgets, to show things on your display.

Video about player and machine variables:

You can create your own machine variables in your configs. There are also several machine variables that are automatically created. Here’s a list of the machine variables that are “built in” and available for use in your configs: