Difference between revisions of "DCS func getAmmo"

From DCS World Wiki - Hoggitworld.com
m (1 revision imported)
(No difference)

Revision as of 00:12, 12 April 2018

Scripting Root

Envrioment: Mission Scripting
Function: getAmmo Added with: 1.2.0
Member Of: Unit
Syntax: table Unit.getAmmo(Class Self )
Description: Returns an ammo table for all types of loaded ammunition on a given object. Ammo table is indexed by ammo type and contains a weapon description table and a count variable defining "how much" is on board.


Return Value: table
Return Example: A SA-15 Tor returned this table
 {
   [1] = 
   {
       ["count"] = 8,
       ["desc"] = 
       {
           ["missileCategory"] = 2,
           ["rangeMaxAltMax"] = 12000,
           ["rangeMin"] = 1500,
           ["displayName"] = "9M330",
           ["rangeMaxAltMin"] = 8000,
           ["altMax"] = 6000,
           ["RCS"] = 0.03070000000298,
           ["box"] = 
           {
               ["min"] = 
               {
                   ["y"] = -0.26701140403748,
                   ["x"] = -1.678077340126,
                   ["z"] = -0.26600670814514,
               }, -- end of ["min"]
               ["max"] = 
               {
                   ["y"] = 0.26701140403748,
                   ["x"] = 1.8263295888901,
                   ["z"] = 0.26600670814514,
               }, -- end of ["max"]
           }, -- end of ["box"]
           ["altMin"] = 10,
           ["life"] = 2,
           ["fuseDist"] = 7,
           ["category"] = 1,
           ["guidance"] = 4,
           ["warhead"] = 
           {
               ["explosiveMass"] = 14.5,
               ["type"] = 1,
               ["caliber"] = 220,
               ["mass"] = 14.5,
           }, -- end of ["warhead"]
           ["typeName"] = "9M330",
           ["Nmax"] = 30,
       }, -- end of ["desc"]
   }, -- end of [1]
 } -- end of Tor Ammo
Examples:
Related Functions: Unit Functions: isActive, getPlayerName, getID, getNumber, getCategoryEx, getObjectID, getController, getGroup, getCallsign, getLife, getLife0, getFuel, getAmmo, getSensors, hasSensors, getRadar, getDrawArgumentValue, getNearestCargos, enableEmission, getDescentCapacity

Object Functions: isExist, destroy, getCategory, getTypeName, getDesc, hasAttribute, getName, getPoint, getPosition, getVelocity, inAir

Coalition Object Functions: getCoalition, getCountry

Notes: