GetZoneState: Difference between revisions
Appearance
Ozdeadmeat (talk | contribs) GetZoneState – created via PowerShell script (2025-11-11T21:12:54Z) Tag: Recreated |
Ozdeadmeat (talk | contribs) m GetZoneState – created via PowerShell script (2026-01-01T06:03:45Z) |
||
| Line 1: | Line 1: | ||
{{Template:FunctionInfo|fName= GetZoneState|fDescription= Retrieves the current state of a specified zone by counting units from both RED and BLUE sides, returning a detailed report including unit counts and zone state. Zone state -1 indicates | {{Template:FunctionInfo|fName= GetZoneState|fDescription= Retrieves the current state of a specified zone by counting units from both RED and BLUE sides, returning a detailed report including unit counts and zone state. Zone state -1 indicates uninitialised, 1 means empty, 2 means BLUE owns, 3 means RED owns, and 4 means combat is active.|parentFile= cmm.ZoneFunctions.lua|syntax= CMM.GetZoneState(ZoneID <string>)|return= table|returnDesc= Returns a table with fields {ZoneState <number>, bluUnits <TBL>, redUnits <TBL>} where ZoneState indicates the zone condition and bluUnits/redUnits contain lists of unit IDs for each side.|example= CMM.GetZoneState("Zone 15")|exampleDesc= Returns a report for Zone 15 showing if it is empty, owned by RED or BLUE, or in combat, along with the list of units present on each side.|related= |note= |envType= CMM|par1= string ZoneID|reqType1= string|reqName1= ZoneID|desc1= Name of the zone to check, passed as a string value defined in the mission editor.}} | ||
Latest revision as of 19:03, 31 December 2025
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | GetZoneState | |
| Function Description: | Retrieves the current state of a specified zone by counting units from both RED and BLUE sides, returning a detailed report including unit counts and zone state. Zone state -1 indicates uninitialised, 1 means empty, 2 means BLUE owns, 3 means RED owns, and 4 means combat is active. | |
| File Location: | cmm.ZoneFunctions.lua | |
| Syntax: | CMM.GetZoneState( string ZoneID ) | |
| Return Value: | table | |
| Parameters: | Name | Description |
| ZoneID | Name of the zone to check, passed as a string value defined in the mission editor. | |
| Example: | CMM.GetZoneState("Zone 15") | |
| Example Description: | Returns a report for Zone 15 showing if it is empty, owned by RED or BLUE, or in combat, along with the list of units present on each side. | |
| Related Functions: | ||
| Notes: | ||