Warning

This is the dev documentation for an unreleased 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. Unless you’re specifically looking for this version, you probably want to use the version of documentation called “latest” which is for the latest released version of MPF. That documentation is at docs.missionpinball.org/en/latest.

variable_player (example config files)

Machine config examples

Here are some example machine-wide config files that show real-world examples of how these configs are used.

#config_version=5

switches:
    s_counter_target:
        number:
    s_kills_counter_target:
        number:

modes:
  - mode1
  - mode2
  - mode3
  - mode_for_logic_block
  - non_game_mode

Mode config examples

Here are some example mode config files that go along with the machine-wide config above.

Note that there are multiple mode config examples here. You might not necessarily use more than one in your machine.

#config_version=5
mode:
    start_events: start_mode1
    stop_events: stop_mode1
    priority: 200

variable_player:
    test_event1:
        score: 100
        var_a: 1
        var_c: current_player.ramps
    test_set_100:
        test1:
          int: 100
          action: set
    test_set_200:
        test1:
          int: 200
          action: set
    test_set_string:
        string_test:
          action: set
          string: HELLO
    test_set_machine_var:
        my_var:
          int: 100
          action: set_machine
    test_add_machine_var:
        my_var:
          int: 23
          action: add_machine
    player_score:
        my_var2:
          int: change
          action: add_machine
    test_score_mode:
        score: 100
    s_counter_target_active:
        score: 10
    s_kills_counter_target_active:
        score: 100
#config_version=5
mode:
    start_events: start_non_game_mode
    game_mode: False
    priority: 200

variable_player:
  test_event:
    test:
      string: "123"
      action: set_machine
    test2:
      int: 7
      action: add_machine
  "{machine.test5}":
    test6:
      action: set_machine
      string: "{value}-suffix"
#config_version=5
mode:
    start_events: start_mode3
    stop_events: stop_mode3
    priority: 400

variable_player:
    score_player1:
        score:
            int: 42
            player: 1
    score_player2:
        score:
            int: 23
            player: 2
    reset_player2:
        score:
            int: 10
            player: 2
            action: set
    score_float2:
        score:
            float: 2.0
    score_float3:
        score: 100 * current_player.multiplier
    set_float:
        multiplier:
            float: 1.5
            action: set
    set_player7:
        score:
            int: 10
            player: 7
            action: set
    add_player7:
        score:
            int: 10
            player: 7
            action: add
#config_version=5
# actived when all 5 drop targets have dropped
# user wants to continue hitting those
# hitting the special kills the mode
mode:
  start_events: counter_target_complete # from logic_block
  # priority higher that mode1 priority
  priority: 300
  stop_events: s_kills_counter_target_active

variable_player:
  s_counter_target_active:
    score: 100|block
  s_kills_counter_target_active:
    score: 500|block
#config_version=5
mode:
    start_events: start_mode2
    stop_events: stop_mode2
    priority: 300
    restart_on_next_ball: True

variable_player:
    test_event1:
        score: 1000|block
        var_a: 0|block
        var_b: 1
        var_c: current_player.ramps * 10|block
    test_score_mode:
        score:
           int: 1000
           block: true