Jump to content

GetCallsignTable

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (GetCallsignTable – created via PowerShell script (2025-11-11T21:11:59Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: GetCallsignTable
Function Description: Parses an aircraft callsign string and returns a table containing the numeric ID of the base callsign, the first digit found in the name, the trailing digit (if any), and the original name. The function uses a predefined mapping (CALLSIGN) from call‑name prefixes to their corresponding IDs. It extracts the alphabetic prefix with string.match, looks up its ID, then pulls the first numeric character and the final numeric character from the full callsign.
File Location: cmm.DCSFunctions.lua
Syntax: CMM.GetCallsignTable( string UnitName )
Return Value: table or nil
Parameters: Name Description
UnitNameThe full aircraft callsign (e.g., "Uzi61" or "Magic12").
Example: local info = CMM.GetCallsignTable("Uzi61"); env.info(tostring(info[1]) .. "," .. tostring(info[2]) .. "," .. tostring(info[3]))
Example Description: Demonstrates extracting the callsign ID and digits from "Uzi61" and logging them.
Related Functions:
Notes: