GetDisplayName
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | GetDisplayName | |
| Function Description: | Returns the human‑readable display name for a DCS object or type. The function accepts either an object table (e.g., unit) or a type name string. It queries the appropriate description tables (Weapon, Unit, StaticObject, SceneryObject, Airbase) and extracts the displayName. If no match is found, it returns "unknown". | |
| File Location: | cmm.DCSFunctions.lua | |
| Syntax: | CMM.GetDisplayName( table or string tn ) | |
| Return Value: | string | |
| Parameters: | Name | Description |
| tn | Either an object table (e.g., a Unit or Weapon instance) or the type name string of that object. | |
| Example: | env.info("Unit Display Name: " .. tostring(CMM.GetDisplayName(unit))) | |
| Example Description: | Shows how to retrieve display names for both an object instance and a type name. | |
| Related Functions: | ||
| Notes: | ||