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:
- Positionable#POSITIONABLE.New(): Create a POSITIONABLE instance.
1.2) POSITIONABLE methods:
The following methods can be used to identify an measurable object:
- Positionable#POSITIONABLE.GetID(): Returns the ID of the measurable object.
- Positionable#POSITIONABLE.GetName(): Returns the name of the 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:GetMessage(Message, Duration, Name) |
Returns a message with the callsign embedded (if there is one). |
| POSITIONABLE:GetPointVec2() |
Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission. |
| POSITIONABLE:GetPointVec3() |
Returns a POINT_VEC3 object indicating the point in 3D 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:GetRadio() |
Create a Radio#RADIO, to allow radio transmission for this POSITIONABLE. |
| 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:Message(Message, Duration, Name) |
Send a message to the players in the Group. |
| POSITIONABLE:MessageToAll(Message, Duration, Name) |
Send a message to all coalitions. |
| POSITIONABLE:MessageToBlue(Message, Duration, Name) |
Send a message to the blue coalition. |
| POSITIONABLE:MessageToClient(Message, Duration, Client, Name) |
Send a message to a client. |
| POSITIONABLE:MessageToCoalition(Message, Duration, MessageCoalition, Name) |
Send a message to a coalition. |
| POSITIONABLE:MessageToGroup(Message, Duration, MessageGroup, Name) |
Send a message to a Group. |
| POSITIONABLE:MessageToRed(Message, Duration, Name) |
Send a message to the red coalition. |
| POSITIONABLE:New(PositionableName) |
Create a new POSITIONABLE from a DCSPositionable |
| POSITIONABLE.PositionableName |
The name of the measurable. |
Global(s)
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
-
Dcs.DCSTypes#Distance: The altitude of the POSITIONABLE.
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:GetHeading()
-
Returns the POSITIONABLE heading in degrees.
Return values
-
#number: The POSTIONABLE heading
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:GetMessage(Message, Duration, Name)
-
Returns a message with the callsign embedded (if there is one).
Parameters
-
#string Message: The message text -
Dcs.DCSTypes#Duration Duration: The duration of the message. -
#string Name: (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
Return value
-
- POSITIONABLE:GetPointVec2()
-
Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission.
Return values
-
Core.Point#POINT_VEC2: The 2D point vector of the POSITIONABLE.
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:GetPointVec3()
-
Returns a POINT_VEC3 object indicating the point in 3D of the POSITIONABLE within the mission.
Return values
-
Core.Point#POINT_VEC3: The 3D point vector of the POSITIONABLE.
-
#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
-
Dcs.DCSTypes#Position: The 3D position vectors of the POSITIONABLE.
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:GetRadio()
-
Create a Radio#RADIO, to allow radio transmission for this POSITIONABLE.
Set parameters with the methods provided, then use RADIO:Broadcast() to actually broadcast the message
Return value
#RADIO: Radio
- POSITIONABLE:GetRandomVec3(Radius)
-
Returns a random DCSTypes#Vec3 vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.
Parameter
-
#number Radius:
Return values
-
Dcs.DCSTypes#Vec3: The 3D point vector of the POSITIONABLE.
-
#nil: The POSITIONABLE is not existing or alive.
Usage:
-- If Radius is ignored, returns the Dcs.DCSTypes#Vec3 of first UNIT of the GROUP -
- POSITIONABLE:GetVec2()
-
Returns the DCSTypes#Vec2 vector indicating the point in 2D of the POSITIONABLE within the mission.
Return values
-
Dcs.DCSTypes#Vec2: The 2D point vector of the POSITIONABLE.
-
#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
-
Dcs.DCSTypes#Vec3: The 3D point vector of the POSITIONABLE.
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:GetVelocity()
-
Returns the POSITIONABLE velocity vector.
Return values
-
Dcs.DCSTypes#Vec3: The velocity vector
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:GetVelocityKMH()
-
Returns the POSITIONABLE velocity in km/h.
Return values
-
#number: The velocity in km/h
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:InAir()
-
Returns true if the POSITIONABLE is in the air.
Polymorphic, is overridden in GROUP and UNIT.
Return values
-
#boolean: true if in the air.
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:IsAboveRunway()
-
Returns if the Positionable is located above a runway.
Return values
-
#boolean: true if Positionable is above a runway.
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:Message(Message, Duration, Name)
-
Send a message to the players in the Group.
The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
Parameters
-
#string Message: The message text -
Dcs.DCSTypes#Duration Duration: The duration of the message. -
#string Name: (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
-
- POSITIONABLE:MessageToAll(Message, Duration, Name)
-
Send a message to all coalitions.
The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
Parameters
-
#string Message: The message text -
Dcs.DCSTypes#Duration Duration: The duration of the message. -
#string Name: (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
-
- POSITIONABLE:MessageToBlue(Message, Duration, Name)
-
Send a message to the blue coalition.
The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
Parameters
-
#string Message: The message text -
Dcs.DCSTypes#Duration Duration: The duration of the message. -
#string Name: (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
-
- POSITIONABLE:MessageToClient(Message, Duration, Client, Name)
-
Send a message to a client.
The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
Parameters
-
#string Message: The message text -
Dcs.DCSTypes#Duration Duration: The duration of the message. -
Wrapper.Client#CLIENT Client: The client object receiving the message. -
#string Name: (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
-
- POSITIONABLE:MessageToCoalition(Message, Duration, MessageCoalition, Name)
-
Send a message to a coalition.
The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
Parameters
-
#string Message: The message text -
Dcs.DCSTYpes#Duration Duration: The duration of the message. -
Dcs.DCScoalition#coalition MessageCoalition: The Coalition receiving the message. -
#string Name: (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
-
- POSITIONABLE:MessageToGroup(Message, Duration, MessageGroup, Name)
-
Send a message to a Group.
The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
Parameters
-
#string Message: The message text -
Dcs.DCSTypes#Duration Duration: The duration of the message. -
Wrapper.Group#GROUP MessageGroup: The GROUP object receiving the message. -
#string Name: (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
-
- POSITIONABLE:MessageToRed(Message, Duration, Name)
-
Send a message to the red coalition.
The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
Parameters
-
#string Message: The message text -
Dcs.DCSTYpes#Duration Duration: The duration of the message. -
#string Name: (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
-
- POSITIONABLE:New(PositionableName)
-
Create a new POSITIONABLE from a DCSPositionable
Parameter
-
Dcs.DCSWrapper.Positionable#Positionable PositionableName: The POSITIONABLE name
Return value
#POSITIONABLE: self
-
- #string POSITIONABLE.PositionableName
-
The name of the measurable.