Enabling Free Play credit mode

26 views
Skip to first unread message

Greg Sealby

unread,
Apr 30, 2019, 10:39:51 AM4/30/19
to MPF Users
I am trying to figure out how I add config to my game to toggle between free play and credit games.  I have my credit function configured and see that there is a setting free_play: yes that determines whether the game starts in free play mode or not.

I want to have a setting in my service mode that toggles this off and on.  How do I reference this variable from service mode to change it?  Or is there another way I should be doing this?

Philip Dixon

unread,
Apr 30, 2019, 11:50:51 AM4/30/19
to MPF Users
I do this in a scriptlet (see attached)
credit.py

jabdoa

unread,
Apr 30, 2019, 2:11:39 PM4/30/19
to MPF Users
Hi Greg,

there are three events to control the credits mode:

enable_free_play
enable_credit_play
toggle_credit_play

See: http://docs.missionpinball.org/en/dev/game_logic/credits/index.html for more details. I guess we should additionally convert this into a normal setting internally. That would automatically expose it to the service mode. Created this issue to track it: https://github.com/missionpinball/mpf/issues/1353


Jan

jabdoa

unread,
Apr 30, 2019, 3:37:17 PM4/30/19
to MPF Users
Added a general setting: https://github.com/missionpinball/mpf/pull/1354. Will be automatically added to your service mode as soon as you add the credits mode.


Jan

Greg Sealby

unread,
Apr 30, 2019, 6:04:55 PM4/30/19
to MPF Users
Thanks Philip. I will have a look.

Jan, thanks for adding that feature into service mode. Can't believe you added it so quickly. Am I able install that pull request without affecting my MPF? If not for now I'll just use the events you suggested until the 0.53 release.

jabdoa

unread,
Apr 30, 2019, 6:07:58 PM4/30/19
to MPF Users
Hi Greg,

You can try dev if you like. There should not be any breaking changes.

The main change in credits mode is that it will persist the state to a setting automatically.

Jan

Reply all
Reply to author
Forward
0 new messages