Alternate sounds in different modes for the same switch ?

43 views
Skip to first unread message

Mav78

unread,
Oct 29, 2018, 5:33:12 PM10/29/18
to MPF Users
Hi All,

I was wondering if it was possible to associate different sounds to the same switch.

For example :

in Mode 1

Switch_1_active: song_1

in Mode 2

Switch_1_active: song_2


At this moment (in mode 2 with Higher priority) when I press the switch I can ear 2 sounds (which is not really nice).

Does somebody has an idea please ?

Thanks.

Mav78



jabdoa

unread,
Oct 29, 2018, 7:29:06 PM10/29/18
to MPF Users
Hi Mav,

ideally, you would only want one of your modes to be running. Alternatively, you could turn to event blocking like this: http://docs.missionpinball.org/en/dev/examples/blocking_events/index.html. This should be used very carefully. In your case you would probably block the "Switch_1_active" event in your higher priority mode. Currently, there is no way to just block the event for sounds (only for shots) but we can add that if you want it. So for now you will block the event for any handlers in a lower priority mode.

Jan

Mav78

unread,
Oct 30, 2018, 3:55:23 AM10/30/18
to MPF Users
Hi Jan,

I understand your point.

I put a lot of things in the mode base which of course, I can try to split.

In the same time, if 2 modes needs to be used at the same time, it would be perfect to imagine that if a mode has a higher priority, and if the switch (or shot) are defined in both modes for the sound, than we can force the higher priority to play instead of both.

But I will split my base mode ;)

Thanks a lot.

Mav

Mav78

unread,
Oct 30, 2018, 6:34:58 AM10/30/18
to MPF Users
That's perfect by splitting the mode 'base' !

Thanks a lot !

Mav

Anthony van Winkle

unread,
Oct 30, 2018, 11:37:21 PM10/30/18
to MPF Users
One thing I do all over the place is make shots in each mode and use the shot hit events to trigger sounds, rather than switches. Switches can't be "disabled" like shots can, so it's much harder to control their behavior. With shots, I can use one switch for any variety of sounds.

Another thing I leverage a lot is the max_queue_time property on tracks with a limited number of simultaneous sounds. This way I can prevent sounds from stacking and the lower priority sounds just disappear into the ether. It's super convenient!

Mav78

unread,
Nov 3, 2018, 11:08:43 AM11/3/18
to MPF Users
Hi Anthony,

So I changed my switch to Shot, thanks a lot for the tips !

Brian Cox

unread,
Nov 10, 2018, 3:27:47 PM11/10/18
to MPF Users
I've got a similar approach to Anthony...

I add a tag to each switch, then use an event player in whatever mode I'm in to play the sound associated with the switch.

So, with four different modes I can get four different sounds for the same switch hit,

Brian C.

jabdoa

unread,
Nov 13, 2018, 3:31:59 PM11/13/18
to MPF Users
Hey guys,

is this something we should document? Like somewhere here: http://docs.missionpinball.org/en/dev/game_design/game_mode.html. I guess we could use more docs about common mode design pattern. What do you think?


Jan

Brian Cox

unread,
Nov 13, 2018, 6:33:53 PM11/13/18
to MPF Users
I think that's a great idea, and I would add that if you stuck to a specific naming convention and architecture, the configs could almost write themselves.

So maybe a piece of a larger "game design" tool that includes config automation.

BC


On Monday, October 29, 2018 at 2:33:12 PM UTC-7, Mav78 wrote:
Reply all
Reply to author
Forward
0 new messages