Jump to content

SaveGroupsToFile: Difference between revisions

From CMM Wiki
SaveGroupsToFile – created via PowerShell script (2025-11-11T21:12:29Z)
Tag: Recreated
 
m SaveGroupsToFile – created via PowerShell script (2026-06-24T22:27:04Z)
 
Line 1: Line 1:
{{Template:FunctionInfo|fName=          SaveGroupsToFile|fDescription=  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.|parentFile=    cmm.persistence.lua|syntax=        CMM.SaveGroupsToFile(RedGroundFile <string|nil>, BlueGroundFile <string|nil>, SaveRed <boolean|nil>, SavedBlue <boolean|nil>)|return=        boolean|returnDesc=    Returns true if both RED and BLUE persistence files were saved successfully, false otherwise.|example=        CMM.SaveGroupsToFile("custom_red.json", "custom_blue.json", true, false)|exampleDesc=    Saves RED group data to custom_red.json and skips saving BLUE data, using custom file paths.|related=        |note=          |envType= CMM|par1=        string or nil RedGroundFile|optType1=    string or nil|optName1=    RedGroundFile|desc1=      File path for RED group persistence (defaults to CMM.PERSISTENCE.REDGROUNDFILE if not provided).|par2=        string or nil BlueGroundFile|optType2=    string or nil|optName2=    BlueGroundFile|desc2=      File path for BLUE group persistence (defaults to CMM.PERSISTENCE.BLUEGROUNDFILE if not provided).|par3=        boolean or nil SaveRed|optType3=    boolean or nil|optName3=    SaveRed|desc3=      Flag indicating whether to save RED group data (defaults to true if not provided).|par4=        boolean or nil SavedBlue|optType4=    boolean or nil|optName4=    SavedBlue|desc4=      Flag indicating whether to save BLUE group data (defaults to true if not provided).}}
{{Template:FunctionInfo|fName=          SaveGroupsToFile|fDescription=  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.|parentFile=    cmm.persistence.lua|syntax=        CMM.SaveGroupsToFile(RedGroundFile <string|nil>, BlueGroundFile <string|nil>, SaveRed <boolean|nil>, SavedBlue <boolean|nil>)|return=        boolean|returnDesc=    Returns true if both RED and BLUE persistence files were saved successfully, false otherwise.|example=        CMM.SaveGroupsToFile("custom_red.json", "custom_blue.json", true, false)|exampleDesc=    Saves RED group data to custom_red.json and skips saving BLUE data, using custom file paths.|related=        |note=          |envType= CMM|par1=        boolean or nil SaveRed|optType1=    boolean or nil|optName1=    SaveRed|desc1=      Flag indicating whether to save RED group data (defaults to true if not provided).|par2=        boolean or nil SaveBlue|optType2=    boolean or nil|optName2=    SaveBlue|desc2=      Flag indicating whether to save BLUE group data (defaults to true if not provided).}}

Latest revision as of 12:27, 24 June 2026

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( boolean or nil SaveRed , boolean or nil SaveBlue )
Return Value: boolean
Parameters: Name Description
SaveRedFlag indicating whether to save RED group data (defaults to true if not provided).
SaveBlueFlag 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: