Module Positionable
Wrapper -- POSITIONABLE wraps DCS classes that are "positionable".
Author: FlightControl
Contributions:
Global(s)
POSITIONABLE |
POSITIONABLE class, extends Identifiable#IDENTIFIABLEThe POSITIONABLE class is a wrapper class to handle the POSITIONABLE objects:
|
Type DCSPositionable
DCSPositionable.id_ |
The ID of the controllable in DCS |
Type POSITIONABLE
POSITIONABLE:AddCargo(Cargo) |
Add cargo. |
POSITIONABLE:CargoItemCount() |
Get cargo item count. |
POSITIONABLE:ClearCargo() |
Clear all cargo. |
POSITIONABLE:Flare(FlareColor) |
Signal a flare at the position of the POSITIONABLE. |
POSITIONABLE:FlareGreen() |
Signal a green flare at the position of the POSITIONABLE. |
POSITIONABLE:FlareRed() |
Signal a red flare at the position of the POSITIONABLE. |
POSITIONABLE:FlareWhite() |
Signal a white flare at the position of the POSITIONABLE. |
POSITIONABLE:FlareYellow() |
Signal a yellow flare at the position of the POSITIONABLE. |
POSITIONABLE:GetAltitude() |
Returns the altitude of the POSITIONABLE. |
POSITIONABLE:GetBeacon() |
Create a Radio#BEACON, to allow this POSITIONABLE to broadcast beacon signals |
POSITIONABLE:GetBoundingBox() |
Get the bounding box of the underlying POSITIONABLE DCS Object. |
POSITIONABLE:GetCargo() |
Get all contained cargo. |
POSITIONABLE:GetCoordinate() |
Returns a COORDINATE object indicating the point in 3D of the POSITIONABLE within the mission. |
POSITIONABLE:GetHeading() |
Returns the POSITIONABLE heading in degrees. |
POSITIONABLE:GetHeight() |
Returns the POSITIONABLE height in meters. |
POSITIONABLE:GetLaserCode() |
Get the last assigned laser code |
POSITIONABLE:GetMessage(Message, Duration, Name) |
Returns a message with the callsign embedded (if there is one). |
POSITIONABLE:GetMessageText(Message, Name) |
Returns the message text with the callsign embedded (if there is one). |
POSITIONABLE:GetMessageType(Message, MessageType, Name) |
Returns a message of a specified type 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:GetSize() | |
POSITIONABLE:GetSpot() |
Get the Spot |
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 a Velocity object from the positionable. |
POSITIONABLE:GetVelocityKMH() |
Returns the POSITIONABLE velocity in km/h. |
POSITIONABLE:GetVelocityMPS() |
Returns the POSITIONABLE velocity in meters per second. |
POSITIONABLE:GetVelocityVec3() |
Returns the POSITIONABLE velocity Vec3 vector. |
POSITIONABLE:HasCargo(Cargo) |
Returns if carrier has given cargo. |
POSITIONABLE:InAir() |
Returns true if the POSITIONABLE is in the air. |
POSITIONABLE:IsAboveRunway() |
Returns if the Positionable is located above a runway. |
POSITIONABLE:IsLasing() |
Check if the POSITIONABLE is lasing a target |
POSITIONABLE:LaseOff() |
Stop Lasing a POSITIONABLE |
POSITIONABLE:LaseUnit(Target, LaserCode, Duration) |
Start Lasing a POSITIONABLE |
POSITIONABLE.LaserCode | |
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:MessageToSetGroup(Message, Duration, MessageSetGroup, Name) |
Send a message to a Set#SET_GROUP. |
POSITIONABLE:MessageTypeToCoalition(Message, MessageType, MessageCoalition, Name) |
Send a message to a coalition. |
POSITIONABLE:MessageTypeToGroup(Message, MessageType, MessageGroup, Name) |
Send a message of a message type to a Group. |
POSITIONABLE:New(PositionableName) |
Create a new POSITIONABLE from a DCSPositionable |
POSITIONABLE:RemoveCargo(Cargo) |
Remove cargo. |
POSITIONABLE:Smoke(SmokeColor, Range, AddHeight) |
Smoke the POSITIONABLE. |
POSITIONABLE:SmokeBlue() |
Smoke the POSITIONABLE Blue. |
POSITIONABLE:SmokeGreen() |
Smoke the POSITIONABLE Green. |
POSITIONABLE:SmokeOrange() |
Smoke the POSITIONABLE Orange. |
POSITIONABLE:SmokeRed() |
Smoke the POSITIONABLE Red. |
POSITIONABLE:SmokeWhite() |
Smoke the POSITIONABLE White. |
POSITIONABLE.Spot | |
POSITIONABLE.__ |
Type POSITIONABLE.__
POSITIONABLE.__.Cargo |
Global(s)
- #POSITIONABLE POSITIONABLE
-
POSITIONABLE class, extends Identifiable#IDENTIFIABLE
The 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.
POSITIONABLE constructor
The POSITIONABLE class provides the following functions to construct a POSITIONABLE instance:
- POSITIONABLE.New(): Create a POSITIONABLE instance.
Get the current speed
There are 3 methods that can be used to determine the speed. Use POSITIONABLE.GetVelocityKMH() to retrieve the current speed in km/h. Use POSITIONABLE.GetVelocityMPS() to retrieve the speed in meters per second. The method POSITIONABLE.GetVelocity() returns the speed vector (a Vec3).
Get the current altitude
Altitude can be retrieved using the method POSITIONABLE.GetHeight() and returns the current altitude in meters from the orthonormal plane.
Type Positionable
Type DCSPositionable
A DCSPositionable
Field(s)
- DCSPositionable.id_
-
The ID of the controllable in DCS
Type POSITIONABLE
Extends Wrapper.Identifiable#IDENTIFIABLE
Field(s)
- POSITIONABLE:AddCargo(Cargo)
-
Add cargo.
Parameter
-
Core.Cargo#CARGO Cargo
:
Return value
-
- POSITIONABLE:CargoItemCount()
-
Get cargo item count.
Return value
Core.Cargo#CARGO: Cargo
- POSITIONABLE:ClearCargo()
-
Clear all cargo.
- POSITIONABLE:Flare(FlareColor)
-
Signal a flare at the position of the POSITIONABLE.
Parameter
-
Utilities.Utils#FLARECOLOR FlareColor
:
-
- POSITIONABLE:FlareGreen()
-
Signal a green flare at the position of the POSITIONABLE.
- POSITIONABLE:FlareRed()
-
Signal a red flare at the position of the POSITIONABLE.
- POSITIONABLE:FlareWhite()
-
Signal a white flare at the position of the POSITIONABLE.
- POSITIONABLE:FlareYellow()
-
Signal a yellow flare at the position of the POSITIONABLE.
- 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:GetBeacon()
-
Create a Radio#BEACON, to allow this POSITIONABLE to broadcast beacon signals
Return value
#RADIO: Radio
- POSITIONABLE:GetBoundingBox()
-
Get the bounding box of the underlying POSITIONABLE DCS Object.
Return values
-
Dcs.DCSTypes#Distance: The bounding box of the POSITIONABLE.
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:GetCargo()
-
Get all contained cargo.
Return value
- POSITIONABLE:GetCoordinate()
-
Returns a COORDINATE object indicating the point in 3D of the POSITIONABLE within the mission.
Return value
Core.Point#COORDINATE: The COORDINATE of the POSITIONABLE.
- POSITIONABLE:GetHeading()
-
Returns the POSITIONABLE heading in degrees.
Return values
-
#number: The POSTIONABLE heading
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:GetHeight()
-
Returns the POSITIONABLE height in meters.
Return values
-
Dcs.DCSTypes#Vec3: The height of the positionable.
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:GetLaserCode()
-
Get the last assigned laser code
Return value
#number: The laser code
- 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:GetMessageText(Message, Name)
-
Returns the message text with the callsign embedded (if there is one).
Parameters
-
#string Message
: The message text -
#string Name
: (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
Return value
#string: The message text
-
- POSITIONABLE:GetMessageType(Message, MessageType, Name)
-
Returns a message of a specified type with the callsign embedded (if there is one).
Parameters
-
#string Message
: The message text -
Core.Message#MESSAGE MessageType
: MessageType The message type. -
#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:GetSpot()
-
Get the Spot
Return value
Core.Spot#SPOT: The Spot
- 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 a Velocity object from the positionable.
Return values
-
Core.Velocity#VELOCITY: Velocity The Velocity object.
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:GetVelocityKMH()
-
Returns the POSITIONABLE velocity in km/h.
Return value
#number: The velocity in km/h
- POSITIONABLE:GetVelocityMPS()
-
Returns the POSITIONABLE velocity in meters per second.
Return value
#number: The velocity in meters per second.
- POSITIONABLE:GetVelocityVec3()
-
Returns the POSITIONABLE velocity Vec3 vector.
Return values
-
Dcs.DCSTypes#Vec3: The velocity Vec3 vector
-
#nil: The POSITIONABLE is not existing or alive.
-
- POSITIONABLE:HasCargo(Cargo)
-
Returns if carrier has given cargo.
Parameter
-
Cargo
:
Return value
Core.Cargo#CARGO: Cargo
-
- 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:IsLasing()
-
Check if the POSITIONABLE is lasing a target
Return value
#boolean: true if it is lasing a target
- POSITIONABLE:LaseOff()
-
Stop Lasing a POSITIONABLE
Return value
- POSITIONABLE:LaseUnit(Target, LaserCode, Duration)
-
Start Lasing a POSITIONABLE
Parameters
-
#POSITIONABLE Target
: -
#number LaserCode
: -
#number Duration
:
Return value
-
- 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:MessageToSetGroup(Message, Duration, MessageSetGroup, Name)
-
Send a message to a Set#SET_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. -
Core.Set#SET_GROUP MessageSetGroup
: The SET_GROUP collection receiving the message. -
#string Name
: (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
-
- POSITIONABLE:MessageTypeToCoalition(Message, MessageType, 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 -
Core.Message#MESSAGE.Type MessageType
: The message type that determines the duration. -
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:MessageTypeToGroup(Message, MessageType, MessageGroup, Name)
-
Send a message of a message type 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 -
Core.Message#MESSAGE.Type MessageType
: The message type that determines the duration. -
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:New(PositionableName)
-
Create a new POSITIONABLE from a DCSPositionable
Parameter
-
Dcs.DCSWrapper.Positionable#Positionable PositionableName
: The POSITIONABLE name
Return value
#POSITIONABLE: self
-
- POSITIONABLE:RemoveCargo(Cargo)
-
Remove cargo.
Parameter
-
Core.Cargo#CARGO Cargo
:
Return value
-
- POSITIONABLE:Smoke(SmokeColor, Range, AddHeight)
-
Smoke the POSITIONABLE.
Parameters
-
Utilities.Utils#SMOKECOLOR SmokeColor
: The color to smoke to positionable. -
#number Range
: The range in meters to randomize the smoking around the positionable. -
#number AddHeight
: The height in meters to add to the altitude of the positionable.
-
- POSITIONABLE:SmokeBlue()
-
Smoke the POSITIONABLE Blue.
- POSITIONABLE:SmokeGreen()
-
Smoke the POSITIONABLE Green.
- POSITIONABLE:SmokeOrange()
-
Smoke the POSITIONABLE Orange.
- POSITIONABLE:SmokeRed()
-
Smoke the POSITIONABLE Red.
- POSITIONABLE:SmokeWhite()
-
Smoke the POSITIONABLE White.