Jump to content

GroupSpawn

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: GroupSpawn
Function Description: Spawns an airplane group at a specified position with optional altitude, speed, heading, and aircraft type. The function validates input parameters, creates a group with defined properties, and assigns it to a coalition. It supports custom callsigns and group names, with defaults provided for missing values.
File Location: cmm.spawnFunctions.lua
Syntax: CMM.GroupSpawn( table grp , table argTable )
Return Value: nil
Parameters: Name Description
grp{groupName <string>, units <TBL>, country <string>, category <string>, route <TBL>} – group object containing unit data, country, category, and route information.
argTable{vec3 <TBL>, alt <number>, aircraftType <string>, speed <number>, heading <number>, groupName <string>, callsign <string>, coalition <number>} – Table containing spawn parameters. vec3 must have x and z fields, alt defaults to 3048, speed defaults to 25 0, heading defaults to 0, groupName defaults to a generated name, callsign defaults to "NoCallsign", coalition defaults to 82.
Example: CMM.AirplaneAirSpawn{vec3 = {x = 1000, z = 2000}, alt = 3000, aircraftType = "F-16", speed = 200, heading = 45, groupName = "StrikeGroup", callsign = "Strike1", coalition = 81}
Example Description: Spawns an F-16 with a generated callsign and heading, positioned at (1000, 2000), flying at 3000 meters, at 200 m/s, with a custom group name and coalition.
Related Functions:
Notes: