Jump to content

Clean

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (Clean – created via PowerShell script (2025-11-11T21:12:20Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: Clean
Function Description: Removes all junk units and objects (e.g., debris, temporary spawns, destroyed units) within a spherical volume defined by a position and radius.
File Location: cmm.MapCommandFunctions.lua
Syntax: CMM.Clean( table coord , number radius )
Return Value: number
Parameters: Name Description
coordThe center point (x, y, z) of the sphere where cleanup will occur
radiusThe radius in meters of the sphere; defines how far to clean from the center
Example: CMM.Clean({x=1000,y=0,z=0}, 500)
Example Description: Creates a spherical volume centered at the provided coordinates with the given radius and removes all "junk" units (such as temporary or unowned units) within that volume. The cleanup is performed using the world.removeJunk() function. Returns the count of removed units. Useful for clearing clutter in mission environments.
Related Functions:
Notes: This function is typically called by CMM.MarkerClean when a player uses a !clean:<radius> command. The radius is capped by CMM.clean.size to prevent excessive cleanup.