Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

problems with shot reset events

40 views
Skip to first unread message

uncivilengineer

unread,
Feb 9, 2025, 12:23:02 AMFeb 9
to MPF Users
In my ongoing quest to duplicate the original Haunted House rule set in my game, I have come up against and issue trying to reset some shots.

So the game has 5 kick targets on the main playfield.  The goal is to complete these sequentially and it lights the extra ball.  The targets won't reset between balls unless you complete the sequence.

So have the targets up and working as they should.  The issue I am having is with resetting them is resetting them when a new ball starts and you have already completed the sequence.  To track if the sequence has been completed, I created a player variable  called 'main_target_sequence_complete' that has a value of either 'yes' or 'no'.  Below are my shot definitions for the targets.  This is part of my base mode that gets re-started every ball at the event 'ball_will_start'.  The problem I am having is that the reset_event is not tripping, and the shots don't reset.  Can anyone tell me why the reset event is not triggering?

If you want to see it in the context of my entire base mode file, it can be found here:

Thanks,
Alan

  main_target_1:
    switch: s_main_1_target
    show_tokens:
      light: l_target_1
    profile: main_target_1_profile
    reset_events: ball_started{current_player.main_target_sequence_complete_value == "yes"}

  main_target_2:
    switch: s_main_2_target
    show_tokens:
      light: l_target_2
    profile: main_targets_profile
    advance_events:
      - main_target_1_flashing_hit
      - main_target_2_flashing_hit
    reset_events: ball_started{current_player.main_target_sequence_complete == "yes"}

  main_target_3:
    switch: s_main_3_target
    show_tokens:
      light: l_target_3
    profile: main_targets_profile
    advance_events:
      - main_target_2_flashing_hit
      - main_target_3_flashing_hit
    reset_events: ball_started{current_player.main_target_sequence_complete == "yes"}
   
  main_target_4:
    switch: s_main_4_target
    show_tokens:
      light: l_target_4
    profile: main_targets_profile
    advance_events:
      - main_target_3_flashing_hit
      - main_target_4_flashing_hit
    reset_events: ball_started{current_player.main_target_sequence_complete == "yes"}

  main_target_5:
    switch: s_main_5_target
    show_tokens:
      light: l_target_5
    profile: main_targets_profile
    advance_events:
      - main_target_4_flashing_hit
      - main_target_5_flashing_hit
    reset_events: ball_started{current_player.main_target_sequence_complete == "yes"}

Avery Tummons

unread,
Feb 9, 2025, 9:07:18 AMFeb 9
to mpf-...@googlegroups.com
Change event from ball_started to mode_base_started. Ball_started is posting, but your mode hasn’t started yet. Events are not “saved”, they only occur once. So your mode has to be loaded to have the event handler. In this case, it isn’t loaded, so it’s waiting for an event that will never happen.
Sent from my iPhone

On Feb 8, 2025, at 11:23 PM, uncivilengineer <whitte...@gmail.com> wrote:


--
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 visit https://groups.google.com/d/msgid/mpf-users/e76746e2-afd8-4082-ac02-183e7387d582n%40googlegroups.com.

uncivilengineer

unread,
Feb 9, 2025, 12:10:17 PMFeb 9
to MPF Users
Thanks, that worked.  I though using 'ball_started' was safe because it came after the event that starts base mode.  I guess I was wrong.

Avery Tummons

unread,
Feb 9, 2025, 1:02:11 PMFeb 9
to mpf-...@googlegroups.com
Many things like modes have three events. X_will_start, x_starting, x_started. Anything that happens before x_started inside the mode where the config lives will never happenbecause it isn’t active until that point. If it’s referencing another mode or event, it can see that. 

Here is a link to flowcharts: https://missionpinball.org/latest/flowcharts/

Sent from my iPhone

On Feb 9, 2025, at 11:10 AM, uncivilengineer <whitte...@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages