Event prioritization

27 views
Skip to first unread message

Max Power

unread,
Jun 29, 2024, 6:53:45 PMJun 29
to MPF Users
I need to implement priority on events in an event player but running into issues with the syntax given in the documentation.  Currently have a race condition with a bonus collect/reset.

My events are in the following format. What needs to be modified to make them fire in the listed order?

event_player: 
  ball_starting: 
    - cmd_flippers_enable 
    - cmd_autofire_coils_enable 
    - cmd_drop_targets_reset

Thanks,
Max

Anthony van Winkle

unread,
Jun 29, 2024, 7:48:56 PMJun 29
to MPF Users
Hello Max-

The list-based format you have above is the "express" format for quick lists that don't require additional parameters. To add priority, you need to switch from a list-style to a dictionary-style, like so:

event_player:
  ball_starting:
    cmd_flippers_enable:
      priority: 100
    cmd_autofire_coils_enable:
      priority: 200
    cmd_drop_targets_reset:
      priority: 10

Hope that helps!

Max Power

unread,
Jun 29, 2024, 10:59:15 PMJun 29
to mpf-...@googlegroups.com
That is what I was looking for, thanks. Now we have a good example for the documentation.

--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpf-users/f57bc6d9-a37f-4a92-b77c-7030fe4d91d5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages