Difference between revisions of "DCS func getDescByName"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:dcs_funcs
+
{{Template:dcs_funcs_multiclass
  
 
|fName= getDescByName
 
|fName= getDescByName
  
|vNum= 1.2.0
+
|vNum= 1.2.4
  
|par1= [[DCS_Class_Object|Object]]
+
|par1= [[DCS_Class_Unit|Unit]]
  
|par2=  
+
|par2= [[DCS_Class_Static_Object|StaticObject]]
  
|par3=  
+
|par3= [[DCS_Class_Airbase|Airbase]]
  
|par4=
+
|par4= [[DCS_Class_Scenery_Object|SceneryObject]]
  
 +
|par5=
 +
|par6=
 +
|par7=
 
|desc= Return a description table of the specified Object type. Object does not need to be in the mission in order to query its data.
 
|desc= Return a description table of the specified Object type. Object does not need to be in the mission in order to query its data.
  
Function also works with [[DCS_Class_Unit|Unit]], [[DCS_Class_Static_Object|Static Object]], [[DCS_Class_Scenery_Object|Scenery Object]], [[DCS_Class_Airbase|Airbase]]
+
Function works with [[DCS_Class_Unit|Unit]], [[DCS_Class_Static_Object|Static Object]], [[DCS_Class_Scenery_Object|Scenery Object]], [[DCS_Class_Airbase|Airbase]]
  
 
|rtnType= table
 
|rtnType= table
Line 77: Line 80:
  
 
|related=  
 
|related=  
[[DCS_Class_Object|'''Object Functions:''']] {{listofScriptingObjectFuncs}}
+
[[DCS_Class_Unit|'''Unit Functions:''']] {{listOfScriptingUnitFuncs}}
 +
 
 +
[[DCS_Class_Unit|'''StaticObject Functions:''']] {{listofScriptingStaticFuncs}}
 +
 
 +
[[DCS_Class_Unit|'''Airbase Functions:''']] {{listOfScriptingAirbaseFuncs}}
  
 
|examples= local a10CDataTable = Unit.getDescByName('A-10C')
 
|examples= local a10CDataTable = Unit.getDescByName('A-10C')
Line 87: Line 94:
 
}}
 
}}
 
[[Category:Class Functions|getDescByName]]
 
[[Category:Class Functions|getDescByName]]
 +
[[Category:Game Patch 1.2.4|getDescByName]]

Latest revision as of 23:07, 16 January 2024

Scripting Root

Envrioment: Mission Scripting
Function: getDescByName Added with: 1.2.4
Member Of: Unit, StaticObject , Airbase , SceneryObject
Syntax:

table Unit.getDescByName(String typeName )

table StaticObject.getDescByName(String typeName )

table Airbase.getDescByName(String typeName )

table SceneryObject.getDescByName(String typeName )



Description: Return a description table of the specified Object type. Object does not need to be in the mission in order to query its data.

Function works with Unit, Static Object, Scenery Object, Airbase


Return Value: table
Return Example: A-10C Descriptor Table
{
  ["speedMax0"] = 236,
  ["massEmpty"] = 11739,
  ["tankerType"] = 0,
  ["range"] = 1500,
  ["box"] = {
   ["min"] = {
    ["y"] = -1.2815840244293,
    ["x"] = -9.1228017807007,
    ["z"] = -9.4672021865845,
   },
   ["max"] =  {
    ["y"] = 2.3696703910828,
    ["x"] = 7.6860585212708,
    ["z"] = 9.4541301727295,
   },
  },
  ["Hmax"] = 10000,
  ["Kmax"] = 0.52999997138977,
  ["category"] = 0,
  ["speedMax10K"] = 134,
  ["NyMin"] = -2,
  ["fuelMassMax"] = 5029,
  ["speedMax"] = 236,
  ["NyMax"] = 5.9000000953674,
  ["massMax"] = 21081,
  ["RCS"] = 10,
  ["displayName"] = "A-10C",
  ["life"] = 32,
  ["VyMax"] = 30,
  ["attributes"] =  {
   ["Air"] = true,
   ["Battle airplanes"] = true,
   ["NonAndLightArmoredUnits"] = true,
   ["Battleplanes"] = true,
   ["Refuelable"] = true,
   ["All"] = true,
   ["Planes"] = true,
   ["NonArmoredUnits"] = true,
  },
  ["typeName"] = "A-10C",
  ["Kab"] = 0,
 }
Examples: local a10CDataTable = Unit.getDescByName('A-10C')
Related Functions: Unit Functions: isActive, getPlayerName, getID, getNumber, getCategoryEx, getObjectID, getController, getGroup, getCallsign, getLife, getLife0, getFuel, getAmmo, getSensors, hasSensors, getRadar, getDrawArgumentValue, getNearestCargos, enableEmission, getDescentCapacity

StaticObject Functions: getID, getLife, getCargoDisplayName, getCargoWeight, getDrawArgumentValue

Airbase Functions: getCallsign, getUnit, getID, getCategoryEx, getParking, getRunways, getTechObjectPos, getRadioSilentMode, setRadioSilentMode, autoCapture, autoCaptureIsOn, setCoalition, getWarehouse,

Notes: Airbase.getDescByName was added in v1.2.6