WeaponRangeTopUp
Appearance
| 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 |
| WeaponsRangeZoneName | Name of the zone to top up, defined in the mission editor. | |
| Country | ID of the country to assign to newly spawned units. | |
| UnitTypeTable | Table of unit types to spawn, e.g., {"UNITTYPETBL01", "UNITTYPETBL02"}. | |
| UnitLimit | Maximum 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: | ||