Jump to content

LoadGroupsFromFile

From CMM Wiki
Return to CMM Command Reference
Environment: Mission Scripting
Function: LoadGroupsFromFile
Function Description: Loads ground group data from specified persistence files for Red and Blue teams, spawning groups and registering them in the game world. Supports custom file paths or defaults, with warnings issued if default paths are used.
File Location: cmm.persistence.lua
Syntax: CMM.LoadGroupsFromFile( string or nil RedGroundFile , string or nil BlueGroundFile , boolean or nil: LoadRed , boolean or nil LoadBlue )
Return Value: boolean
Parameters: Name Description
RedGroundFilePath to the Red ground groups persistence file, defaults to CMM.PERSISTENCE.REDGROUNDFILE if not provided.
BlueGroundFilePath to the Blue ground groups persistence file, defaults to CMM.PERSISTENCE.BLUEGROUNDFILE if not provided.
LoadRedIf true, loads Red ground groups; defaults to true if not specified.
LoadBlueIf true, loads Blue ground groups; defaults to true if not specified.
Example: CMM.LoadGroupsFromFile("CMM.TEMP\\PERSISTENCE\\CUSTOM.REDGROUNDFILE.json", "CMM.TEMP\\PERSISTENCE\\CUSTOM.BLUEGROUNDFILE.json", true, false)
Example Description: Loads custom Red ground groups from a specified file, skips Blue group loading, and spawns each group into the world while logging success or failure.
Related Functions:
Notes: