Highest Score Event name for the purpose of adding a free game

44 views
Skip to first unread message

driskel

unread,
Jun 7, 2018, 7:57:35 PM6/7/18
to MPF Users
I want to give a free game via add_credit if the players score is the highest score for the machine.

I have been looking through the documentation and reading log entries.  I am looking for the event that is thrown on the highest score.  I will then use an event_player to add the credit.

2 Questions:

1) What event am I listening for in the high_score mode?
2) Does this approach sound valid?

Thank you.

driskel

unread,
Jun 7, 2018, 8:04:29 PM6/7/18
to MPF Users
Here is the log entry that I am investigating:

2018-06-07 19:01:31,996 : INFO : Mode.high_score : New high score. Player: <Player 1>, award_label: GRAND CHAMPION, Value: 27000

driskel

unread,
Jun 7, 2018, 8:17:38 PM6/7/18
to MPF Users
This looks like the event I am looking for?

2018-06-07 19:01:33,948 : INFO : EventManager : Event: ======'grand champion_award_display'====== Args={'value': 27000, 'player_name': 'AAA', 'award': 'GRAND CHAMPION'}

driskel

unread,
Jun 7, 2018, 8:45:29 PM6/7/18
to MPF Users
I think this is the obvious place to listen and apply the credit for a high score game

credits:
    max_credits
: 12
    free_play
: False
    service_credits_switch
: s_service_coin
    events
:
       
- event: high_score_award
          type
: award
          credits
: 1
       
- event: add_credit
          type
: award
          credits
: 1
       
- event: match_has_match
          type
: award
          credits
: winners

Still investigation the proper event to listen for

driskel

unread,
Jun 7, 2018, 10:10:33 PM6/7/18
to MPF Users
Base naive Implementation

config/config.yaml

credits:
    max_credits
: 12
    free_play
: False
    service_credits_switch
: s_service_coin
    events
:

       
- event: add_credit
          type
: award
          credits
: 1
       
- event: match_has_match
          type
: award
          credits
:
winners
       
- event: champion_award
          type
: award
          credits
: 2

modes/high_score/config/high_score.yaml

queue_event_player:
   
"grand champion_award_display":
        queue_event
: champion_award_event
        events_when_finished
: champion_award


jabdoa

unread,
Jun 8, 2018, 4:47:25 AM6/8/18
to MPF Users
Looks good in general. I would avoid spaces in events. You probably need the queue_relay_player for other reasons than the credits right? Otherwise you probably could get rid of it too.


Jan

driskel

unread,
Jun 8, 2018, 8:02:28 AM6/8/18
to MPF Users
The space in the event is what is showing, I am not sure how to change that.

You are right, I do not need the queue relay player at this point.

jabdoa

unread,
Jun 8, 2018, 10:52:02 AM6/8/18
to MPF Users
That is probably the award name. Will have a look later. Created a bug to track it: https://github.com/missionpinball/mpf/issues/1189.


Jan

driskel

unread,
Jun 8, 2018, 11:24:32 AM6/8/18
to MPF Users
Thank you.

driskel

unread,
Jun 8, 2018, 11:32:22 AM6/8/18
to MPF Users
Here is my naive implementation. It might be a good documentation point or cookbook point.
I currently have a credit added callout that I wanted to retain and on a free game provide an additional one

/config/config.yaml

credits:
    max_credits
: 12
    free_play
: False
    service_credits_switch
: s_service_coin
    events
:
       
- event: add_credit
          type
: award
          credits
: 1
       
- event: match_has_match
          type
: award
          credits
: winners
       
- event: champion_award
          type
: award
          credits
: 2

    switches
:
       
- switch: s_coin_left
          type
: money
          value
: .25
       
- switch: s_coin_right
          type
: money
          value
: .25
    pricing_tiers
:
       
- price: .25
          credits
: 1
       
- price: 1
          credits
: 5
    fractional_credit_expiration_time
: 15m
    credit_expiration_time
: 2h
    persist_credits_while_off_time
: 1h
    free_play_string
: FREE PLAY
    credits_string
: CREDITS

/modes/high_score/config/high_score.yaml

queue_event_player:
   
"grand champion_award_display":
        queue_event
: champion_award_event
        events_when_finished
:
champion_award
       
queue_relay_player
:
    champion_award_event
:
        post
: champion_award_event_dmd
        wait_for
: slide_free_game_slide_removed

slide_player
:
    champion_award_event_dmd
:
        free_game_slide
:
            target
: dmd
            expire
: 2s

slides
:
    free_game_slide
:
        widgets
:
           
- type: text
              text
: FREE GAME


Bob P

unread,
Dec 31, 2023, 5:00:28 PM12/31/23
to MPF Users
this works but if multiple players beat the high score, they all win 2 awards.
Shouldn't it be that the award is given out only once / game?

Reply all
Reply to author
Forward
0 new messages