mpf icon indicating copy to clipboard operation
mpf copied to clipboard

Mode exclusivity? (With state?)

Open toomanybrians opened this issue 7 years ago • 1 comments

We have a situation in BnD that will probably be pretty common, and I'm curious if we can think of an easy way to implement this.

The use case is where you have one mode that should stop / NOT run while another mode is running. Ideally we could provide a list of modes that should cause the first mode to stop, and then when none of those modes are running, the first mode starts again?

For example, one of the "base" features of BnD is a manager's choice shot which is either available to be lit, or lit. This shot is a combination of an MPF shot, shot profile, mode, and a ball hold, so we can't simply block the shot. However we don't want this shot to be lit when other achievement modes are running (we have a list of about 8 modes that, if they're running, should cause this mode to disable. Then when all those modes are done, we want to restart the manager's choice shot (but only if it was lit previously.)

Implementing this currently is complex because you have to check if all the other modes are stopped before restarting the manager's choice lit mode (and then you need to store its state in a player var), and it requires some counter logic blocks and conditional events and a lot of brainpower. So I wonder if there's a simpler way to do this with some config options? Like stop_while_these_modes_running: with a list of modes there. Or something?

toomanybrians avatar Mar 31 '17 00:03 toomanybrians

Agreed. However, i would implement this a bit more generically so it can be used for devices as well. Basically a state based on subscriptable events.

We have to think about what triggers what. Should the manager choice mode stop other modes? Should the stopping of the other mode start the manager mode? This can become a circular endless action chain.

jabdoa2 avatar Mar 31 '17 07:03 jabdoa2