MG/Command line options

From MegaGlest
Jump to navigation Jump to search

MegaGlest has a number of command line options; toggles which can be appended to the executable name when running MegaGlest from a command line or console. Some of these are unique to the console, allowing settings to be controlled before the game even finishes starting up (such as disabling VBOs), while others allow an alternative to changes to the INI settings.

Usage[edit]

To use a command line option, append it behind the name of the binary or executable for MegaGlest in the command line. For example, to toggle on verbose reporting, you could use:

megaglest --verbose

It's also possible to use multiple command line options. For example, if you wanted to set a different resolution and use fullscreen, you could use:

megaglest --resolution=1920x1080 --fullscreen=true

Since you can assign command line options to links, this makes it possible to have a link to play MegaGlest in fullscreen and a link to play it at a smaller windowed resolution.

Command line options[edit]

Option Details
--help Displays a full list of available command line options.
--autostart-lastgame Automatically starts a game with the last game settings you played.
--connecthost=x Auto connect to host server at IP or hostname x.
--starthost Auto create a host server.
--headless-server-mode=x,x Run as a headless server where x is an optional comma delimited command list of one or more of exit (quits the application after a game has no more connected players) or vps (does NOT read commands from the local console - for some VPSs).
--use-ports=x,y,z Force hosted games to listen internally on port x, externally on port y, where x is the internal port # on the local machine to listen for connects and y is the external port # on the router/proxy to forward connection from to the internal port number. If enabled the FTP server port numbers will be set to x+1 to x+9. z is the game status port # on the local machine to listen for status requests
--load-scenario=x Auto-load a scenario by scenario name.
--load-mod=x Auto-load a mod by mod pathname.
--preview-map=x Auto-preview a map by map name.
--version Displays the version string of MegaGlest.
--opengl-info Displays your video driver's OpenGL info.
--sdl-info Displays your SDL version information.
--lua-info Displays your Lua version information.
--curl-info Displays your CURL version information.
--validate-techtrees=a=purgeunused=purgeduplicates
=svndelete=hideduplicates
Displays a report detailing any known problems related to your selected techtrees game data.
  • a is a comma-delimited list of techtrees to validate.
  • purgeunuse is an optional parameter which tells the validation to delete extra files in the techtree that are not used.
  • purgeduplicates is an optional parameter which tells the validation to merge duplicate files in the techtree.
  • svndelete is an optional parameter telling the validation to call SVN delete on duplicate/unused files in the techtree.
  • hideduplicates is an optional parameter, which, if true, tells the validation to not show duplicate files in the techtree. This only applies when files are purged due to the above flags being set.

Example:

megaglest --validate-techtrees=megapack
--validate-actions=a=purgeunused=purgeduplicates
=hideduplicates
Displays a report detailing any known problems related to your selected factions game data.
  • a is a comma-delimited list of factions to validate.
  • purgeunuse is an optional parameter which tells the validation to delete extra files in the techtree that are not used.
  • purgeduplicates is an optional parameter which tells the validation to merge duplicate files in the techtree.
  • hideduplicates is an optional parameter, which, if true, tells the validation to not show duplicate files in the techtree. This only applies when files are purged due to the above flags being set.

Example:

megaglest --validate-factions=magic,tech
--validate-scenario=a=purgeunused Displays a report detailing any known problems related to your selected scenario game data.
  • a is a single scenario to validate.
  • purgeunused is an optional parameter telling the validation to delete extra files in the scenario that are not used.
--data-path=x Sets the game data path to x.
--ini-path=x Sets the game INI path to x.
--log-path=x Sets the game logs path to x.
--show-ini-settings=x Display merged INI settings information. x is an optional property name to filter to a specific INI option (by default all are shown).

Example:

megaglest --show-ini-settings=DebugMode
--convert-models=a=b=keepsmallest Convert a model file or folder to the current G3D version format.
  • a is a filename or folder containing the G3D model(s).
  • b is an optional supported texture format to convert the model's texture to (TGA, BMP, JPG, or PNG).
  • keepsmallest is an optional flag indicating to keep original texture if its filesize is smaller than the converted format.

Example:

megaglest --convert-models=/m.g3d=png=keepsmallest
--use-language=x Forces the language to be the language specified by x, where x is a language filename or ISO639-1 code.

Example:

megaglest --use-language=en
--show-map-crc=x Show the calculated CRC for the map named x.
--show-tileset-crc=x Show the calculated CRC for the tileset named x.
--show-techtree-crc=x Show the calculated CRC for the techtree named x.
--show-scenario-crc=x Show the calculated CRC for the scenario named x.
--show-path-crc=x=y Show the calculated CRC for files in the path lo

cated in x using file filter y.

Example:

megaglest --show-path-crc=techs/=megapack.7z
--disable-backtrace Disables stack backtrace on errors.
--disable-sigsegv-handler Disables the sigsegv error handler.
--disable-vbo Disables trying to use Vertex Buffer Objects. This can prevent crashes with some considerably older graphics cards.
--disable-sound Disables the sound system.
--enable-legacyfontd Enables using the legacy font system.
--force-ftglfonts Forces use of the FTGL font system.
--resolution=x Overrides the video resolution. x is a string in the format of [width]x[height].

Example:

megaglest --resolution=1024x768
--colorbits=x Override the video color bits. x is a valid color bits value supported by your video driver.
--depthbits=x Override the video depth bits. x is a valid depth bits value supported by your video driver.
--fullscreen=x Override the video fullscreen mode. If x is true, the game is fullscreen, while false causes the game to be windowed.

Example:

megaglest --fullscreen=true
--use-font=x Override the font to use. x is the path and name of a font file supported by freetype2.

Example:

 megaglest --use-font=c:\Fonts\Vera.ttf
--font-basesize=x Override the font base size. x is the numeric base font size to use.

Example:

megaglest --font-basesize=5
--verbose Displays verbose information in the console.
--list-maps Displays a list of all maps.
--list-tilesets Displays a list of all tilesets.
--list-scenarios Displays a list of all scenarios.
--list-techtrees Displays a list of all techtrees.
--list-tutorials Displays a list of all tutorials.

See also[edit]