LoadGroupsFromFile
Appearance
| 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 |
| RedGroundFile | Path to the Red ground groups persistence file, defaults to CMM.PERSISTENCE.REDGROUNDFILE if not provided. | |
| BlueGroundFile | Path to the Blue ground groups persistence file, defaults to CMM.PERSISTENCE.BLUEGROUNDFILE if not provided. | |
| LoadRed | If true, loads Red ground groups; defaults to true if not specified. | |
| LoadBlue | If 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: | ||