3.2. Command-line options

MESS command-line
MESS command-line

Like other command-line tools, MESS can be told what to do via command-line arguments. The most important argument is INPUT_PATH, which is the path of a .map, .rmf or .jmf file. Optionally, an OUTPUT_PATH can also be provided (without this, MESS will overwrite a given .map file).

All other command-line arguments must be placed before the input and output map paths. The most commonly used arguments are -log LOG_LEVEL, which tells MESS how much or how little it should log, and -config PATH, for selecting a different configuration file.

For additional settings, it's better to use configuration files.

Available arguments

-help

When this special argument is set, MESS will show a list of available arguments and then quit. All other arguments will be ignored.

-repl

This special argument enables the interactive MScript interpreter mode. This starts a REPL (read-evaluate-print loop) that can be used to try out MScript, the scripting language that is embedded in MESS. If this argument is set, then all other arguments will be ignored.

While MScript is almost entirely expression-based, REPL mode supports assignments. For example, a = 4 + 5 will store the result of the 4 + 5 expression in the variable named a. For convenience, the latest evaluation result is also stored in a special variable named _.

The following special commands are available in REPL mode:

  • quit - This will exit REPL mode.
  • load PATH - This will load an .mscript file and execute all assignments in it. This can be useful for testing utility functions for template entities.

-dir PATH

This override the template maps directory setting from the current configuration file. See configuration file: template-maps-directory for more information.

-config PATH

This selects a different config file. The .config extension can be omitted, and relative paths are relative to the folder that contains MESS.exe. For example, -config hl will select hl.config.

-fgd PATH

This overrides the mess.fgd file path setting from the current configuration file. See configuration file: fgd-path for more information.

-vars "ASSIGNMENTS"

These variables will be available in MScript expressions in the map properties and top-level entities of the input map. The input format is "name1 = expression; name2 = expression;", and so on.

These variables are added to the ones from the current configuration file. If multiple variables with the same name are specified, then the last value wins. Variables provided via the command-line always overwrite variables from the configuration file if they have the same name. See configuration file: variables for more information.

-globals "ASSIGNMENTS"

Global variables are available in MScript expressions anywhere, via the getglobal, setglobal and useglobal functions. Unlike variables, which are only available in the map properties and in top-level entities, globals are also available inside templates and template maps. The input format is "name1 = expression; name2 = expression;", and so on.

Similar to normal variables, global variables are added to the ones from the current configuration file, using the same rules for handling duplicate names. See configuration file: globals for more information.

-maxrecursion N

This overrides the maximum recursion setting from the current configuration file. See configuration file: max-recursion for more information.

-maxinstances N

This overrides the maximum instances setting from the current configuration file. See configuration file: max-instances for more information.

-log LOG_LEVEL

This overrides the log level setting from the current configuration file. Available log levels are off, minimal, error, warning, info (the default level) and verbose. See configuration file: log-level for more information.

INPUT_PATH

This specifies the map file that must be processed by MESS. Supported formats are .map, .rmf and .jmf. The output format is always .map. This argument must come after all the other arguments (but before OUTPUT_PATH).

If the input file is a .map file and if no output path is set, then the input file will be overwritten.

OUTPUT_PATH

This tells where MESS will save the resulting map file. Specifying a custom output path is useful if you want to prevent MESS from overwriting the input file. This argument must come after all the other arguments.