Module Object

This module contains the OBJECT class.

1) Object#OBJECT class, extends Base#BASE

The Object#OBJECT class is a wrapper class to handle the DCS Object objects:

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

1.1) OBJECT constructor:

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

1.2) OBJECT methods:

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


Global(s)

OBJECT

Type DCSObject

DCSObject.id_

The ID of the controllable in DCS

Type OBJECT

OBJECT.ClassName
OBJECT:GetCallSign()

Returns the Object's callsign - the localized string.

OBJECT:GetCategoryName()

Returns the DCS Object category name as defined within the DCS Object Descriptor.

OBJECT:GetCoalition()

Returns coalition of the Object.

OBJECT:GetCountry()

Returns country of the Object.

OBJECT:GetDesc()

Returns Object descriptor.

OBJECT:GetName()

Returns DCS Object object name.

OBJECT:GetTypeName()

Returns the type name of the DCS Object.

OBJECT:IsAlive()

Returns if the Object is alive.

OBJECT:New(ObjectName)

Create a new OBJECT from a DCSObject

OBJECT.ObjectName

The name of the Object.

Global(s)

#OBJECT OBJECT

Type Object

Type DCSObject

A DCSObject

Field(s)

DCSObject.id_

The ID of the controllable in DCS

Type OBJECT

The OBJECT class

Field(s)

#string OBJECT.ClassName
OBJECT:GetCallSign()

Returns the Object's callsign - the localized string.

Return values

  1. #string: The Callsign of the Object.

  2. #nil: The DCS Object is not existing or alive.

OBJECT:GetCategoryName()

Returns the DCS Object category name as defined within the DCS Object Descriptor.

Return value

#string: The DCS Object Category Name

OBJECT:GetCoalition()

Returns coalition of the Object.

Return values

  1. DCSCoalitionObject#coalition.side: The side of the coalition.

  2. #nil: The DCS Object is not existing or alive.

OBJECT:GetCountry()

Returns country of the Object.

Return values

  1. DCScountry#country.id: The country identifier.

  2. #nil: The DCS Object is not existing or alive.

OBJECT:GetDesc()

Returns Object descriptor.

Descriptor type depends on Object category.

Return values

  1. DCSObject#Object.Desc: The Object descriptor.

  2. #nil: The DCS Object is not existing or alive.

OBJECT:GetName()

Returns DCS Object object name.

The function provides access to non-activated objects too.

Return values

  1. #string: The name of the DCS Object.

  2. #nil: The DCS Object is not existing or alive.

OBJECT:GetTypeName()

Returns the type name of the DCS Object.

Return values

  1. #string: The type name of the DCS Object.

  2. #nil: The DCS Object is not existing or alive.

OBJECT:IsAlive()

Returns if the Object is alive.

Return values

  1. #boolean: true if Object is alive.

  2. #nil: The DCS Object is not existing or alive.

OBJECT:New(ObjectName)

Create a new OBJECT from a DCSObject

Parameter

Return value

#OBJECT: self

#string OBJECT.ObjectName

The name of the Object.