Jump to content

SaveGroupsToFile

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (SaveGroupsToFile – created via PowerShell script (2025-11-11T21:12:29Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: SaveGroupsToFile
Function Description: Saves current group data for RED and BLUE sides to persistence files, with optional file paths and save flags. If no file path is provided, defaults are used. Returns true if both files were saved successfully.
File Location: cmm.persistence.lua
Syntax: CMM.SaveGroupsToFile( string or nil RedGroundFile , string or nil BlueGroundFile , boolean or nil SaveRed , boolean or nil SavedBlue )
Return Value: boolean
Parameters: Name Description
RedGroundFileFile path for RED group persistence (defaults to CMM.PERSISTENCE.REDGROUNDFILE if not provided).
BlueGroundFileFile path for BLUE group persistence (defaults to CMM.PERSISTENCE.BLUEGROUNDFILE if not provided).
SaveRedFlag indicating whether to save RED group data (defaults to true if not provided).
SavedBlueFlag indicating whether to save BLUE group data (defaults to true if not provided).
Example: CMM.SaveGroupsToFile("custom_red.json", "custom_blue.json", true, false)
Example Description: Saves RED group data to custom_red.json and skips saving BLUE data, using custom file paths.
Related Functions:
Notes: