Prevent the auto-plunging of a ball to the playfield from the plunger lane when a physical multiball_lock captures ball? #159
-
I have a multiball lock that when a ball is captured it automatically plunges the ball from the trough -> plunger -> playfield - this plunger has been configured as follows:
Is there a way to prevent the automatic plunging of the ball to the playfield and let the player control this using the mechanical action instead? The area of code I have traced down the function is here - last line does not provide additional parameters to the add_ball function - basically I would like the player_controlled to be set to true: multiball_lock.py
ball_device.py
Context: MPF 0.8 (latest from Github) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
There are two ways to do this, off the top of my head. First would be to use a queue_relay_player to block the eject attempt until after the user plunges the ball, at which point MPF may recognize that the ball is missing and if the playfield has already accepted the ball, the eject path may be cancelled. Or, it may try again and you'll have two balls. Second would be to use the I haven't looked into the code for either approach, but I think the second would be better because it's imperatively instructing MPF to behave the way you want instead of tricking it to. |
Beta Was this translation helpful? Give feedback.
-
Glad you got it working! It seems like the Playfield class should expose event handlers for it's I see that the BallDevice class does have a |
Beta Was this translation helpful? Give feedback.
There are two ways to do this, off the top of my head.
First would be to use a queue_relay_player to block the eject attempt until after the user plunges the ball, at which point MPF may recognize that the ball is missing and if the playfield has already accepted the ball, the eject path may be cancelled. Or, it may try again and you'll have two balls.
Second would be to use the
replace_balls:
config option set to zero so no balls are replaced in the lock. It'd be up to you to manually trigger an add_ball event to add a ball to the playfield, which should accept the player_controlled argument to require a pluge.I haven't looked into the code for either approach, but I think the second wo…