Jump to content

WeaponRangeTopUp

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (WeaponRangeTopUp – created via PowerShell script (2025-11-11T21:12:42Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: WeaponRangeTopUp
Function Description: Ensures a specified zone reaches a defined unit limit by spawning additional units of specified types at random valid spawn points, with error handling and progress logging.
File Location: cmm.spawnFunctions.lua
Syntax: CMM.WeaponRangeTopUp( string WeaponsRangeZoneName , number Country , table UnitTypeTable , number UnitLimit )
Return Value:
Parameters: Name Description
WeaponsRangeZoneNameName of the zone to top up, defined in the mission editor.
CountryID of the country to assign to newly spawned units.
UnitTypeTableTable of unit types to spawn, e.g., {"UNITTYPETBL01", "UNITTYPETBL02"}.
UnitLimitMaximum number of units allowed in the zone; if exceeded, no spawning occurs.
Example: CMM.WeaponRangeTopUp("WEAPONS-RANGE-02", 101, {"UNITTYPETBL01", "UNITTYPETBL02"}, 100)
Example Description: Spawns additional units in "WEAPONS-RANGE-02" to reach a limit of 100, using unit types from the provided table and assigning country ID 101.
Related Functions:
Notes: