Skip to content

ball_device: auto_fire_on_unexpected_ball template support#1878

Draft
bosh wants to merge 2 commits intomissionpinball:devfrom
bosh:bd_auto_fire_template_support
Draft

ball_device: auto_fire_on_unexpected_ball template support#1878
bosh wants to merge 2 commits intomissionpinball:devfrom
bosh:bd_auto_fire_template_support

Conversation

@bosh
Copy link
Collaborator

@bosh bosh commented Feb 18, 2025

Draft PR for now - I haven't actually tested whether this evaluates the template live, or just at setup-time.

Unfortunately this is also a breaking change. The property in question was previously a bool, which allows lowercase specification in our yamls ("true"). But changing to template_bool changes the requirement to a python bool, which MUST be either "True" or "False" if specified simply. We could instead make template_bool support either case of boolean, or even more variants (0/1, T/F, t/f, yes/no, etc), but Jan specifically coded this exception in and I hesitate to change this. (Current line) (Original Commit) So if we take this change, anyone who happened to use lowercase in their config there (I did) will crash until they find their ball device setting and capitalize it. Awkward

My use case is that my right outlane has a diverter post to redirect a trough-bound ball directly to the plunger lane instead. I'd like the option, when activating the diverter, to either let the auto-launcher fire as normal (which currently works) OR disable the autolaunching until the eject is confirmed or I manually turn autolaunch back on.


I've tried a few different solutions already, and I think managing the auto-launch setting myself has the most future promise right now. Failed solutions were:

  • ball hold on the plunger
  • new ball device representing the redirection pathway when the diverter makes a save
  • ^ but registered to a separate playfield
  • ^ but with a ball hold
  • ^ with plunger attempting to request a ball (seems like because the plunger can request from trough, and trough has ample extra balls to provide, I can't make the plunger's request come from the fake ball device nor from the playfield, so it always results in an extra ball in play.

My other direction to try now is the fake ball save suggestion from https://missionpinball.org/latest/cookbook/fake_ball_save/ or see how mpf uses the ball_saves:auto_launch to manage this

@sonarqubecloud
Copy link

@avanwinkle
Copy link
Collaborator

Not related to the PR but to your underlying challenge, I feel like blocking the eject attempt with a queue relay player could get you what you need. I've done this in a number of places, and ball ejections include queue events for exactly this purpose.

queue_relay_player:
  balldevice_bd_plunger_ball_eject_attempt:
    post: dont_plunge_that_ball_yet
    wait_for: okay_now_you_can_plunge

You could put this logic in a mode that runs when you want the diversion to happen, or you could put a conditional an the eject_attempt to only conditionally block.

When you want the ball to fire, just post the wait_for event and the eject attempt will proceed. If the player can mechanically plunge the ball, there may be some finesse required to ensure that the ball device knows it doesn't have balls anymore (i.e. mechanical eject succeeded) so it doesn't try and fire on an empty plunger. I've never tried this so I don't know what will happen, maybe it'll need some special logic maybe not.

@bosh bosh force-pushed the bd_auto_fire_template_support branch from 6869b6a to 0a4e710 Compare March 21, 2025 02:17
@bosh bosh force-pushed the bd_auto_fire_template_support branch from 0a4e710 to 6893d61 Compare April 3, 2025 00:18
@bosh bosh force-pushed the bd_auto_fire_template_support branch from 6893d61 to 618e34f Compare April 26, 2025 01:19
@sonarqubecloud
Copy link

@bosh bosh force-pushed the bd_auto_fire_template_support branch from 618e34f to baae5d5 Compare May 30, 2025 00:54
@bosh bosh force-pushed the bd_auto_fire_template_support branch from baae5d5 to ea9c22c Compare June 23, 2025 23:37
@bosh bosh force-pushed the bd_auto_fire_template_support branch from ea9c22c to 52e6d9f Compare July 12, 2025 05:25
@sonarqubecloud
Copy link

@bosh bosh force-pushed the bd_auto_fire_template_support branch from 52e6d9f to a177eb2 Compare November 8, 2025 02:14
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 8, 2025

@bosh bosh force-pushed the bd_auto_fire_template_support branch from a177eb2 to 5765db3 Compare February 14, 2026 05:57
@bosh bosh force-pushed the bd_auto_fire_template_support branch from 5765db3 to 0b2ba12 Compare February 16, 2026 09:57
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants