missionpinball / mpf

Mission Pinball Framework: Open source software to run a real pinball machine.
http://missionpinball.org
MIT License
217 stars 143 forks source link

Add speed parameter to achievements and shot_profiles #1163

Open jabdoa2 opened 6 years ago

jabdoa2 commented 6 years ago

Or provide generic way to provide settings in "xx_show:" settings in config. Maybe a dict like this:

show:
  name: my_show
  speed: 123
  show_tokens:
     leds: a, b, c
  other_show_args: True
  loop: False
luc-boussant commented 5 years ago

Hi jabdoa2, can I work on this.?

jabdoa2 commented 5 years ago

Hi Luc, yes you can! The issue contains two devices. I suggest you start with achievements. The code for them is here: https://github.com/missionpinball/mpf/blob/dev/mpf/devices/achievement.py#L175. Config is here: https://github.com/missionpinball/mpf/blob/dev/mpf/config_spec.yaml#L30.

Let me know if you got any questions.

Jan

luc-boussant commented 5 years ago

This is my first contribution and I can't seem to understand the different steps I need to do.

jabdoa2 commented 5 years ago

Hi Luc, a good first step would be to install MPF in development mode: http://docs.missionpinball.org/en/dev/about/contributing_to_mpf.html#install-mpf-in-development-mode. Then play a game (such as demo_man) and get comfortable with the framework. Play around with Achievements: http://docs.missionpinball.org/en/dev/game_logic/achievements/index.html. Try to understand how they work and how they interact with shows (http://docs.missionpinball.org/en/dev/shows/index.html).

Currently the integration looks like this:

  money_bags:
    show_tokens:
      leds: l_money_bags
    show_when_selected: flash

Unfortunately, there is no way to pass more parameters to a show. We would like to add that like this:

  money_bags:
    show_tokens:
      leds: l_money_bags
    show_when_selected:
      name: flash
      speed: 4
      sync_ms: 250

In code you need to change two things:

  1. Change the config_spec to allow dicts instead of a str.
  2. Use the new show config by calling play_with_config (https://github.com/missionpinball/mpf/blob/dev/mpf/assets/show.py#L285) in the achievement.