Skip to content

Tilt Drain issue #1936

@ReviKZ

Description

@ReviKZ

Hi!

Just though I'd share an idea to consider, but I'm open to learn if I'm wrong in my thought process.

Take into account that I'm using MPF 0.57.3, so this problem might be outdated and fixed already.

My team and I are making a homebrew pinball machine and we ran into an issue. While this is extremely rare, during a multiball
(For example 3 ball multiball), 2 balls can drain as one if they fall into the drain device at the same causing tilt to never end.

I found in the tilt.py at line 187 (inside the tilt func)

for device in self.machine.ball_devices.values():
    if 'drain' in device.tags:
        self.tilt_event_handlers.append(
            self.machine.events.add_handler(
                'balldevice_{}_ball_enter'.format(device.name),
                self._tilted_ball_drain))

So it's clear that the drain device's ball enter event and it's args are passed to the tilted_ball_drain and that does the counting.

For our problem, the workaround I did is adding the trough device's new balls arg as the counting base:

      
        for device in self.machine.ball_devices.values():
            if 'trough' in device.tags:
                self.tilt_event_handlers.append(
                    self.machine.events.add_handler(
                        'balldevice_{}_ball_enter'.format(device.name),
                        self._tilted_ball_drain))

        self.machine.game.end_ball()

    def _tilted_ball_drain(self, new_balls, unclaimed_balls, device, **kwargs):
        del unclaimed_balls
        del device
        del kwargs

        self._balls_to_collect -= new_balls

For our use case this is a more stable solution.

The argument is, that I think it would be more stable to use the trough device or the playfield active balls for the counting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions