Module Positionable

This module contains the POSITIONABLE class.

1) Positionable#POSITIONABLE class, extends Identifiable#IDENTIFIABLE

The Positionable#POSITIONABLE class is a wrapper class to handle the POSITIONABLE objects:

  • Support all DCS APIs.
  • Enhance with POSITIONABLE specific APIs not in the DCS API set.
  • Manage the "state" of the POSITIONABLE.

1.1) POSITIONABLE constructor:

The POSITIONABLE class provides the following functions to construct a POSITIONABLE instance:

1.2) POSITIONABLE methods:

The following methods can be used to identify an measurable object:


Global(s)

POSITIONABLE

Type DCSPositionable

DCSPositionable.id_

The ID of the controllable in DCS

Type POSITIONABLE

POSITIONABLE.ClassName
POSITIONABLE:GetAltitude()

Returns the altitude of the POSITIONABLE.

POSITIONABLE:GetHeading()

Returns the POSITIONABLE heading in degrees.

POSITIONABLE:GetPointVec2()

Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission.

POSITIONABLE:GetPositionVec3()

Returns the DCSTypes#Position3 position vectors indicating the point and direction vectors in 3D of the POSITIONABLE within the mission.

POSITIONABLE:GetRandomVec3(Radius)

Returns a random DCSTypes#Vec3 vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.

POSITIONABLE:GetVec2()

Returns the DCSTypes#Vec2 vector indicating the point in 2D of the POSITIONABLE within the mission.

POSITIONABLE:GetVec3()

Returns the DCSTypes#Vec3 vector indicating the 3D vector of the POSITIONABLE within the mission.

POSITIONABLE:GetVelocity()

Returns the POSITIONABLE velocity vector.

POSITIONABLE:GetVelocityKMH()

Returns the POSITIONABLE velocity in km/h.

POSITIONABLE:InAir()

Returns true if the POSITIONABLE is in the air.

POSITIONABLE:IsAboveRunway()

Returns if the Positionable is located above a runway.

POSITIONABLE:New(PositionableName)

Create a new POSITIONABLE from a DCSPositionable

POSITIONABLE.PositionableName

The name of the measurable.

Global(s)

#POSITIONABLE POSITIONABLE

Type Positionable

Type DCSPositionable

A DCSPositionable

Field(s)

DCSPositionable.id_

The ID of the controllable in DCS

Type POSITIONABLE

The POSITIONABLE class

Field(s)

#string POSITIONABLE.ClassName
POSITIONABLE:GetAltitude()

Returns the altitude of the POSITIONABLE.

Return values

  1. DCSTypes#Distance: The altitude of the POSITIONABLE.

  2. #nil: The POSITIONABLE is not existing or alive.

POSITIONABLE:GetHeading()

Returns the POSITIONABLE heading in degrees.

Return value

#number: The POSTIONABLE heading

POSITIONABLE:GetPointVec2()

Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission.

Return values

  1. Point#POINT_VEC2: The 2D point vector of the POSITIONABLE.

  2. #nil: The POSITIONABLE is not existing or alive.

POSITIONABLE:GetPositionVec3()

Returns the DCSTypes#Position3 position vectors indicating the point and direction vectors in 3D of the POSITIONABLE within the mission.

Return values

  1. DCSTypes#Position: The 3D position vectors of the POSITIONABLE.

  2. #nil: The POSITIONABLE is not existing or alive.

POSITIONABLE:GetRandomVec3(Radius)

Returns a random DCSTypes#Vec3 vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.

Parameter

  • Radius :

Return values

  1. DCSTypes#Vec3: The 3D point vector of the POSITIONABLE.

  2. #nil: The POSITIONABLE is not existing or alive.

POSITIONABLE:GetVec2()

Returns the DCSTypes#Vec2 vector indicating the point in 2D of the POSITIONABLE within the mission.

Return values

  1. DCSTypes#Vec2: The 2D point vector of the POSITIONABLE.

  2. #nil: The POSITIONABLE is not existing or alive.

POSITIONABLE:GetVec3()

Returns the DCSTypes#Vec3 vector indicating the 3D vector of the POSITIONABLE within the mission.

Return values

  1. DCSTypes#Vec3: The 3D point vector of the POSITIONABLE.

  2. #nil: The POSITIONABLE is not existing or alive.

POSITIONABLE:GetVelocity()

Returns the POSITIONABLE velocity vector.

Return values

  1. DCSTypes#Vec3: The velocity vector

  2. #nil: The POSITIONABLE is not existing or alive.

POSITIONABLE:GetVelocityKMH()

Returns the POSITIONABLE velocity in km/h.

Return values

  1. #number: The velocity in km/h

  2. #nil: The POSITIONABLE is not existing or alive.

POSITIONABLE:InAir()

Returns true if the POSITIONABLE is in the air.

Return values

  1. #boolean: true if in the air.

  2. #nil: The POSITIONABLE is not existing or alive.

POSITIONABLE:IsAboveRunway()

Returns if the Positionable is located above a runway.

Return values

  1. #boolean: true if Positionable is above a runway.

  2. #nil: The POSITIONABLE is not existing or alive.

POSITIONABLE:New(PositionableName)

Create a new POSITIONABLE from a DCSPositionable

Parameter

Return value

#POSITIONABLE: self

#string POSITIONABLE.PositionableName

The name of the measurable.