Difference between revisions of "DCS Class Static Object"

From DCS World Wiki - Hoggitworld.com
 
(One intermediate revision by one other user not shown)
Line 12: Line 12:
 
|desc= Represents static objects added in the Mission Editor or via scripting commands.  
 
|desc= Represents static objects added in the Mission Editor or via scripting commands.  
  
|type= StaticObject.Category enum that stores StaticObject categories.
+
|type= StaticObject.Category enum that stores StaticObject categories.<br/>Note that StaticObject.Category values are <u>not</u> obtained by calling ''static'':getCategory() - that calls Object.getCategory(''static'') and will <u>always</u> return the value Object.Category.STATIC.  Instead you need to use ''static'':getDesc().category to find the StaticObject.Category!
  
 
  StaticObject.Category = {
 
  StaticObject.Category = {
Line 30: Line 30:
 
[[DCS_func_getDescByName|StaticObject.getDescByName]]
 
[[DCS_func_getDescByName|StaticObject.getDescByName]]
  
|memberFuncs= '''[[DCS_Class_Static_Object| Static Object Class:]]''' {{listofScriptingStaticFuncs}}
+
|memberFuncs= {{listofScriptingStaticFuncs}}
  
  

Latest revision as of 00:40, 4 January 2023

Scripting Root

Class Name: StaticObject Added with: 1.2.0
Extends: none
Inherits: Object, Coalition Object
Description: Represents static objects added in the Mission Editor or via scripting commands.
Member Functions: getID, getLife, getCargoDisplayName, getCargoWeight, getDrawArgumentValue


Inherited from Object Class: isExist, destroy, getCategory, getTypeName, getDesc, hasAttribute, getName, getPoint, getPosition, getVelocity, inAir

Inherited from Coalition Object Class: getCoalition, getCountry

Obtained Via: Static Functions Functions Events
StaticObject.getByName

StaticObject.getDescByName

Enumerator Types: StaticObject.Category enum that stores StaticObject categories.
Note that StaticObject.Category values are not obtained by calling static:getCategory() - that calls Object.getCategory(static) and will always return the value Object.Category.STATIC. Instead you need to use static:getDesc().category to find the StaticObject.Category!
StaticObject.Category = {
 "VOID": 0,
 "UNIT": 1,
 "WEAPON": 2,
 "STATIC": 3,
 "BASE": 4,
 "SCENERY": 5,
 "CARGO": 6 
}
Description Table Structure:
Notes: Cargo objects are still static objects and retain access to the whole static object class functions. The function Object.getCategory() will return a value of 6 for cargo objects instead of 3 as it would for any other type of static object.