# Step 5b. Multiball - commonly asked questions

Multiball is largely managed by SkeletonGame and by the trough mode, which is automatically added to every game.

If you have an auto-plunger, your Mode can eject additional balls into play using the trough’s method:

    self.game.trough.launch_and_autoplunge_balls(num_balls_to_launch)


Without an auto-plunge, use:

    self.game.trough.launch_balls(num_balls_to_launch)


When multiple balls are active in play, a new SkeletonGame event is possible: evt_single_ball_play. This event lets your mode code know that all of the extra balls you tried to launch have been launched, but the player has drained all of them but one. Again, this event will not fire if ball launches are still pending, so you don’t need to worry about that. Typically this event marks the end of multiball. You probably want your “multiball mode” know that the player is down to a single ball, so you should define a handler for this event. This is done as:

    def evt_single_ball_play(self):
# maybe log something?
# self.logger.info("MultiballPrep: Down to single ball play -- dumping the multiball modes : %s" % self.multiball_modes)

# maybe remove this mode?
#self.game.modes.remove(self)

pass


If you wish to determine how many balls are anticipated to be in play, the trough exposes:

    self.game.trough.num_balls_requested()


which returns the number of balls that will be eventually “live”, counted as the number of balls currently on the playfield plus the number of pending ejects

And for the number of live balls (or at least balls that are out on the playfield):

    self.game.trough.num_balls_out()