Difference between revisions of "SDK - Tools - Command Line - Environment Variables (FSX/A)"

From FSDeveloper Wiki
Jump to: navigation, search
m
m
Line 13: Line 13:
  
 
== Overview ==
 
== Overview ==
 +
 
=== Default Method ===
 
=== Default Method ===
 
Whilst you can drag a ''prepared file'' onto a desktop-shortcut to an SDK tool
 
Whilst you can drag a ''prepared file'' onto a desktop-shortcut to an SDK tool
Line 26: Line 27:
 
* You are unfamiliar with DOS command-line operations, (e.g. changing folders).
 
* You are unfamiliar with DOS command-line operations, (e.g. changing folders).
 
* You enter an incorrect path value.
 
* You enter an incorrect path value.
 +
 +
  
 
=== Environment Variables Method ===
 
=== Environment Variables Method ===
Line 43: Line 46:
 
* '''Variable name''' - A label that you enter.  
 
* '''Variable name''' - A label that you enter.  
 
* '''Variable value''' - Whatever that label actually calls/does.
 
* '''Variable value''' - Whatever that label actually calls/does.
 +
 +
  
 
== SDK's Tools ==
 
== SDK's Tools ==
Line 51: Line 56:
 
* '''ImageTool''' - Imagery format conversion for simobjects & scenery.
 
* '''ImageTool''' - Imagery format conversion for simobjects & scenery.
 
* '''Simpropcompiler''' - Compiling XML gauges, autogen related files, & missions.
 
* '''Simpropcompiler''' - Compiling XML gauges, autogen related files, & missions.
 +
 +
  
 
== Operating System ==
 
== Operating System ==
Line 92: Line 99:
 
variable value
 
variable value
 
</pre>
 
</pre>
 +
  
 
=== FSX paths - Core ===
 
=== FSX paths - Core ===
Line 116: Line 124:
 
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\
 
C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\
 
</pre>
 
</pre>
 +
  
 
=== Tool Paths - Optional ===
 
=== Tool Paths - Optional ===
Line 128: Line 137:
 
<br>
 
<br>
 
and must be entered '''exactly''' as below.
 
and must be entered '''exactly''' as below.
 +
  
 
==== BGLComp ====
 
==== BGLComp ====
Line 138: Line 148:
 
<br>
 
<br>
 
allowing differentiation between FSX and FS9 bglcomp versions.
 
allowing differentiation between FSX and FS9 bglcomp versions.
 +
  
 
==== ImageTool ====
 
==== ImageTool ====
Line 147: Line 158:
  
 
ImageTool will launch the GUI if no parameters are supplied.
 
ImageTool will launch the GUI if no parameters are supplied.
 +
  
 
==== Resample ====
 
==== Resample ====
Line 154: Line 166:
 
"%FSXSDK_ROOT%Environment Kit\Terrain SDK\resample.exe"
 
"%FSXSDK_ROOT%Environment Kit\Terrain SDK\resample.exe"
 
</pre>
 
</pre>
 +
  
 
==== Shp2Vec ====
 
==== Shp2Vec ====
Line 173: Line 186:
 
i.e.
 
i.e.
 
<pre>Shp2Vec . string -flags</pre>
 
<pre>Shp2Vec . string -flags</pre>
 +
  
 
==== Simpropcompiler ====
 
==== Simpropcompiler ====
Line 187: Line 201:
 
%Simpropcompiler% 2spb -symbols "%FSX_ROOT%propdefs\*.xml"
 
%Simpropcompiler% 2spb -symbols "%FSX_ROOT%propdefs\*.xml"
 
</pre>
 
</pre>
 +
  
 
== Useage ==
 
== Useage ==
Line 195: Line 210:
 
* Right-click on that folder
 
* Right-click on that folder
 
* From the context-menu, left-click '''Open Command Window Here'''
 
* From the context-menu, left-click '''Open Command Window Here'''
 +
  
 
==== Windows 7 ====
 
==== Windows 7 ====
Line 200: Line 216:
 
* SHIFT + Right-click on that folder
 
* SHIFT + Right-click on that folder
 
* From the context-menu, left-click '''Open Command Window Here'''
 
* From the context-menu, left-click '''Open Command Window Here'''
 +
  
 
=== Running ===
 
=== Running ===
Line 205: Line 222:
 
<br>
 
<br>
 
you must '''always''' wrap it in '''%''' characters.
 
you must '''always''' wrap it in '''%''' characters.
 +
  
 
==== Testing ====
 
==== Testing ====
Line 218: Line 236:
 
<br>
 
<br>
 
the tool will prompt you with example parameters.
 
the tool will prompt you with example parameters.
 +
  
 
==== Normal ====
 
==== Normal ====
Line 233: Line 252:
  
 
The output .spb will be in the current folder.
 
The output .spb will be in the current folder.
 +
  
 
== Related ==
 
== Related ==
 +
 
=== Internal ===
 
=== Internal ===
 
{{Template:Navbox-SDK (FSX)-Related}}
 
{{Template:Navbox-SDK (FSX)-Related}}

Revision as of 07:02, 8 February 2011

A method to simplify working with the FSX/A SDK's command-line tools,
by configuring environment variables, (a one-time operation).

Overview

Default Method

Whilst you can drag a prepared file onto a desktop-shortcut to an SDK tool
and that prepared file will then be processed by the tool,
sometimes things don't go as expected.

Using the command-line tools can be a little awkward,
particularly when -

  • Your source information, or data files contain errors.
  • You are unfamiliar with DOS command-line operations, (e.g. changing folders).
  • You enter an incorrect path value.


Environment Variables Method

Environment variables - Global values or settings, (available across sessions).
in this case, just think of it as a dynamic shortcut.

Once applied, these environment variables will -

  • Be available in any subsequently launched Command Prompt Window session.
  • Allow you to launch an SDK tool directly from any folder.
  • Works across drives.
  • Output directly to the launching folder location, or any chosen location.
  • Ensure consistency and simplify/speed up your command-line entry.
  • Allow you to see any error messages

Each Environment variable comprises of a -

  • Variable name - A label that you enter.
  • Variable value - Whatever that label actually calls/does.


SDK's Tools

List of FSX/A SDK's tools that utilise the Command Prompt Window, (aka DOS box).

  • BGLComp - Compiling scenery placement, airport data, & mission rewards
  • Resample - Compiling elevation, land/water class, photoscenery, etc. data.
  • Shp2Vec - Compiling vector data.
  • ImageTool - Imagery format conversion for simobjects & scenery.
  • Simpropcompiler - Compiling XML gauges, autogen related files, & missions.


Operating System

Applicable to XP/Vista/Win7 operating systems -

  • Click Start -> Control Panel -> System
  • A dialog box opens.
  • Click the tab titled Advanced
  • Click the button labeled Environment Variables
  • A dialog box opens.

In the top section titled User Variables for <LOGIN-NAME>

  • Click the button labeled New
  • A dialog box opens.

Enter the -

  • Variable name.
  • Variable value.
  • Click apply.

Repeat for any additional variable name/value pairs.

Once finished adding the variable name/value pairs -

  • Click OK.
  • Click OK.

These environment variables will now be available in any subsequently launched Command Prompt Window session.


FSX/A specific variables

These variable name/value pairs must be entered exactly as below,
(N.B. some utilise quotes, some don't).

The samples below are laid out as follows -

variable name

variable value


FSX paths - Core

Single-source base path variables essential for use in all tool variables.
This approach has been adopted to minimise -

  • configuration
  • possible path errors
  • path replication

Examples below are for default installations.
If required, edit these paths to match your specific installation's locations

FSX_ROOT

C:\Program Files\Microsoft Games\Microsoft Flight Simulator X\
FSXSDK_ROOT

C:\Program Files\Microsoft Games\Microsoft Flight Simulator X SDK\SDK\


Tool Paths - Optional

Variables for calling the individual tools.

NB
The variable names I've used are identical to the actual tool's names, (to ease remembering).

The variable values rely on concatenating the tool paths
and must be entered exactly as below.


BGLComp

BGLCompX

"%FSXSDK_ROOT%Environment Kit\BGL Compiler SDK\bglcomp.exe"

Note the appended X suffix in the variable name,
allowing differentiation between FSX and FS9 bglcomp versions.


ImageTool

ImageTool

"%FSXSDK_ROOT%Environment Kit\Terrain SDK\ImageTool.exe"

ImageTool will launch the GUI if no parameters are supplied.


Resample

Resample

"%FSXSDK_ROOT%Environment Kit\Terrain SDK\resample.exe"


Shp2Vec

Shp2Vec

"%FSXSDK_ROOT%Environment Kit\Terrain SDK\Shp2Vec.exe"

Shp2Vec default method useage requires a path parameter.
i.e.

Shp2Vec path string -flags

As the environment variable method is working in the context of the local folder,
just type a . to represent context of the local folder
i.e.

Shp2Vec . string -flags


Simpropcompiler

Simpropcompiler

"%FSXSDK_ROOT%Core Utilities Kit\SimProp\Simpropcompiler.exe"

An extra for any frequent .SPB creators.

SPC2SPB

%Simpropcompiler% 2spb -symbols "%FSX_ROOT%propdefs\*.xml"


Useage

Opening

In explorer, (file manager) -

  • Navigate to your project's data folder, (whatever you're intending to process)
  • Right-click on that folder
  • From the context-menu, left-click Open Command Window Here


Windows 7

  • Navigate to your project's data folder, (whatever you're intending to process)
  • SHIFT + Right-click on that folder
  • From the context-menu, left-click Open Command Window Here


Running

As you are calling a variable
you must always wrap it in % characters.


Testing

For test purposes to prove its working,
type in a %variable_name% , (case insensitive) -
e.g.

%bglcompx%

Pressing the return key, will now run bglcomp in the context of the local folder.

As you've not supplied any parameters
the tool will prompt you with example parameters.


Normal

For normal useage
type in a %variable_name% followed by any required parameters.

Example 1
%bglcompx% yourproject.xml

The output .bgl or .rwd will be in the current folder.

Example 2
%spb2spc% yourproject.xml

The output .spb will be in the current folder.


Related

Internal

External

Placeholder text