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
CoalitionObjectandObject.Static functions#
- static getByName(name)#
Returns the
StaticObjectwith the given name, ornilif it does not exist.- Parameters:
name (
string) – Static object name.- Returns:
The matching static object, or
nil.- Return type:
- 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().category – not static:getCategory(), which always
returns Object.Category.STATIC, except for cargo objects, described below):
Value |
Meaning |
|---|---|
|
Void ( |
|
Unit ( |
|
Weapon ( |
|
Static ( |
|
Base ( |
|
Scenery ( |
|
Cargo ( |
Footnotes#
Cargo objects are still
StaticObjectinstances and retain access to the full static object member function set. However, unlike other static object types,Object.getCategory()on a cargo object returns6(matchingStaticObject.Category.CARGO) rather than3.