Variables


Contents
Related Links

Overview

The Prepar3D simulation has many different systems which interact with each other to create a cohesive simulation. These systems contain variables whose values can be manipulated. In this article, each of the available systems will be described and the relevant syntax to access and set variables will be covered.

For many systems that support variable access, a unit of measurement is necessary. See the Units of Measurement article for an overview of the available units and how to use them.


Systems That Support Variable Access

The following table describes all the systems that support variable access. When accessing a variable, there are systems that require the unit of measurement to be specified and some that do not.

System Prefix System Name Description Units Required?
A Simulation Variables Gets a specified variable from a simulation object. This is not limited to airplanes and can include variables that were registered dynamically by ISimObjects. These variables are typically referred to as SimVars. Yes
C Custom Variables Custom variable created from a module that can be accessed in Prepar3D. No
E Environment Variables Gets environment variables, such as current time. Yes
G Gauge Variables Gets a variable that is used to transfer unitless data between gauges. No
K Key Code Variables Variables of this kind are key codes that are sent from gauges to Prepar3D. No
L Local Gauge Variables Gets a variable that is defined by a gauge developer. These variables are typically referred to as L-Vars. No
M Mouse Variables Gets the state of the mouse for use in mouse click handlers. No
O Object Variables Gets a specified variable from an object (i.e. placed library objects). These variables are not currently available to SimObjects or ISimObjects. Yes
P Program related Variables Gets program variables, such as simulation rate Yes
R Resource String Variables Retrieves a string from the resource file. No
S Scenario Variables Gets a variable that is dynamically defined in a scenario which can be used for a variety of purposes such as storing previous states or to control the flow of the scenario. Yes
T Material Variables Gets and sets material properties such as color or texture values on the material to which it is bound. Yes


Components That Can Access Variables

The following table describes all the components that can access variables

Component Name Description
XML Gauges XML Gauges can access all of the variables that support variable access using scripting.
C++ Gauges C++ Gauges can access custom variables as well as local variables.
Autodesk® Scaleform® Gauges Autodesk Scaleform Gauges can access all of the systems that support variable access by using the VarGet and VarSet functions of the Prepar3D Interface in ActionScript.
SimConnect SimConnect can access simulation variables.
Scenario Scenarios can access all of the variables that support variable access using various forms of scenario scripting.
Materials

Materials can access the following variable types at any time:

Materials can access the following variable types when the material is associated with a SimObject or ISimObject: Materials can access the following variable types when the material is associated with a library object: See the Material Scripting article for more information.