Warning

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.

Match Mode

To use the built-in MPF match mode add this config:

##! mode: match
# in modes/match/config/match.yaml
queue_relay_player:
  match_no_match:
    post: no_match
    wait_for: slide_no_match_slide_removed
    pass_args: true
  match_has_match:
    post: has_match
    wait_for: slide_match_slide_removed
    pass_args: true
mode_settings:
  non_match_number_step: 10
slide_player:
  no_match:
    no_match_slide:
      expire: 3s
  has_match:
    match_slide:
      expire: 3s
sound_player:
  match_no_match:
    no_match_sound:
      action: play
  match_has_match:
    match_sound:
      action: play
slides:
  match_slide:
    - type: text
      text: MATCH
    - type: text
      text: "Player 1: (match_number0)"
    - type: text
      text: "Player 2: (match_number1)"
    - type: text
      text: "Player 3: (match_number2)"
    - type: text
      text: "Player 4: (match_number3)"
    - type: text
      text: "Match number: (winner_number)"
  no_match_slide:
    - type: text
      text: NO MATCH
      font_size: 12
      anchor_y: bottom
    - type: text
      text: "Player 1: (match_number0)"
    - type: text
      text: "Player 2: (match_number1)"
    - type: text
      text: "Player 3: (match_number2)"
    - type: text
      text: "Player 4: (match_number3)"
    - type: text
      text: "Match number: (winner_number)"

This example is tested to be valid MPF and MPF-MC config. Additionally, our integration test passed. Click to show the test and full config.
##! mode: match
# in modes/match/config/match.yaml
queue_relay_player:
  match_no_match:
    post: no_match
    wait_for: slide_no_match_slide_removed
    pass_args: true
  match_has_match:
    post: has_match
    wait_for: slide_match_slide_removed
    pass_args: true
mode_settings:
  non_match_number_step: 10
slide_player:
  no_match:
    no_match_slide:
      expire: 3s
  has_match:
    match_slide:
      expire: 3s
sound_player:
  match_no_match:
    no_match_sound:
      action: play
  match_has_match:
    match_sound:
      action: play
slides:
  match_slide:
    - type: text
      text: MATCH
    - type: text
      text: "Player 1: (match_number0)"
    - type: text
      text: "Player 2: (match_number1)"
    - type: text
      text: "Player 3: (match_number2)"
    - type: text
      text: "Player 4: (match_number3)"
    - type: text
      text: "Match number: (winner_number)"
  no_match_slide:
    - type: text
      text: NO MATCH
      font_size: 12
      anchor_y: bottom
    - type: text
      text: "Player 1: (match_number0)"
    - type: text
      text: "Player 2: (match_number1)"
    - type: text
      text: "Player 3: (match_number2)"
    - type: text
      text: "Player 4: (match_number3)"
    - type: text
      text: "Match number: (winner_number)"

##! test
start_game
advance_time_and_run 5
assert_mode_not_running match
drain_all_balls
advance_time_and_run 5
drain_all_balls
advance_time_and_run 5
drain_all_balls
advance_time_and_run .1
assert_mode_running match
advance_time_and_run 5
assert_mode_not_running match

You can extend the slides. See the two events below for available paramters.

Related Events
match_has_match
match_no_match
Related How To guides
How to design a game in MPF using Modes