StaticObject#

StaticObject represents static objects placed in the Mission Editor or spawned via coalition.addStaticObject(). It extends CoalitionObject (and, transitively, Object).

class StaticObject#

Inherits all member functions of CoalitionObject and Object.

Static functions#

static getByName(name)#

Returns the StaticObject with the given name, or nil if it does not exist.

Parameters:

name (string) – Static object name.

Returns:

The matching static object, or nil.

Return type:

StaticObject

static getDescByName(typeName)#

Returns a description table for a static object type.

Parameters:

typeName (string) – Static object type name.

Returns:

Description table.

Return type:

table

Member functions#

getID()#

Returns the static object’s numeric ID.

Returns:

Static object ID.

Return type:

number

getLife()#

Returns the static object’s current hit points.

Returns:

Current life.

Return type:

number

getCargoDisplayName()#

For cargo-type static objects, returns the display name shown to players.

Returns:

Cargo display name.

Return type:

string

getCargoWeight()#

For cargo-type static objects, returns the cargo’s weight, in kilograms.

Returns:

Cargo weight.

Return type:

number

getDrawArgumentValue(argument)#

Returns the current value of a 3D model animation argument.

Parameters:

argument (number) – Animation argument index.

Returns:

Current argument value.

Return type:

number

Enumerators#

StaticObject.Category identifies the specific static object category (via static:getDesc().categorynot static:getCategory(), which always returns Object.Category.STATIC, except for cargo objects, described below):

Value

Meaning

StaticObject.Category.VOID

Void (0)

StaticObject.Category.UNIT

Unit (1)

StaticObject.Category.WEAPON

Weapon (2)

StaticObject.Category.STATIC

Static (3)

StaticObject.Category.BASE

Base (4)

StaticObject.Category.SCENERY

Scenery (5)

StaticObject.Category.CARGO

Cargo (6)

Footnotes#

  • Cargo objects are still StaticObject instances and retain access to the full static object member function set. However, unlike other static object types, Object.getCategory() on a cargo object returns 6 (matching StaticObject.Category.CARGO) rather than 3.