Jump to content

DrawBox

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (DrawBox – created via PowerShell script (2025-11-11T21:12:18Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: DrawBox
Function Description: Draws a rectangular cargo‑box marker on the map. The box is defined by its total width (xSize) and height (zSize) in metres, centred on the supplied position.
File Location: cmm.drawFunctions.lua
Syntax: CMM.DrawBox( table vec3 , number xSize , number zSize , table or string colour , table or string fillcolour , number coal )
Return Value: number
Parameters: Name Description
vec3World coordinates where the centre of the box should be placed.
xSizeTotal width of the box along the X‑axis (in metres). If omitted defaults to 100 m.
zSizeTotal height of the box along the Z‑axis (in metres). If omitted defaults to 100 m.
colourOutline colour. Accepts a colour table or one of the predefined names ("DarkBrown" by default).
fillcolourInterior fill colour. Defaults to CMM.Marker.Colour.CargoBrown.
coalCoalition for which the marker should be visible (-1 = all, 0 = neutral, 1 = Redfor, 2 = Blufor). Defaults to -1.
Example: CMM.DrawBox({x=500,y=0,z=-200}, 200, 150, "DarkBrown", "CargoBrown", 1)
Example Description: Draws a red‑for cargo box centred at (500, 0, −200) with a width of 200 m and height of 150 m.
Related Functions:
Notes: