Sequence of Events

36 views
Skip to first unread message

Thomas Trickel

unread,
Mar 28, 2026, 2:02:28 PM (5 days ago) Mar 28
to MPF Users
Is there any way to control the sequence of events or the sequence that variable_player responds to events. 

I have the following:

variable_player:
  mission_spot_group_shot_hit:
    score: 1000

  mission_spot_1_shot_hit:
    mission_selected:
        action: set
        string: 'target_practice'
  mission_spot_2_shot_hit:
    mission_selected:
        action: set
        string: 're-entry'
  mission_spot_3_shot_hit:
    mission_selected:
        action: set
        string: 'launch'
  mission_spot_group_shot_lit_complete:
    mission_selected:
        action: set
        string: 'science'
  mission_completed_event:
    mission_selected:
        action: set
        string: 'blah'

            note: the mission_completed_event handler is only because I was getting
                         an error when I tried to assign 'none' to the mission_selected variable

Why does player_mission_selected get assigned launch when the events triggering the assignment occur before the events triggering the assignment of science to player_mission_selected?

EventSequence.png

Thank you

Thomas Trickel

unread,
Mar 28, 2026, 2:06:02 PM (5 days ago) Mar 28
to MPF Users
I've attached the whole mode.
mission.yaml

Samuel Chauviere

unread,
Mar 29, 2026, 10:57:20 AM (4 days ago) Mar 29
to MPF Users
Hey Thomas,


Something like

accruals:
   mission_spot_accrual:
    events:
      - mission_spot_1_shot_hit
      - mission_spot_2_shot_hit
      - mission_spot_3_shot_hit
    events_when_complete: mission_spot_accrual_complete

and 

variable_player:
...
  mission_spot_accrual_complete:
    mission_selected:
        action: set
        string: 'science'

may do what your looking for.

Sam

Thomas Trickel

unread,
Mar 29, 2026, 7:30:18 PM (3 days ago) Mar 29
to MPF Users
Thank you Sam.

That did the trick. Just had to set disable_on_complete to false instead of the default true.

Clearly I need to spend more time plowing through the documentation.

Reply all
Reply to author
Forward
0 new messages