Module Group
-A GROUP class abstraction of a DCSGroup class.
+GROUP class.
-The GROUP class will take an abstraction of the DCSGroup class, providing more methods that can be done with a GROUP.
+ +GROUP class
+The GROUP class is a wrapper class to handle the DCS Group objects:
+ +-
+
- Support all DCS Group APIs. +
- Enhance with Group specific APIs not in the DCS Group API set. +
- Handle local Group Controller. +
- Manage the "state" of the DCS Group. +
GROUP reference methods
+For each DCS Group object alive within a running mission, a GROUP wrapper object (instance) will be created within the _DATABASE object. +This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Group objects are spawned (using the SPAWN class).
+ +The GROUP class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference +using the DCS Group or the DCS GroupName.
+ +Another thing to know is that GROUP objects do not "contain" the DCS Group object. +The GROUP methods will reference the DCS Group object by name when it is needed during API execution. +If the DCS Group object does not exist or is nil, the GROUP methods will return nil and log an exception in the DCS.log file.
+ +The GROUP class provides the following functions to retrieve quickly the relevant GROUP instance:
+ +-
+
- GROUP.Find(): Find a GROUP instance from the _DATABASE object using a DCS Group object. +
- GROUP.FindByName(): Find a GROUP instance from the _DATABASE object using a DCS Group name. +
IMPORTANT: ONE SHOULD NEVER SANATIZE these GROUP OBJECT REFERENCES! (make the GROUP object references nil).
Global(s)
| GROUP.Controller |
- The controller of the group. + |
|||
| GROUP:Destroy() |
- Destroy a GROUP -Note that this destroy method also raises a destroy event at run-time. +Destroys the DCS Group and all of its DCS Units. |
|||
| GROUP.FindGroup(Group, DCSGroup) | +GROUP:Find(DCSGroup) |
- Find the created GROUP using the DCSGroup ID. +Find the GROUP wrapper class instance using the DCS Group. + |
+ ||
| GROUP:FindByName(GroupName) | +
+ Find the created GROUP using the DCS Group Name. |
|||
| GROUP:GetCallsign() |
- Gets the callsign of the fist unit of the group. +Gets the CallSign of the first DCS Unit of the DCS Group. + |
+ |||
| GROUP:GetCategory() | +
+ Returns category of the DCS Group. |
|||
| GROUP:GetCategoryName() |
- Returns the category name of the group. +Returns the category name of the DCS Group. + |
+ |||
| GROUP:GetCoalition() | +
+ Returns the coalition of the DCS Group. |
|||
| GROUP:GetDCSGroup() |
- Gets the DCSGroup of the GROUP. +Returns the DCS Group. |
|||
| GROUP:GetDCSUnit(UnitNumber) |
- Gets the DCS Unit of the GROUP. +Returns the DCS Unit with number UnitNumber. |
|||
| GROUP:GetDCSUnits() |
- Gets the DCSUnits of the GROUP. +Returns the DCS Units of the DCS Group. |
|||
| GROUP:GetID() |
- Gets the ID of the GROUP. +Returns the DCS Group identifier. + |
+ |||
| GROUP:GetInitialSize() | +
+
|
|||
| GROUP:GetName() |
- Returns the name of the Group. +Returns the name of the DCS Group. |
|||
| GROUP:GetPointVec2() |
- Gets the current Point of the GROUP in VEC3 format. +Returns the current point (Vec2 vector) of the first DCS Unit in the DCS Group. |
|||
| GROUP:GetPointVec3() |
- Gets the current Point of the GROUP in VEC3 format. +Returns the current point (Vec3 vector) of the first DCS Unit in the DCS Group. + |
+ |||
| GROUP:GetSize() | +
+ Returns current size of the DCS Group. |
|||
| GROUP:GetUnit(UnitNumber) |
- Gets the DCS Unit. +Returns the UNIT wrapper class with number UnitNumber. + |
+ |||
| GROUP:GetUnits() | +
+ Returns the UNITs wrappers of the DCS Units of the DCS Group. |
|||
| GROUP.GroupID |
- the ID of the group. + |
|||
| GROUP:IsAirPlane() |
- Returns if the GROUP are AirPlanes. +Returns if the DCS Group contains AirPlanes. |
|||
| GROUP:IsAlive() |
- Returns if the group is alive. +Returns if the DCS Group is alive. |
|||
| GROUP:IsGround() |
- Returns if the GROUP are Ground troops. +Returns if the DCS Group contains Ground troops. |
|||
| GROUP:IsHelicopter() |
- Returns if the GROUP is a Helicopter. +Returns if the DCS Group contains Helicopters. |
|||
| GROUP:IsShip() |
- Returns if the GROUP are Ships. +Returns if the DCS Group contains Ships. |
|||
| GROUP:MessageToRed(Message, Duration) |
Send a message to the red coalition. - |
- |||
| GROUP:New(DCSGroup) | -
- Create a new GROUP from a DCSGroup - |
- |||
| GROUP:NewFromDCSUnit(DCSUnit) | -
- Create a new GROUP from an existing DCSUnit in the mission. - |
- |||
| GROUP:NewFromName(GroupName) | -
- Create a new GROUP from an existing group name. |
|||
| GROUP:PushTask(DCSTask, WaitTime) |
Pushing Task on the queue from the group. + |
+ |||
| GROUP:Register(GroupName) | +
+ Create a new GROUP from a DCSGroup |
|||
| GROUP:TaskRoute(Points) |
Return a Misson task to follow a given route defined by Points. + |
+ |||
| GROUP:TaskRouteToVec2(Point, Speed) | +
+ Make the DCS Group to fly to a given point and hover. |
|||
| GROUP:TaskRouteToVec3(Point, Speed) |
- Make the group to fly to a given point and hover. +Make the DCS Group to fly to a given point and hover. |
|||
| GROUP:WayPointInitialize(WayPoint) | +GROUP:WayPointInitialize() |
Retrieve the group mission and allow to place function hooks within the mission waypoint plan. |
@@ -619,22 +694,6 @@ Note that this destroy method also raises a destroy event at run-time.
GROUP:_GetController() |
Get the controller for the GROUP. - |
-
Type Vec3
- | Vec3.x | -- - | -
| Vec3.y | -- |
- - #table GROUP.Controller
-
-
The controller of the group.
+
Destroy a GROUP -Note that this destroy method also raises a destroy event at run-time.
+Destroys the DCS Group and all of its DCS Units.
-So all event listeners will catch the destroy event of this GROUP.
+Note that this destroy method also raises a destroy event at run-time. +So all event listeners will catch the destroy event of this DCS Group.
- - -GROUP.FindGroup(Group, DCSGroup) + +GROUP:Find(DCSGroup)
-
-
Find the created GROUP using the DCSGroup ID.
+Find the GROUP wrapper class instance using the DCS Group.
- -If a GROUP was created with the DCSGroupID, the the GROUP instance will be returned. -Otherwise nil will be returned.
- -Parameters
+Parameter
-
-
- -DCSGroup#Group Group:
- -
-
-
+DCSGroup:DCSGroup#Group DCSGroup: +The DCS Group.
Return value
- +#GROUP: +The GROUP.
+
+ -
-
-
+
- + + +GROUP:FindByName(GroupName) + + +
-
+
+
Find the created GROUP using the DCS Group Name.
+ +Parameter
+-
+
-
+
+
+ +#string GroupName: +The DCS Group Name.
+
Return value
+ +#GROUP: +The GROUP.
-
+
+
Gets the callsign of the fist unit of the group.
+Gets the CallSign of the first DCS Unit of the DCS Group.
Return value
#string: -The callsign of the first unit of the group.
+The CallSign of the first DCS Unit of the DCS Group. + +-
+
- + + +GROUP:GetCategory() + + +
-
+
+
Returns category of the DCS Group.
+ +Return value
+ +DCSGroup#Group.Category: +The category ID
Returns the category name of the group.
+Returns the category name of the DCS Group.
Return value
@@ -955,18 +1050,36 @@ Category name = Helicopter, Airplane, Ground Unit, Ship- + +GROUP:GetCoalition() + + +
-
+
+
Returns the coalition of the DCS Group.
+ +Return value
+ +DCSCoalitionObject#coalition.side: +The coalition side of the DCS Group.
+ +
+
-
+
- + GROUP:GetDCSGroup()
-
-
Gets the DCSGroup of the GROUP.
+Returns the DCS Group.
Return value
DCSGroup#Group: -The DCSGroup.
+The DCS Group.
Gets the DCS Unit of the GROUP.
+Returns the DCS Unit with number UnitNumber.
+ + +If the underlying DCS Unit does not exist, the method will return nil. .
Parameter
-
+The number of the DCS Unit to be returned.#number UnitNumber: -The unit index to be returned from the GROUP.
Return value
-#Unit: +
DCSUnit#Unit: The DCS Unit.
Gets the DCSUnits of the GROUP.
+Returns the DCS Units of the DCS Group.
Return value
#table: -The DCSUnits.
+The DCS Units.Gets the ID of the GROUP.
+Returns the DCS Group identifier.
Return value
#number: -The ID of the GROUP.
+The identifier of the DCS Group. + +-
+
- + + +GROUP:GetInitialSize() + + +
-
+
+
-
+
- Returns the initial size of the DCS Group. +
If some of the DCS Units of the DCS Group are destroyed, the initial size of the DCS Group is unchanged.
+ +Return value
+ +#number: +The DCS Group initial size.
Returns the name of the Group.
+Returns the name of the DCS Group.
Return value
#string: -GroupName
+The DCS Group name.Gets the current Point of the GROUP in VEC3 format.
+Returns the current point (Vec2 vector) of the first DCS Unit in the DCS Group.
Return value
-#Vec3: -Current x,y and z position of the group.
+DCSTypes#Vec2: +Current Vec2 point of the first DCS Unit of the DCS Group.
Gets the current Point of the GROUP in VEC3 format.
+Returns the current point (Vec3 vector) of the first DCS Unit in the DCS Group.
Return value
-#Vec3: -Current Vec3 position of the group.
+DCSTypes#Vec3: +Current Vec3 point of the first DCS Unit of the DCS Group.
+ +-
+
- + + +GROUP:GetSize() + + +
-
+
+
Returns current size of the DCS Group.
+ + +If some of the DCS Units of the DCS Group are destroyed the size of the DCS Group is changed.
+ +Return value
+ +#number: +The DCS Group size.
Gets the DCS Unit.
+Returns the UNIT wrapper class with number UnitNumber.
+ + +If the underlying DCS Unit does not exist, the method will return nil. .
Parameter
-
+The number of the UNIT wrapper class to be returned.#number UnitNumber: -The number of the Unit to be returned.
Return value
Unit#UNIT: -The DCS Unit.
+The UNIT wrapper class. + +-
+
- + + +GROUP:GetUnits() + + +
-
+
+
Returns the UNITs wrappers of the DCS Units of the DCS Group.
+ +Return value
+ +#table: +The UNITs wrappers.
the ID of the group.
+Returns if the GROUP are AirPlanes.
+Returns if the DCS Group contains AirPlanes.
Return value
#boolean: -true if GROUP are AirPlanes.
+true if DCS Group contains AirPlanes.Returns if the group is alive.
+Returns if the DCS Group is alive.
When the group exists at run-time, this method will return true, otherwise false.
@@ -1328,7 +1509,7 @@ true if GROUP are AirPlanes.Return value
#boolean: -Alive result.
+true if the DCS Group is alive.Returns if the GROUP are Ground troops.
+Returns if the DCS Group contains Ground troops.
Return value
#boolean: -true if GROUP are Ground troops.
+true if DCS Group contains Ground troops.Returns if the GROUP is a Helicopter.
+Returns if the DCS Group contains Helicopters.
Return value
#boolean: -true if GROUP are Helicopters.
+true if DCS Group contains Helicopters.Returns if the GROUP are Ships.
+Returns if the DCS Group contains Ships.
Return value
#boolean: -true if GROUP are Ships.
+true if DCS Group contains Ships.- - -GROUP:New(DCSGroup) - - -
-
-
-
Create a new GROUP from a DCSGroup
- -Parameter
--
-
-
-
-
- -DCSGroup#Group DCSGroup: -The DCS Group
-
Return value
- -#GROUP: -self
- -
- -
-
-
-
-
- - - -GROUP:NewFromDCSUnit(DCSUnit) - - -
-
-
-
Create a new GROUP from an existing DCSUnit in the mission.
- -Parameter
--
-
-
-
-
- -DCSUnit: -The DCSUnit.
-
Return value
- -#GROUP: -self
- -
- -
-
-
-
-
- - - -GROUP:NewFromName(GroupName) - - -
-
-
-
Create a new GROUP from an existing group name.
- -Parameter
--
-
-
-
-
- -GroupName: -The name of the DCS Group.
-
Return value
- -#GROUP: -self
- -
- -
-
-
-
-
- - GROUP:OptionROEHoldFire() @@ -1991,6 +2091,33 @@ self
- + +GROUP:Register(GroupName) + + +
-
+
+
Create a new GROUP from a DCSGroup
+ +Parameter
+-
+
-
+
+
+ +DCSGroup#Group GroupName: +The DCS Group name
+
Return value
+ +#GROUP: +self
+ +
+ -
+
+
-
+
GROUP:Route(GoPoints)
@@ -2178,7 +2305,7 @@ CSTask#Task> DCSTasks
-
-
+#Time time:DCSTime#Time time: - @@ -2198,7 +2325,7 @@ CSTask#Task> DCSTasks
-
-
+#Time duration:DCSTime#Time duration: -
@@ -2257,7 +2384,7 @@ CSTask#Task> DCSTasks
-
-
#Vec2 Point: +DCSTypes#Vec2 Point: The point where to wait.
@@ -2290,7 +2417,7 @@ The DCS task structure.
-
-
#Vec2 Point: +DCSTypes#Vec2 Point: The point where to wait.
@@ -2430,7 +2557,7 @@ self
-
-
#Vec2 Point: +DCSTypes#Vec2 Point: The point where to land.
@@ -2561,7 +2688,7 @@ self
-
-
#Vec2 Point: +DCSTypes#Vec2 Point: The point to hold the position.
@@ -2610,6 +2737,39 @@ A table of route points.
+
-
-
-
-
-
+
-
+
- + + +GROUP:TaskRouteToVec2(Point, Speed) + + +
-
+
+
Make the DCS Group to fly to a given point and hover.
+ +Parameters
+-
+
-
+
+
+ +DCSTypes#Vec3 Point: +The destination point in Vec3 format.
+ -
+
+
+ +#number Speed: +The speed to travel.
+
Return value
+ +#GROUP: +self
+ -
+
+
-
@@ -2621,14 +2781,14 @@ A table of route points.
-
-
Make the group to fly to a given point and hover.
+Make the DCS Group to fly to a given point and hover.
Parameters
-
-
+#Vec3 Point: -The destination point.DCSTypes#Vec3 Point: +The destination point in Vec3 format. -
@@ -2825,7 +2985,7 @@ The waypoint function to be called when the group moves over the waypoint. The w
- -GROUP:WayPointInitialize(WayPoint) +GROUP:WayPointInitialize()
- @@ -2837,14 +2997,6 @@ The waypoint function to be called when the group moves over the waypoint. The w Use the method @{Group@GROUP:WayPointExecute) to start the execution of the new mission plan. Note that when WayPointInitialize is called, the Mission of the group is RESTARTED! -
-Parameter
--
-
-
-
-
- -#number WayPoint:
-
Return value
@@ -2879,44 +3031,7 @@ The waypoint function to be called when the group moves over the waypoint. The wReturn value
- - - -
-
-
Type Time
-
- Type Unit
-
- Type Vec2
-
- Type Vec3
- Field(s)
--
-
- - - - -Vec3.x - - -
- - - - - -
-
-
- - - - -Vec3.y - - -
- - + diff --git a/Documentation/MISSION.html b/Documentation/MISSION.html index d20297316..0e909bbc5 100644 --- a/Documentation/MISSION.html +++ b/Documentation/MISSION.html @@ -21,6 +21,17 @@