Overlapping shows

36 views
Skip to first unread message

William Brown

unread,
Oct 9, 2024, 3:05:24 PMOct 9
to MPF Users
Hello,
I have made a show that plays when a target is hit that creates a wave effect across several lights. That is working good, however, when I hit the target again before the show is complete, it stops the first show and restarts it. I want to have the first show continue to completion while starting a new instance of the same show, so that the two instances of the same show are playing silultaneous until they are complete. Does anyone know how to achieve this effect?

Thank you in advance

Avery Tummons

unread,
Oct 9, 2024, 4:45:36 PMOct 9
to mpf-...@googlegroups.com
Can you post a code snippet of how you’re calling that show?
Sent from my iPhone

On Oct 9, 2024, at 2:05 PM, William Brown <billbr...@gmail.com> wrote:

Hello,
I have made a show that plays when a target is hit that creates a wave effect across several lights. That is working good, however, when I hit the target again before the show is complete, it stops the first show and restarts it. I want to have the first show continue to completion while starting a new instance of the same show, so that the two instances of the same show are playing silultaneous until they are complete. Does anyone know how to achieve this effect?

Thank you in advance

--
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/bfbfa3b7-0ee7-4bb5-8cf7-ac527d44b50fn%40googlegroups.com.

William Brown

unread,
Oct 9, 2024, 9:17:23 PMOct 9
to MPF Users
shots:
    super_pumpkin_spinner:
        switch: s_pumpkinspinner

shows:
    super_pumpkin_show:
      - time: 0
        lights:
            (led1): orange-f.2s

      - time: 0.05
        lights:
            (led2): orange-f.2s


      - time: 0.1
        lights:
             (led3): orange-f.2s

      - time: 0.15
        lights:
             (led4): orange-f.2s

      - time: 0.2
        lights:
            (led1): off-f.2s
            (led5): orange-f.2s

      - time: 0.25
        lights:
            (led2): off-f.2s
            (led6): orange-f.2s

      - time: 0.3
        lights:
            (led3): off-f.2s
            (led7): orange-f.2s

      - time: 0.35
        lights:
            (led4): off-f.2s
            (led8): orange-f.2s

      - time: 0.4
        lights:
            (led5): off-f.2s
            (led9): orange-f.2s

      - time: 0.45
        lights:
            (led6): off-f.2s
            (led10): orange-f.2s

      - time: 0.5
        lights:
            (led7): off-f.2s
            (led11): orange-f.2s

      - time: 0.55
        lights:
            (led8): off-f.2s
            (led12): orange-f.2s

      - time: 0.6
        lights:
            (led9): off-f.2s
            (led13): orange-f.2s

      - time: 0.65
        lights:
            (led10): off-f.2s
            (led14): orange-f.2s

      - time: 0.7
        lights:
            (led11): off-f.2s
            (led15): orange-f.2s

      - time: 0.75
        lights:
            (led12): off-f.2s
 
      - time: 0.8
        lights:
            (led13): off-f.2s  

      - time: 0.85
        lights:
            (led14): off-f.2s

      - time: 0.9
        duration: .2
        lights:
            (led15): off-f.2s

show_player:


    super_pumpkin_spinner_hit:
        super_pumpkin_show:
            loops: 0
            show_tokens:
                led1: l_pumpkin_carve1
                led2: l_pumpkin_carve2
                led3: l_pumpkin_carve3
                led4: l_pumpkin_carve4
                led5: l_pumpkin_carve5
                led6: l_pumpkin_carve6
                led7: l_pumpkin_carve7
                led8: l_pumpkin_carve8
                led9: l_pumpkin_carve9
                led10: l_pumpkin_carve10
                led11: l_pumpkin_carve11
                led12: l_pumpkin_carve12
                led13: l_pumpkin_carve13
                led14: l_pumpkin_carve14
                led15: l_pumpkin_carve15

Alex L

unread,
Oct 14, 2024, 6:40:08 PMOct 14
to MPF Users
The simplest way I can think of is to somehow dynamically generate a different key for each instance of the show -- but I've never tried that and it may or may not be possible. (Maybe a machine or player variable counter interpolated into the key?)

Thinking on it a bit more, a hack-y solution could be to use random_event_player. https://missionpinball.org/latest/config/random_event_player/

Pick a number of max instances of the show you want to support (probably 3-4?) and then in some game mode declare:

```
random_event_player:
  my_trigger_event:
    force_all: true
    disable_random: true
    events:
      - spawn_my_show_instance_1
      - spawn_my_show_instance_2
      - spawn_my_show_instance_3

show_player:
  spawn_my_show_instance_1:
    my_show_name:
      key: my_show_wave_1
      loops: 0
      show_tokens:
        ...etc
  spawn_my_show_instance_2:
    my_show_name:
      key: my_show_wave_2
      loops: 0
      show_tokens:
        ...etc
  spawn_my_show_instance_2:
     ...etc
```

Because they all have the same priority, you also probably want to use "stop" instead of "off" so that each wave releases the light from control when turning off, rather than setting to 000000 level.
Random_event_player has the setting "disable_random" which we set true here -- we want the order to always be 1, 2, 3, because every time a set completes it could choose an out-of-order repeat and cause a random in-progress show to be replaced, rather than the oldest one.
Reply all
Reply to author
Forward
0 new messages