The MPF repo is full of "real" config file examples. Here's how to find them.
Are you looking for example config files you can use to see how certain settings should be used? There's a great resource built right into the MPF and MPF-MC repos!
Look at MPF / MPF-MC test config files
Both MPF and MPF-MC contain thousands of tests which ensure that every part of MPF works as expected. These tests are run automatically on GitHub every time a change is made to the repo. Since these tests check everything, there are lots of machine and mode config files used by the tests themselves.
So if you need to see an example of how to use a certain setting, you can look at the test config files to see how they're used in real life. (And, since these tests are run automatically, you can be sure that the examples really work and are up to date, because if a test fails, the change to MPF would not be accepted.)
Where are the test config files?
Both the MPF and MPF-MC repo have tests which use config files. If you need a example of something from MPF, (coils, lights, game logic, etc.), look in the MPF repo tests. And if you need something from the MC (displays, slides, widgets, sounds, etc.), then look in the MPF-MC repo tests. Here are the folder paths to where you'd find the test machine config files:
We'll show you how to find config file examples from your locally downloaded copy of the MPF repo, and then after that, how to find them on the web.
Finding config examples from your local downloaded MPF repo
If you've downloaded the MPF or MPF-MC repo to your local machine, you can find the test config files locally. (Note the MPF repo
is often in a folder called
mpf, and then inside there is another folder called
mpf which is where the MPF code is. So it might be
/mpf/mpf/tests... for you.)
But look here,
machine_files. Now look at all the subfolders for each test type, and further the machine and mode config files in there.
Here's an example looking at the achievement group tests, in a mode config file:
Of course it's also possible (and easier) to use whatever tool you're developing your game in to search for the config files. Here's an example using Visual Studio Code. (This is what we recommend you use to develop your game. It's free!)
Here's an example of using VS Code to search for an example
ball_saves: config file setting. Note that we include the colon so we just get config file examples. You can further set the search to just look in the
tests/machine_files folder and/or to only include .yaml files. (Remember to use the MPF repo if you're looking for MPF examples, and the MPF-MC repo if you're looking for MC examples.)
Finding config file examples on the web
If you want to find config file examples on the web, you can do that by searching through the MPF/MPF-MC repos on GitHub.com. To do that, visit the Mission Pinball homepage at GitHub.com/missionpinball:
Click in the search box at the top of the page. That will automatically set a search file to only search through files from the Mission Pinball organization (versus searching every file from every repo on GitHub.com!)
Type what you're looking for, in this case, example configs for
ball_search: so we'll search for ball_search: including the colon since we want an example from a config file.
Boom! Lots of results, but notice the first one is an .md file which is a documentation text file, not a config example.
Click on the YAML option in the languages sidebar to limit the search results to only YAML files:
And now see just real config file examples in YAML files. Note that these files are from various locations in MPF.
You can scroll down to see the ones from the tests/machine_files folder:
Something missing or wrong? You can fix it!
This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?
Please help us! You can fix it yourself and be an official "open source" contributor!
It's easy! See our Beginner's guide to editing the docs.
Page navigation via the keyboard: < >
You can navigate this site via the keyboard. There are two modes:
General navigation, when search is not focused:
- F , S , / : open search dialog
- P , , : go to previous page
- N , . : go to next page
While using the search function:
- Down , Up : select next / previous result
- Esc , Tab : close search
- Enter : go to highlighted page in the results