Clean
Appearance
| 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 |
| coord | The center point (x, y, z) of the sphere where cleanup will occur | |
| radius | The 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. | |