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.

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

modes:
    - mode1

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

switches:
    s_start:
        number:
        tags: start
    s_ball_switch1:
        number:
    s_ball_switch2:
        number:
    s_ball_switch_launcher:
        number:
    s_ball_switch_hold1:
        number:
    s_ball_switch_hold2:
        number:
    s_ball_switch_hold3:
        number:
    s_ball_switch_hold4:
        number:
    s_ball_switch_hold5:
        number:
    s_playfield_active:
        tags: playfield_active
        number:

playfields:
    playfield:
        default_source_device: test_launcher
        tags: default

ball_devices:
    test_trough:
        eject_coil: eject_coil1
        ball_switches: s_ball_switch1, s_ball_switch2
        debug: true
        confirm_eject_type: target
        eject_targets: test_launcher
        tags: trough, drain, home
    test_launcher:
        eject_coil: eject_coil2
        ball_switches: s_ball_switch_launcher
        debug: true
        confirm_eject_type: target
        eject_timeouts: 6s, 10s
    test_hold:
        eject_coil: eject_coil3
        ball_switches: s_ball_switch_hold1, s_ball_switch_hold2, s_ball_switch_hold3
        confirm_eject_type: target
        debug: true
    test_hold2:
        eject_coil: eject_coil4
        ball_switches: s_ball_switch_hold4, s_ball_switch_hold5
        confirm_eject_type: target
        debug: true

ball_holds:
    hold_test:
        hold_devices: test_hold
        balls_to_hold: 2
        release_one_events: release_test
    hold_test3:
        hold_devices: test_hold2

event_player:
    test_conditional_event.1{device.ball_holds.hold_test["balls_held"] > 0}:
        - "yes"
    test_conditional_event.2{device.ball_holds.hold_test["balls_held"] == 0}:
        - "no"
    test_event_when_enabled:
        - should_post_when_enabled{device.ball_holds.hold_test.enabled}
        - should_not_post_when_enabled{not device.ball_holds.hold_test.enabled}
    test_event_when_disabled:
        - should_post_when_disabled{not device.ball_holds.hold_test.enabled}
        - should_not_post_when_disabled{device.ball_holds.hold_test.enabled}

Mode config examples

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

#config_version=5
mode:
  start_events: start_mode1
  stop_events: stop_mode1
  game_mode: False

ball_holds:
    hold_test2:
        hold_devices: test_hold
        balls_to_hold: 2
        release_one_events: release_test
        tags:
        label: