Command Line Options: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "The following command line options are available if launching MapTool from a a shell or command prompt. The full option name may be used or just the first letter. The follow...")
 
m (Cleanup and additional details)
 
(15 intermediate revisions by 6 users not shown)
Line 1: Line 1:
The following command line options are available if launching MapTool from a a shell or command prompt.
== MapTool Command Line Usage ==
You can pass MapTool options when launching from a shell, command prompt, or desktop shortcut.  They can be used both when using the MapTool executable launcher (MapTool.exe) '''[now obsolete]''' or when launching the jar file (maptool-1.x.x.x.jar) directly.


The full option name may be used or just the first letter.
''This functionality is intended for use by advanced users or developers.''


If you're not familiar with using your operating system's command line interface, this is not the page you want.
=== Applies To ===
'''MapTool Version:''' 1.5+<br/>
'''Java Version:''' MT version 1.5 can only use Java 10 with JavaFX.
In general, each version of Java has a corresponding version of JavaFX.  They don't have to always match, but it will likely be easier to get MapTool running if they do.
=== Launching MapTool via Jar File ===
When launching MapTool via the jar file you should specify memory settings as in the example below.  With no other options specified, the command below will start MapTool with 2GB of memory and a 4MB stack size using the 1.5.0.0 jar file.  Note that the jar file name must match exactly.
javaw -Xmx2048M -Xss4M -jar maptool-1.5.0.0.jar
=== Command Line Options ===
The following command line options are available.  The full option name may be used or just the first letter, as shown.
==== Boolean Options (on/off) ====
The following options have no parameters and take the form of:
The following options have no parameters and take the form of:
  javaw -jar maptool-x.x.x.x.jar -option
  '''javaw -jar maptool-x.x.x.x.jar''' ''-option''
 
-d/-debug - Turn on enhanced debug output
-m/-macros - Output list of predefined macro functions
-r/-reset - Reset startup options to defaults
-f/-fullscreen - Maximize the MapTool window
==== Parameterized (require a value) ====
The following options require a single parameter and take the form of:
'''javaw -jar maptool-x.x.x.x.jar''' ''-option=value''


  d/debug - Turn on System.out enhanced debug output
  -v/-version - Override MapTool version
  m/macros - Output list of defined macro functions
  -m/-monitor - Sets which monitor to use; first monitor is '''0'''
r/reset - Reset startup options to defaults
  -F/-file - Load a campaign file automatically after starting MapTool
  f/fullscreen - Maximize MapTool window


The following options require a single parameter and take the form of:
==== Screen Display Options ====
  javaw -jar maptool-x.x.x.x.jar -option=value
These options require the '''monitor''' option be specified on the same command line.
  '''javaw -jar maptool-x.x.x.x.jar -monitor=n''' ''-option=value''
 
-w/-width - Override MapTool window width
-h/-height - Override MapTool window height
-x/-xpos - Override MapTool window starting x coordinate
-y/-ypos - Override MapTool window starting y coordinate
 
=== High DPI Display Options ===
There are system properties that can be set to control the scaling of MapTool's UI.  These can be passed as command line options (as above) or in the {{code|[JavaOptions]}} section of the {{code|MapTool.cfg}} file. The default scaling of ''1.0'' assumes a 96 DPI display.  (Using this option in combination with Windows High DPI scaling may produce undesirable effects.)
 
For a 120 DPI display, try one of the following in your {{code|MapTool.cfg}} file:
java-options=-Dsun.java2d.uiScale=1.25
java-options=-Dsun.java2d.uiScale=125%
java-options=-Dsun.java2d.uiScale=120dpi
 
On Linux under X11, you can adjust MapTool's scaling by passing:
-Dsun.java2d.uiScale=2.0
 
If you are using a system-wide install, these settings can be added to:
/opt/maptool/lib/app/MapTool.cfg


  v/version - Override MapTool version
under the {{code|[JavaOptions]}} section as
m/monitor - Sets which monitor to use beginning with 0.
  java-options=-Dsun.java2d.uiScale=2.0


These options require the monitor option be specified on the same command line.
Note that other Java-specific configurations can be controlled using the same approach. For example, the antialiasing feature of Java Swing (the library MapTool uses for most text displays) can be enabled or disabled by using:
  javaw -jar maptool-x.x.x.x.jar -monitor -option=value
  -Djavax.swing.antialiasing=on
or
-Djavax.swing.antialiasing=off
on the command line, or by embedding one of those in the {{code|MapTool.cfg}} file, as described above.


w/width - Override MapTool window width
== Examples ==
h/height - Override MapTool window height
Here are various examples demonstrating the use of some of the above options.
x/xpos - Override MapTool window starting x coordinate
y/ypos - Override MapTool window starting y coordinate


'''Examples:'''
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -version=1.5.6.7
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -version=1.5.6.7
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -v=1.5.6.7
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -v=1.5.6.7
Line 32: Line 78:
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -monitor=0 -width=800 -height=800
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -monitor=0 -width=800 -height=800
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -monitor=0 -xpos=20 -ypos=20
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -monitor=0 -xpos=20 -ypos=20
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -monitor=0 -x=20 -y=20 -w=800 -ht=1200
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -monitor=0 -x=20 -y=20 -w=800 -h=1200
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -m=0 -xpos=150 -y=150 -width=1000 -height=1200
  javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -m=0 -xpos=150 -y=150 -width=1000 -height=1200
javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -file=mycampaign.cmpgn
[[Category:Feature Guide]]

Latest revision as of 23:59, 14 January 2024

MapTool Command Line Usage

You can pass MapTool options when launching from a shell, command prompt, or desktop shortcut. They can be used both when using the MapTool executable launcher (MapTool.exe) [now obsolete] or when launching the jar file (maptool-1.x.x.x.jar) directly.

This functionality is intended for use by advanced users or developers.

If you're not familiar with using your operating system's command line interface, this is not the page you want.

Applies To

MapTool Version: 1.5+
Java Version: MT version 1.5 can only use Java 10 with JavaFX.

In general, each version of Java has a corresponding version of JavaFX. They don't have to always match, but it will likely be easier to get MapTool running if they do.

Launching MapTool via Jar File

When launching MapTool via the jar file you should specify memory settings as in the example below. With no other options specified, the command below will start MapTool with 2GB of memory and a 4MB stack size using the 1.5.0.0 jar file. Note that the jar file name must match exactly.

javaw -Xmx2048M -Xss4M -jar maptool-1.5.0.0.jar

Command Line Options

The following command line options are available. The full option name may be used or just the first letter, as shown.

Boolean Options (on/off)

The following options have no parameters and take the form of:

javaw -jar maptool-x.x.x.x.jar -option
-d/-debug - Turn on enhanced debug output
-m/-macros - Output list of predefined macro functions
-r/-reset - Reset startup options to defaults
-f/-fullscreen - Maximize the MapTool window

Parameterized (require a value)

The following options require a single parameter and take the form of:

javaw -jar maptool-x.x.x.x.jar -option=value
-v/-version - Override MapTool version
-m/-monitor - Sets which monitor to use; first monitor is 0
-F/-file - Load a campaign file automatically after starting MapTool

Screen Display Options

These options require the monitor option be specified on the same command line.

javaw -jar maptool-x.x.x.x.jar -monitor=n -option=value
-w/-width - Override MapTool window width
-h/-height - Override MapTool window height
-x/-xpos - Override MapTool window starting x coordinate
-y/-ypos - Override MapTool window starting y coordinate

High DPI Display Options

There are system properties that can be set to control the scaling of MapTool's UI. These can be passed as command line options (as above) or in the [JavaOptions] section of the MapTool.cfg file. The default scaling of 1.0 assumes a 96 DPI display. (Using this option in combination with Windows High DPI scaling may produce undesirable effects.)

For a 120 DPI display, try one of the following in your MapTool.cfg file:

java-options=-Dsun.java2d.uiScale=1.25
java-options=-Dsun.java2d.uiScale=125%
java-options=-Dsun.java2d.uiScale=120dpi

On Linux under X11, you can adjust MapTool's scaling by passing:

-Dsun.java2d.uiScale=2.0

If you are using a system-wide install, these settings can be added to:

/opt/maptool/lib/app/MapTool.cfg

under the [JavaOptions] section as

java-options=-Dsun.java2d.uiScale=2.0

Note that other Java-specific configurations can be controlled using the same approach. For example, the antialiasing feature of Java Swing (the library MapTool uses for most text displays) can be enabled or disabled by using:

-Djavax.swing.antialiasing=on

or

-Djavax.swing.antialiasing=off

on the command line, or by embedding one of those in the MapTool.cfg file, as described above.

Examples

Here are various examples demonstrating the use of some of the above options.

javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -version=1.5.6.7
javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -v=1.5.6.7
javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -fullscreen
javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -f
javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -monitor=0 -width=800 -height=800
javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -monitor=0 -xpos=20 -ypos=20
javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -monitor=0 -x=20 -y=20 -w=800 -h=1200
javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -m=0 -xpos=150 -y=150 -width=1000 -height=1200
javaw -Xmx2048M -Xss1M -jar maptool-1.5.0.0.jar -file=mycampaign.cmpgn