Skip to content

sequence_shots:

This is a config file reference. Click for instructions.

This page is reference material which explains every setting and option for this section of an MPF yaml config file. See the instructions for config files for formatting and other details. See our guide to config file examples for more examples of real configs in action.

Valid in
machine config files YES ✅
mode config files YES ✅

The sequence_shots: section of your config is where you configure switch or event sequences which should trigger an event.

A sequence_shots is a device with multiple switches to hit, in order, for the sequence_shots to be registered as being hit/completed. You can optionally specify a time limit for these switches (i.e. the sequence must be completed within the time limit) with the sequence_timeout: setting.

When the first switch in a sequence is activated, the sequence_shot will start watching for the next one. When that one is activated, it looks for the next, and so on. Once the last switch is activated, the shot is considered "hit" and the device posts your_sequence_shot_hit (if your shot is called your_sequence_shot).

#! switches:
#!   top_right_opto:
#!     number:
#!   left_rollover:
#!     number:
#!   top_center_rollover:
#!     number:
sequence_shots:
  left_orbit:
    switch_sequence: left_rollover, top_right_opto
    sequence_timeout: 3s
  weak_right_orbit:
    switch_sequence: top_right_opto, top_center_rollover
    sequence_timeout: 3s

Notice in the example above that there are two different shots with the same switches, but the order of the switches is inverted between the two. This is because the left orbit and right orbit shots in this machine use the same two switches, but the order the switches are activated in dictates which shot was just made.

Shots in MPF are able to track multiple simultaneous sequences in situations which is nice when multiple balls are on the playfield. If the first switch in a sequence is hit twice before the sequence completes, MPF will start tracking two sequences. Then when the next switch is it, it will only advance one sequence. If the next switch is hit again, it will advance the other sequence. But if the next switch is never hit a second time, then the second shot will not complete.

Here is an example with events:

sequence_shots:
  my_event_based_sequence_shot:
    event_sequence:
      - event1
      - event2
      - event3
    cancel_events: cancel
    delay_event_list:
      delay1: 1s
    sequence_timeout: 3s

And one with switches:

#! switches:
#!   seq2_1:
#!     number:
#!   seq2_2:
#!     number:
#!   seq2_3:
#!     number:
#!   seq2_cancel:
#!     number:
#!   seq2_delay:
#!     number:
sequence_shots:
  my_switch_based_sequence_shot:
    switch_sequence:
      - seq2_1
      - seq2_2
      - seq2_3
    cancel_switches: seq2_cancel
    delay_switch_list:
      seq2_delay: 1s
    sequence_timeout: 3s

Optional settings

The following sections are optional in the sequence_shots: section of your config. (If you don't include them, the default will be used).

cancel_events:

List of one (or more) device control events (Instructions for entering device control events). Defaults to empty.

Those events will cancel the current sequence. Same as cancel_switches but with events.

cancel_switches:

List of one (or more) values, each is a type: string name of a switches: device. Defaults to empty.

A switch (or list of switches) that will cause any in-progress switch sequence tracking to be canceled. (Think of it like a cancel "abort" switch.) If you enter more than one switch here, any of them being hit will cause the sequence tracking to reset. If MPF is currently tracking multiple in-process sequences, a cancel_switch hit will cancel all of them.

delay_event_list:

List of one (or more) device control events (Instructions for entering device control events). Defaults to empty.

Events which will temporarily prevent new sequences from starting. Same as delay_switch_list but with events.

delay_switch_list:

One or more sub-entries. Each in the format of string name of a switches: device : time string (ms) (Instructions for entering time strings)

Switches which will temporarily prevent new sequences from starting. This lets you specify a switch along with a time value that will prevent this shot from tracking from being hit. In other words, the shot only counts if the delay_switch was not hit within the time specified.

event_sequence:

List of one (or more) events. The device will add handlers for those events. Defaults to empty.

A sequence of events which will complete the sequence.

playfield:

Single value, type: string name of a playfields: device. Default: playfield

The playfield this sequence is on.

sequence_timeout:

Single value, type: time string (ms) (Instructions for entering time strings). Default: 0

Timeout starting when the sequence starts (e.g. after the first switch was hit). This is the time limit the switches in the switch_sequence: section have to be activated in, from start to finish, in order for the sequence to be hit/completed. You can enter values with "s" or "ms" after the number, like 200ms or 3s. If you just enter a number then the system assumes you mean seconds. If you do not enter a time, or you enter a value of 0, then there is no timeout (i.e. the player could literally take multiple minutes between switch activations and the shot would count.)

switch_sequence:

List of one (or more) values, each is a type: string name of a switches: device. Defaults to empty.

A sequence of switches which will complete the sequence.

console_log:

Single value, type: one of the following options: none, basic, full. Default: basic

Log level for the console log for this device.

debug:

Single value, type: boolean (true/false). Default: false

Set this to true to see additional debug output. This might impact the performance of MPF.

file_log:

Single value, type: one of the following options: none, basic, full. Default: basic

Log level for the file log for this device.

label:

Single value, type: string. Default: %

Name of this device in service mode.

tags:

List of one (or more) values, each is a type: string. Defaults to empty.

Not used.


Something missing or wrong? You can fix it!

This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?

Please help us! You can fix it yourself and be an official "open source" contributor!

It's easy! See our Beginner's guide to editing the docs.

Page navigation via the keyboard: < >

You can navigate this site via the keyboard. There are two modes:

General navigation, when search is not focused:

  • F , S , / : open search dialog
  • P , , : go to previous page
  • N , . : go to next page

While using the search function:

  • Down , Up : select next / previous result
  • Esc , Tab : close search
  • Enter : go to highlighted page in the results