Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpf parameter -c: code or documentation wrong? #1859

Open
worldpeace-germany opened this issue Dec 20, 2024 · 1 comment
Open

mpf parameter -c: code or documentation wrong? #1859

worldpeace-germany opened this issue Dec 20, 2024 · 1 comment

Comments

@worldpeace-germany
Copy link
Contributor

Hi,

here https://missionpinball.org/latest/running/commands/game/ it is being said

$ mpf game -c /home/brian/pinball/demo_man/config/config.yaml

should run mpf with a different machine folder, for me (latest 0.80 dev5) this doesn't work. I have to

$ mpf game /home/brian/pinball/demo_man/config/

so no -c switch no config file name (since default). and very important for example

$ mpf -b -t /home/brian/pinball/demo_man/config/

is not working, but

$ mpf /home/brian/pinball/demo_man/config/ -b -t

so these switches must be at the end (I have not seen that information in the docs). Before providing a PR I would like to understand if the code or the documentation needs to be fixed? What is the intended behavior?

Thanks!

@avanwinkle
Copy link
Collaborator

There are two ways about this, and you're switching between them so hopefully I can help clarify.

When you run MPF, the optional third argument is the "machine folder" where all of the project modes, configs, shows, et cetera are. If you're not running MPF from this folder, it needs to be specified so that MPF knows where the mandatory folders are.

The -c argument specifies a config file to use as the initializer, which can be helpful if you run your game on different platforms, different hardware configurations, or different environments. This should point to a path within the machine folder (absolute or relative), but does not tell MPF where the machine folder is.

In summary:

  • You must either run MPF from the machine folder or pass the machine folder as a positional argument
  • The machine folder must come before any parameterized arguments
  • You may optionally specify a starting config file path with the -c parameter

Side note, config files can import other config files so you can keep all your "standard" configs in a common file and then your specific configs (the ones indicated via the -c argument) can all import the common config.

For example,
https://github.com/avanwinkle/masseffect2/blob/master/config/config.yaml and
https://github.com/avanwinkle/masseffect2/blob/master/config/spike.yaml

You can also supply multiple config files for further customization, e.g.

mpf both -c config,fullscreen
mpf both -c config,production

Note that the .yaml extension is not required, and multiple values are comma-separated with no space.

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants