mode complete lights

65 views
Skip to first unread message

Ray Scott

unread,
Aug 28, 2024, 1:41:59 AMAug 28
to MPF Users
Hi,
I am able to qualify a mode, turn on a playfield light showing that mode is active and score accordingly for that mode. I can complete the first mode and start a second mode again lighting the playfield light. My issue is that these lights go off at the end of a ball. I want to leave all modes lights that have been qualified to stay on until the end of the game even though the mode can be in a completed or failed state.
it looks to me that the base mode restarts at the end of each ball, thus restarting my qualifier mode. I have my qualified modes set to persist: true so the ones that have been lit can no longer be qualified. however I would still like the light lit to show what has been done. 
I think my question is, how do I persist this light even though the mode it is started from is no longer active.
I hope that makes sense.
Ray

Ben Tripoli

unread,
Aug 28, 2024, 2:17:37 AMAug 28
to MPF Users
Hi Ray

You are correct, base mode will stop when the ball ends. To keep those lights active you could do something similar to what I do to keep my Segment displays active with the game Scores with a separate mode that runs until game ends, as per below. 
I have the priority low as elsewhere I have a mode with a higher priority that overwrite those lights whilst it is running a light show and when that light show ends the segments return to the original low priority mode and the Scores are showing again. The guru's may have a better solution but this is how I handle it.

mode:
  start_events: ball_starting
  stop_events: game_ended
  stop_on_ball_end: false
  game_mode: false
  priority: 300

Hope the above makes sense... :)

leeoneil

unread,
Aug 28, 2024, 4:22:35 AMAug 28
to MPF Users
If I understand correctly, Ray want to keep the lights associated when a mode stop.
You can do it by putting all the light_player associated into your base mode.

It will stop briefly when the ball end, but reappears on the next ball.

leeoneil

unread,
Aug 28, 2024, 4:24:51 AMAug 28
to MPF Users
I forgot to say that I used some variable to keep track on the lights that need to be lit or not.

Ray Scott

unread,
Aug 28, 2024, 10:21:17 AMAug 28
to MPF Users
Thanks. I will dig a bit deeper into this.

Ray Scott

unread,
Aug 28, 2024, 10:21:21 AMAug 28
to MPF Users
Thanks. That sounds like I should assign a variable when the mode starts which will carry over into the light_player in the base mode.
You wouldn't happen to have an example of how the light_player is triggered with a variable ?

Ray Scott

unread,
Aug 28, 2024, 10:21:26 AMAug 28
to MPF Users
Actually I think I just found an example of this. Will give it a try tomorrow.
Thanks

On Wednesday, August 28, 2024 at 6:24:51 PM UTC+10 l...@rdtp.net wrote:

Owen Underwood

unread,
Aug 28, 2024, 10:58:30 AMAug 28
to mpf-...@googlegroups.com

For your use case, it sounds like you want achievements/achievement groups (these persist their state between balls and are specifically designed for tracking mode qualification and completion.

https://missionpinball.org/latest/config/achievements/

If you model your game using the mpf example below (which I strongly recommend if your game has depth), you would put these achievements & groups in the base mode.

https://missionpinball.org/latest/game_design/mode_layering/

"Persistence" between balls can be tricky (some mpf configs will let you choose to persist_state). My preference for things I want to persist is to use state machines (making sure to set persist_state to true). Jan has a really good YouTube video about them.

https://youtu.be/qakxTF1H57E?si=e7XSOE9bdjGWQaUX

https://missionpinball.org/latest/config/state_machines/


--
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/8913c91a-8b60-4c3a-bc9c-1105f950900dn%40googlegroups.com.
Message has been deleted

nick taseris

unread,
Aug 29, 2024, 12:16:57 AMAug 29
to MPF Users
Not sure if this is too simpe to accomplish what you are describing, but I have playfield lights to show which modes have been played (playing each mode whether or not it gets completed is part of qualifying my wizard mode). I just use a light player in the base yaml like the one below. You can tie it to a different event if you need to but I just use the mode started event for each of my modes. The lights stay on between balls until end of game.

light_player:
mode_bill_bulk_and_the_body_buddies_started: #event from MPF monitor for the mode I want to activate the light.
l_bill_1: #name of my light
color: orange

Ray Scott

unread,
Aug 29, 2024, 1:32:21 AMAug 29
to MPF Users
Thanks,
I did try using the Addams Family Mansion Awards cookbook, adapted for my game but I kept hitting an error that I couldn't work out. Then thought it might be because I am running MPF 0.59 and that was written for 0.50 so effectively gave up. I will re-visit all the above options as I get chance.
I find with a lot of the examples it only gives you part of the story, the rest you have to try to work out, which also may be my stumbling block.
I have watched a lot of Jans videos with various levels of understanding exactly where the items talked about relate to what I would like to achieve i.e. which should be in the base config, the main config or its own mode. They are not marked as video 1  to X so have jumped around a bit.
The links posted are much appreciated. 

Ray Scott

unread,
Oct 7, 2024, 3:00:58 AMOct 7
to MPF Users
I have resolved this by declaring a variable when the mode is complete. Base mode checks the value and keeps completed mode lights lit.

variable_player:
  mode_scarlet_complete:
    scarlet_ok:
      action: set_machine
      int: 1  

Reply all
Reply to author
Forward
0 new messages