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.

multiball (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

game:
    balls_per_game: 1

coils:
    eject_coil1:
        number:
    eject_coil2:
        number:
    eject_coil3:
        number:

event_player:
    test_event_when_enabled:
        - should_post_when_enabled{device.multiballs.mb1.enabled}
        - should_not_post_when_enabled{not device.multiballs.mb1.enabled}
    test_event_when_disabled:
        - should_post_when_disabled{not device.multiballs.mb1.enabled}
        - should_not_post_when_disabled{device.multiballs.mb1.enabled}

switches:
    s_start:
        number:
        tags: start
    s_ball_switch1:
        number:
    s_ball_switch2:
        number:
    s_ball_switch3:
        number:
    s_ball_switch4:
        number:
    s_ball_switch5:
        number:
    s_ball_switch6:
        number:
    s_lock1:
        number:
    s_lock2:
        number:
    s_ball_switch_launcher:
        number:

playfields:
    playfield:
        default_source_device: bd_launcher
        tags: default

ball_devices:
    bd_trough:
        eject_coil: eject_coil1
        ball_switches: s_ball_switch1, s_ball_switch2, s_ball_switch3, s_ball_switch4, s_ball_switch5, s_ball_switch6
        confirm_eject_type: target
        eject_targets: bd_launcher
        tags: trough, drain, home
    bd_launcher:
        eject_coil: eject_coil2
        ball_switches: s_ball_switch_launcher
        confirm_eject_type: target
        eject_timeouts: 2s
    bd_lock:
        eject_coil: eject_coil3
        ball_switches: s_lock1, s_lock2
        eject_timeouts: 2s

modes:
    - mode1
    - mode2
    - mode3
    - mode4
    - mode5

multiballs:
    mb1:
        ball_count: 1
        ball_count_type: add
        shoot_again: 30s
        enable_events: mb1_enable
        disable_events: mb1_disable
        start_events: mb1_start
        stop_events: mb1_stop
    mb2:
        ball_count: 2
        ball_count_type: add
        shoot_again: -1
        enable_events: mb2_enable
        disable_events: mb2_disable
        start_events: mb2_start
        stop_events: mb2_stop
    mb3:
        ball_count: 1
        ball_count_type: add
        shoot_again: 0
        enable_events: mb3_enable
        disable_events: mb3_disable
        start_events: mb3_start
        stop_events: mb3_stop
    mb10:
        ball_count: 3
        ball_count_type: total
        shoot_again: 20s
        start_events: mb10_start
    mb_add_a_ball:
        ball_count: 2
        start_or_add_a_ball_events: start_or_add
        add_a_ball_events: add_ball
    mb_placeholder:
        ball_count: 2
        shoot_again: machine.shoot_again_sec * 1000
        start_events: mb_placeholder_start
        stop_events: mb_placeholder_stop
    mb_alltimers:
        ball_count: 2
        shoot_again: 30s
        hurry_up_time: 10s
        grace_period: 5s
        start_events: mb_alltimers_start
        stop_events: mb_alltimers_stop
    mb_add_a_ball_timers:
        ball_count: 2
        shoot_again: 30s
        hurry_up_time: 10s
        grace_period: 5s
        add_a_ball_events: add_ball
        add_a_ball_shoot_again: 20s
        add_a_ball_hurry_up_time: 5s
        add_a_ball_grace_period: 10s
        start_events: mb_add_a_ball_timers_start
        stop_events: mb_add_a_ball_timers_stop

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

multiballs:
    mb4:
        ball_count: 1
        ball_count_type: add
        shoot_again: 30s
        enable_events: mb4_enable
        disable_events: mb4_disable
        start_events: mb4_start
        stop_events: mb4_stop


    mb11:
        ball_count: 2
        ball_count_type: total
        shoot_again: 20s
        start_events: mb11_start
        ball_locks: bd_lock

    mb12:
        ball_count: current_player.lock_mb6_locked_balls
        ball_count_type: add
        shoot_again: 20s
        start_events: mb12_start
        ball_locks: bd_lock

    mb6:
        ball_count: 2
        ball_count_type: add
        shoot_again: 0
        start_events: mb6_start
        ball_locks: bd_lock

multiball_locks:
    lock_mb6:
        lock_devices: bd_lock
        balls_to_lock: 2
        reset_count_for_current_player_events: mb6_start
        disable_events: mb6_start
#config_version=5
mode:
  start_events: start_mode5
  stop_events: stop_mode5

multiballs:
    mb_mode5:
        ball_count: 2
        shoot_again: 30s
        hurry_up_time: 10s
        grace_period: 5s
        start_events: mb_mode5_start
        stop_events: mb_mode5_stop

    mb_mode5_lean:
        ball_count: 2
        shoot_again: 30s
        start_events: mb_mode5_lean_start
        stop_events: mb_mode5_lean_stop
#config_version=5
mode:
  start_events: start_mode3
  stop_events: stop_mode3

multiballs:
    mb_autostart:
        ball_count: 2
        start_events: mode_mode3_started
#config_version=5
mode:
  start_events: start_mode4
  stop_events: stop_mode4

multiballs:
    mb4_autostart:
        ball_count: 2
        ball_count_type: total
        shoot_again: 0s
        start_events: multiball_lock_lock_mb_autostart_full
        ball_locks: bd_lock


multiball_locks:
    lock_mb_autostart:
        lock_devices: bd_lock
        balls_to_lock: 1
#config_version=5
mode:
  start_events: start_mode2
  stop_events: stop_mode2

multiballs:
    mb5:
        ball_count: 1
        ball_count_type: add
        start_events: mb5_start