Jump to content

ValidGroundSpawn

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: ValidGroundSpawn
Function Description: Determines a valid spawn point within a specified zone or polygon by randomly selecting positions and checking for existing objects, ensuring the area is clear of units, weapons, statics, bases, or scenery within a defined radius.
File Location: cmm.positionFunctions.lua
Syntax: CMM.ValidGroundSpawn( string or table ZoneData , number Size )
Return Value: table or nil or boolean
Parameters: Name Description
ZoneDataEither a zone string name or a table defining a polygon; used to generate random spawn points within the area.
SizeRadius in units to check for existing objects; defaults to 8 if not provided.
Example: CMM.ValidGroundSpawn("Zone1", 10)
Example Description: Finds a valid spawn point within Zone1 with a 10-unit radius clearance, ensuring no objects exist in the area.
Related Functions:
Notes: