diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index 1f5b26f39..25ea827ea 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -90,6 +90,18 @@ do -- COORDINATE -- * @{#COORDINATE.IlluminationBomb}(): To illuminate the point. -- -- + -- ## Markings + -- + -- Place markers (text boxes with clarifications for briefings, target locations or any other reference point) on the map for all players, coalitions or specific groups: + -- + -- * @{#COORDINATE.MarkToAll}(): Place a mark to all players. + -- * @{#COORDINATE.MarkToCoalition}(): Place a mark to a coalition. + -- * @{#COORDINATE.MarkToCoalitionRed}(): Place a mark to the red coalition. + -- * @{#COORDINATE.MarkToCoalitionBlue}(): Place a mark to the blue coalition. + -- * @{#COORDINATE.MarkToGroup}(): Place a mark to a group (needs to have a client in it or a CA group (CA group is bugged)). + -- * @{#COORDINATE.RemoveMark}(): Removes a mark from the map. + -- + -- -- ## 3D calculation methods -- -- Various calculation methods exist to use or manipulate 3D space. Find below a short description of each method: @@ -650,6 +662,88 @@ do -- COORDINATE self:F2( Azimuth ) self:Flare( FLARECOLOR.Red, Azimuth ) end + + do -- Markings + + --- Mark to All + -- @param #COORDINATE self + -- @param #string MarkText Free format text that shows the marking clarification. + -- @return #number The resulting Mark ID which is a number. + -- @usage + -- local TargetCoord = TargetGroup:GetCoordinate() + -- local MarkID = TargetCoord:MarkToAll( "This is a target for all players" ) + function COORDINATE:MarkToAll( MarkText ) + local MarkID = UTILS.GetMarkID() + trigger.action.markToAll( MarkID, MarkText, self:GetVec3() ) + return MarkID + end + + --- Mark to Coalition + -- @param #COORDINATE self + -- @param #string MarkText Free format text that shows the marking clarification. + -- @param Coalition + -- @return #number The resulting Mark ID which is a number. + -- @usage + -- local TargetCoord = TargetGroup:GetCoordinate() + -- local MarkID = TargetCoord:MarkToCoalition( "This is a target for the red coalition", coalition.side.RED ) + function COORDINATE:MarkToCoalition( MarkText, Coalition ) + local MarkID = UTILS.GetMarkID() + trigger.action.markToCoalition( MarkID, MarkText, self:GetVec3(), Coalition ) + return MarkID + end + + --- Mark to Red Coalition + -- @param #COORDINATE self + -- @param #string MarkText Free format text that shows the marking clarification. + -- @return #number The resulting Mark ID which is a number. + -- @usage + -- local TargetCoord = TargetGroup:GetCoordinate() + -- local MarkID = TargetCoord:MarkToCoalitionRed( "This is a target for the red coalition" ) + function COORDINATE:MarkToCoalitionRed( MarkText ) + return self:MarkToCoalition( MarkText, coalition.side.RED ) + end + + --- Mark to Blue Coalition + -- @param #COORDINATE self + -- @param #string MarkText Free format text that shows the marking clarification. + -- @return #number The resulting Mark ID which is a number. + -- @usage + -- local TargetCoord = TargetGroup:GetCoordinate() + -- local MarkID = TargetCoord:MarkToCoalitionBlue( "This is a target for the blue coalition" ) + function COORDINATE:MarkToCoalitionBlue( MarkText ) + return self:MarkToCoalition( MarkText, coalition.side.BLUE ) + end + + --- Mark to Group + -- @param #COORDINATE self + -- @param #string MarkText Free format text that shows the marking clarification. + -- @param Wrapper.Group#GROUP MarkGroup The @{Group} that receives the mark. + -- @return #number The resulting Mark ID which is a number. + -- @usage + -- local TargetCoord = TargetGroup:GetCoordinate() + -- local MarkGroup = GROUP:FindByName( "AttackGroup" ) + -- local MarkID = TargetCoord:MarkToGroup( "This is a target for the attack group", AttackGroup ) + function COORDINATE:MarkToCoalition( MarkText, MarkGroup ) + local MarkID = UTILS.GetMarkID() + trigger.action.markToGroup( MarkID, MarkText, self:GetVec3(), MarkGroup:GetID() ) + return MarkID + end + + --- Remove a mark + -- @param #COORDINATE self + -- @param #number MarkID The ID of the mark to be removed. + -- @usage + -- local TargetCoord = TargetGroup:GetCoordinate() + -- local MarkGroup = GROUP:FindByName( "AttackGroup" ) + -- local MarkID = TargetCoord:MarkToGroup( "This is a target for the attack group", AttackGroup ) + -- <<< logic >>> + -- RemoveMark( MarkID ) -- The mark is now removed + function COORDINATE:RemoveMark( MarkID ) + trigger.action.removeMark( MarkID ) + end + + end -- Markings + --- Returns if a Coordinate has Line of Sight (LOS) with the ToCoordinate. -- @param #COORDINATE self diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index dc292d942..44d7f24e3 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -31,7 +31,9 @@ FLARECOLOR = trigger.flareColor -- #FLARECOLOR --- Utilities static class. -- @type UTILS -UTILS = {} +UTILS = { + _MarkID = 0 +} --- Function to infer instance of an object -- @@ -395,3 +397,11 @@ function UTILS.spairs( t, order ) end end end + +-- get a new mark ID for markings +function UTILS.GetMarkID() + + UTILS._MarkID = UTILS._MarkID + 1 + return UTILS._MarkID + +end diff --git a/docs/Documentation/AI_A2A.html b/docs/Documentation/AI_A2A.html index 6d716e063..34f484bce 100644 --- a/docs/Documentation/AI_A2A.html +++ b/docs/Documentation/AI_A2A.html @@ -661,6 +661,7 @@
Target :
AttackerDetection :
DetectedItem :
AttackerDetection :
Defender :
Target :
AttackerDetection :
Target :
AttackerDetection :
DetectedItem :
AttackerDetection :
Friendlies :
DefenderFriendlies :
LaseOn Trigger for DESIGNATE
+LaseOn Trigger for DESIGNATE
+ +Contains the counter how many units are currently alive
-Returns if a Coordinate has Line of Sight (LOS) with the ToCoordinate.
+Mark to All
+Mark to Coalition
+Mark to Blue Coalition
+Mark to Red Coalition
Create a new COORDINATE object from Vec3 coordinates.
+Remove a mark
Provides a coordinate string of the point, based on a coordinate format system: * Uses default settings in COORDINATE.
+Provides a coordinate string of the point, based on the A2A coordinate format system.
+Provides a coordinate string of the point, based on the A2G coordinate format system.
Place markers (text boxes with clarifications for briefings, target locations or any other reference point) on the map for all players, coalitions or specific groups:
+ +Various calculation methods exist to use or manipulate 3D space. Find below a short description of each method:
@@ -1688,6 +1744,135 @@ true If the ToCoordinate has LOS with the Coordinate, otherwise false.Mark to All
+ +#string MarkText :
+Free format text that shows the marking clarification.
#number: +The resulting Mark ID which is a number.
+ + local TargetCoord = TargetGroup:GetCoordinate()
+ local MarkID = TargetCoord:MarkToAll( "This is a target for all players" )
+
+Mark to Coalition
+ +#string MarkText :
+Free format text that shows the marking clarification.
Coalition :
#number: +The resulting Mark ID which is a number.
+ + local TargetCoord = TargetGroup:GetCoordinate()
+ local MarkID = TargetCoord:MarkToCoalition( "This is a target for the red coalition", coalition.side.RED )
+
+Mark to Blue Coalition
+ +#string MarkText :
+Free format text that shows the marking clarification.
#number: +The resulting Mark ID which is a number.
+ + local TargetCoord = TargetGroup:GetCoordinate()
+ local MarkID = TargetCoord:MarkToCoalitionBlue( "This is a target for the blue coalition" )
+
+Mark to Red Coalition
+ +#string MarkText :
+Free format text that shows the marking clarification.
#number: +The resulting Mark ID which is a number.
+ + local TargetCoord = TargetGroup:GetCoordinate()
+ local MarkID = TargetCoord:MarkToCoalitionRed( "This is a target for the red coalition" )
+
+Remove a mark
+ +#number MarkID :
+The ID of the mark to be removed.
local TargetCoord = TargetGroup:GetCoordinate()
+ local MarkGroup = GROUP:FindByName( "AttackGroup" )
+ local MarkID = TargetCoord:MarkToGroup( "This is a target for the attack group", AttackGroup )
+ <<< logic >>>
+ RemoveMark( MarkID ) -- The mark is now removed
+
Provides a coordinate string of the point, based on the A2A coordinate format system.
+ +Wrapper.Controllable#CONTROLLABLE Controllable :
Core.Settings#SETTINGS Settings :
#string: +The coordinate Text in the configured coordinate system.
+ +Provides a coordinate string of the point, based on the A2G coordinate format system.
+ +Wrapper.Controllable#CONTROLLABLE Controllable :
Core.Settings#SETTINGS Settings :
#string: +The coordinate Text in the configured coordinate system.
+ +Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.
-Overwrite unit names by default with group name.
+Gets the ID of the Task
+Gets the Information of the Task
Gets the Information of the Task
+ +#string TaskInfo :
+The key and title of the task information.
#string: +TaskInfoText The Task info text.
+ +Wrapper.Group#GROUP TaskGroup :
get a new mark ID for markings
+ +