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.

achievement (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:
    test:
        number:

lights:
  led1:
    number:
  led2:
    number:
  led4:
    number:
  led5:
    number:
  led6:
    number:

modes:
  - base
  - mode1
  - auto_select

shows:
  achievement1_enabled:
    - time: 1
  achievement1_started:
    - time: 1
  achievement1_completed:
    - time: 1
  achievement1_disabled:
    - time: 1
  achievement1_stopped:
    - time: 1

  achievement2_disabled:
    - time: 1
      lights:
        (led): off
  achievement2_enabled:
    - time: 1
      lights:
        (led): yellow
  achievement2_started:
    - time: 1
      lights:
        (led): green
  achievement2_stopped:
    - time: 1
      lights:
        (led): red
  achievement2_completed:
    - time: 1
      lights:
        (led): blue

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: 100

achievement_groups:
    mode1_ag1:
        achievements: mode1_a1, mode1_a2
        events_when_no_more_enabled: enable_all
        auto_select: yes
        debug: True
#config_version=5
mode:
    start_events: ball_starting
    priority: 100

achievements:
  achievement1:
    start_events: achievement1_start
    stop_events: achievement1_stop
    enable_events: achievement1_enable
    disable_events: achievement1_disable
    complete_events: achievement1_complete
    reset_events: achievement1_reset
    show_when_disabled: achievement1_disabled
    show_when_enabled: achievement1_enabled
    show_when_started: achievement1_started
    show_when_stopped: achievement1_stopped
    show_when_completed: achievement1_completed
    restart_on_next_ball_when_started: True

  achievement2:
    start_events: achievement2_start
    stop_events: achievement2_stop
    enable_events: achievement2_enable
    disable_events: achievement2_disable
    complete_events: achievement2_complete
    reset_events: achievement2_reset
    events_when_started: test_event, test_event2
    show_when_enabled: achievement2_enabled
    show_when_started: achievement2_started
    show_when_completed: achievement2_completed
    restart_after_stop_possible: False
    enable_on_next_ball_when_enabled: False
    show_tokens:
      led: led1

  achievement3:
    start_events: achievement3_start
    stop_events: achievement3_stop
    enable_events: achievement3_enable
    disable_events: achievement3_disable
    complete_events: achievement3_complete
    reset_events: achievement3_reset
    events_when_started: test_event, test_event3
    show_when_disabled: achievement_disabled
    show_when_enabled: achievement_enabled
    show_when_started: achievement_started
    show_when_stopped: achievement_stopped
    show_when_completed: achievement_completed
    restart_after_stop_possible: False

  achievement4:
    start_events: achievement4_start
    stop_events: achievement4_stop
    enable_events: achievement4_enable
    disable_events: achievement4_disable
    complete_events: achievement4_complete
    reset_events: achievement4_reset
    show_when_disabled: achievement_disabled
    show_when_enabled: achievement_enabled
    show_when_started: achievement_started
    show_when_stopped: achievement_stopped
    show_when_completed: achievement_completed
    show_when_selected: achievement_selected
    show_tokens:
          led: led4

  achievement5:
    start_events: achievement5_start
    stop_events: achievement5_stop
    enable_events: achievement5_enable
    disable_events: achievement5_disable
    complete_events: achievement5_complete
    reset_events: achievement5_reset
    events_when_started: test_event, test_event5
    show_when_disabled: achievement_disabled
    show_when_enabled: achievement_enabled
    show_when_started: achievement_started
    show_when_stopped: achievement_stopped
    show_when_completed: achievement_completed
    show_when_selected: achievement_selected
    show_tokens:
          led: led5

  achievement6:
    start_events: achievement6_start
    stop_events: achievement6_stop
    enable_events: achievement6_enable
    disable_events: achievement6_disable
    complete_events: achievement6_complete
    reset_events: achievement6_reset
    events_when_started: test_event, test_event6
    show_when_disabled: achievement_disabled
    show_when_enabled: achievement_enabled
    show_when_started: achievement_started
    show_when_stopped: achievement_stopped
    show_when_completed: achievement_completed
    show_when_selected: achievement_selected
    show_tokens:
          led: led6

  achievement7: {}

  achievement8: {}

  achievement9: {}

  achievement10:
    debug: True

  achievement11:
    debug: True

  achievement12:
    enable_events: enable_achievements

  achievement13:
    enable_events: enable_achievements

  achievement14: {}

  achievement15: {}

  achievement16: {}

  achievement17: {}

  mode1_a1:
    enable_events: enable_all
    start_events: start_all
    stop_events: stop_all
    complete_events: complete_all

  mode1_a2:
    enable_events: enable_all
    start_events: start_all
    stop_events: stop_all
    complete_events: complete_all

achievement_groups:
    group1:
        achievements: achievement7, achievement8, achievement9
        auto_select: true

    group2:
        achievements: achievement4, achievement5, achievement6
        enable_events: group2_enable
        disable_events: group2_disable
        start_selected_events: group2_start
        select_random_achievement_events: group2_random
        rotate_right_events: group2_rotate_right
        rotate_left_events: group2_rotate_left

        disable_while_achievement_started: False
        enable_while_no_achievement_started: False

        events_when_all_completed: group2_complete
        events_when_no_more_enabled: group2_no_more
        events_when_enabled: group2_enabled

        show_when_enabled: group2_show
        show_tokens:
          led: led2

    group3:
        achievements:
          - achievement10
          - achievement11
          - achievement12
          - achievement13
        auto_select: yes
        debug: True

    group4:
        debug: True
        achievements: achievement14, achievement15, achievement16
        enable_events: group4_enable
        disable_events: group4_disable
        start_selected_events: group4_start
        select_random_achievement_events: group4_random
        rotate_right_events: group4_rotate_right
        rotate_left_events: group4_rotate_left
        events_when_all_completed: group4_complete
        events_when_no_more_enabled: group4_no_more
        events_when_enabled: group4_enabled
        allow_selection_change_while_disabled: True
        auto_select: True

shows:
  group2_show:
    - duration: .1
      lights:
        (led): red
    - duration: .1
      lights:
        (led): blue
  achievement_enabled:
    - duration: 1
      lights:
        (led): yellow
  achievement_disabled:
    - duration: 1
      lights:
        (led): off
  achievement_completed:
    - duration: 1
      lights:
        (led): blue
  achievement_started:
    - duration: 1
      lights:
        (led): green
  achievement_stopped:
    - duration: 1
      lights:
        (led): red
  achievement_selected:
    - duration: 1
      lights:
        (led): orange
#config_version=5
mode:
    start_events: start_mode2
    stop_events: stop_mode2
    priority: 100

achievements:
  spinTasticAward:
    complete_events: mode_spinTasticAward_stopped
    reset_events: reset_bonusAwards
    debug: True

  tagTeamAward:
    complete_events: mode_tagTeamAward_stopped
    reset_events: reset_bonusAwards
    debug: True

  doubleChanceAward:
    complete_events: mode_doubleChanceAward_stopped
    reset_events: reset_bonusAwards
    debug: True

  extraBallAward:
    complete_events: extraBallAwardIntro_complete
    reset_events: reset_bonusAwards
    debug: True

  prodigiousPopsAward:
    complete_events: mode_prodigiousPopsAward_stopped
    reset_events: reset_bonusAwards
    debug: True

achievement_groups:
  bonus_awards:
    achievements:
      - doubleChanceAward
      - extraBallAward
      - prodigiousPopsAward
      - tagTeamAward
      - spinTasticAward
    auto_select: true
    enable_while_no_achievement_started: false
    rotate_right_events: sw_pops, s_spotTarget_active
    allow_selection_change_while_disabled: true
    disable_while_achievement_started: false
    start_selected_events: start_event
    disable_events: disable_bonus
    enable_events: enable_group
    debug: True