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

This is the documentation for MPF 0.56, 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, which is the most recent version that is not getting new updates.

If you are new to MPF, we have recently rewritten the installation process which only applies to this “latest” 0.56, so you probably want to stay here because the prior installation process doesn’t work on the latest OS and Python versions.


MPF Event

Posted when simpler types of player variables are added or change value.

The actual event has (var_name) replaced with the name of the player variable that changed. Some examples:

  • player_score
  • player_shot_upper_lit_hit

Lots of things are stored in player variables, so there’s no way to build a complete list of what all the options are here. Elsewhere in the documentation, if you see something that says it’s stored in a player variable, that means you’ll get this event when that player variable is created or is changed.

Note that this event is only posted for simpler types of player variables, including player variables that are integers, floating point numbers, or strings. More complex player variables (lists, dicts, etc.) do not get this event posted.

This event is posted for a single player variable changing, meaning if multiple player variables change at the same time, multiple events will be posted, one for each change.

Keyword arguments

(See the Conditional Events guide for details for how to create entries in your config file that only respond to certain combinations of the arguments below.)

If the player variable just changed, this will be the amount of the change. If it’s not possible to determine a numeric change (for example, if this player variable is a string), then this change value will be set to the boolean True.
The player number this variable just changed for, starting with 1. (e.g. Player 1 will have player_num=1, Player 4 will have player_num=4, etc.)
The previous value of this player variable, e.g. what it was before the current value.
The new value of this player variable.

Event is posted by player_vars: