mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'master' into funkyfranky
This commit is contained in:
commit
fa8a9b52fe
@ -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:
|
||||
@ -289,9 +301,55 @@ do -- COORDINATE
|
||||
end
|
||||
|
||||
|
||||
--- Set the heading of the coordinate, if applicable.
|
||||
-- @param #COORDINATE self
|
||||
function COORDINATE:SetHeading( Heading )
|
||||
self.Heading = Heading
|
||||
end
|
||||
|
||||
|
||||
--- Get the heading of the coordinate, if applicable.
|
||||
-- @param #COORDINATE self
|
||||
-- @return #number or nil
|
||||
function COORDINATE:GetHeading()
|
||||
return self.Heading
|
||||
end
|
||||
|
||||
|
||||
--- Set the velocity of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #string Velocity Velocity in meters per second.
|
||||
function COORDINATE:SetVelocity( Velocity )
|
||||
self.Velocity = Velocity
|
||||
end
|
||||
|
||||
|
||||
--- Return the velocity of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @return #number Velocity in meters per second.
|
||||
function COORDINATE:GetVelocity()
|
||||
local Velocity = self.Velocity
|
||||
return Velocity or 0
|
||||
end
|
||||
|
||||
|
||||
--- Return velocity text of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @return #string
|
||||
function COORDINATE:GetMovingText( Settings )
|
||||
|
||||
local MovingText = ""
|
||||
|
||||
local Velocity = self:GetVelocity()
|
||||
|
||||
if Velocity == 0 then
|
||||
MovingText = MovingText .. "stationary "
|
||||
else
|
||||
MovingText = MovingText .. "moving at " .. self:GetVelocityText( Settings ) .. " " .. self:GetHeadingText( Settings )
|
||||
end
|
||||
|
||||
return MovingText
|
||||
end
|
||||
|
||||
|
||||
--- Return a direction vector Vec3 from COORDINATE to the COORDINATE.
|
||||
@ -347,6 +405,7 @@ do -- COORDINATE
|
||||
return ( ( TargetVec3.x - SourceVec3.x ) ^ 2 + ( TargetVec3.z - SourceVec3.z ) ^ 2 ) ^ 0.5
|
||||
end
|
||||
|
||||
|
||||
--- Return the 3D distance in meters between the target COORDINATE and the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #COORDINATE TargetCoordinate The target COORDINATE.
|
||||
@ -413,6 +472,39 @@ do -- COORDINATE
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Return the velocity text of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @return #string Velocity text.
|
||||
function COORDINATE:GetVelocityText( Settings )
|
||||
local Velocity = self:GetVelocity()
|
||||
local Settings = Settings or _SETTINGS
|
||||
if Velocity then
|
||||
if Settings:IsMetric() then
|
||||
return UTILS.MpsToKmph( Velocity ) .. " km/h"
|
||||
else
|
||||
return UTILS.MpsToKmph( Velocity ) / 1.852 .. " mph"
|
||||
end
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Return the heading text of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @return #string Heading text.
|
||||
function COORDINATE:GetHeadingText( Settings )
|
||||
local Heading = self.Heading
|
||||
local Settings = Settings or _SETTINGS
|
||||
if Heading then
|
||||
return Heading .. "°"
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--- Provides a Bearing / Range string
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number AngleRadians The angle in randians
|
||||
@ -650,6 +742,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:MarkToGroup( 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
|
||||
|
||||
@ -1788,16 +1788,18 @@ end
|
||||
function SET_UNIT:CalculateThreatLevelA2G()
|
||||
|
||||
local MaxThreatLevelA2G = 0
|
||||
local MaxThreatText = ""
|
||||
for UnitName, UnitData in pairs( self:GetSet() ) do
|
||||
local ThreatUnit = UnitData -- Wrapper.Unit#UNIT
|
||||
local ThreatLevelA2G = ThreatUnit:GetThreatLevel()
|
||||
local ThreatLevelA2G, ThreatText = ThreatUnit:GetThreatLevel()
|
||||
if ThreatLevelA2G > MaxThreatLevelA2G then
|
||||
MaxThreatLevelA2G = ThreatLevelA2G
|
||||
MaxThreatText = ThreatText
|
||||
end
|
||||
end
|
||||
|
||||
self:T3( MaxThreatLevelA2G )
|
||||
return MaxThreatLevelA2G
|
||||
self:F( { MaxThreatLevelA2G = MaxThreatLevelA2G, MaxThreatText = MaxThreatText } )
|
||||
return MaxThreatLevelA2G, MaxThreatText
|
||||
|
||||
end
|
||||
|
||||
|
||||
@ -1644,7 +1644,7 @@ do -- DETECTION_BASE
|
||||
DetectedItem.Coordinate = Coordinate
|
||||
DetectedItem.Coordinate:SetHeading( DetectedItemUnit:GetHeading() )
|
||||
DetectedItem.Coordinate.y = DetectedItemUnit:GetAltitude()
|
||||
DetectedItem.Coordinate.Speed = DetectedItemUnit:GetVelocityMPS()
|
||||
DetectedItem.Coordinate:SetVelocity( DetectedItemUnit:GetVelocityMPS() )
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -1675,7 +1675,7 @@ do -- DETECTION_BASE
|
||||
local DetectedSet = DetectedItem.Set
|
||||
|
||||
if DetectedItem then
|
||||
DetectedItem.ThreatLevel = DetectedSet:CalculateThreatLevelA2G()
|
||||
DetectedItem.ThreatLevel, DetectedItem.ThreatText = DetectedSet:CalculateThreatLevelA2G()
|
||||
end
|
||||
end
|
||||
|
||||
@ -1691,10 +1691,10 @@ do -- DETECTION_BASE
|
||||
local DetectedItem = self:GetDetectedItem( Index )
|
||||
|
||||
if DetectedItem then
|
||||
return DetectedItem.ThreatLevel or 0
|
||||
return DetectedItem.ThreatLevel or 0, DetectedItem.ThreatText or ""
|
||||
end
|
||||
|
||||
return nil
|
||||
return nil, ""
|
||||
end
|
||||
|
||||
|
||||
@ -2423,9 +2423,9 @@ do -- DETECTION_AREAS
|
||||
-- @param #DETECTION_BASE.DetectedItem DetectedItem
|
||||
function DETECTION_AREAS:CalculateIntercept( DetectedItem )
|
||||
|
||||
local DetectedSpeed = DetectedItem.Coordinate.Speed
|
||||
local DetectedHeading = DetectedItem.Coordinate.Heading
|
||||
local DetectedCoord = DetectedItem.Coordinate
|
||||
local DetectedSpeed = DetectedCoord:GetVelocity()
|
||||
local DetectedHeading = DetectedCoord:GetHeading()
|
||||
|
||||
if self.Intercept then
|
||||
local DetectedSet = DetectedItem.Set
|
||||
|
||||
@ -870,13 +870,11 @@ function TASK:MenuMarkToGroup( TaskGroup )
|
||||
|
||||
local Coordinate = self:GetInfo( "Coordinates" ) -- Core.Point#COORDINATE
|
||||
local Briefing = self:GetTaskBriefing()
|
||||
local GroupID = TaskGroup:GetID()
|
||||
local Vec3 = Coordinate:GetVec3()
|
||||
|
||||
self:F( { Coordinate = Vec3, Briefing = Briefing, GroupID = GroupID } )
|
||||
self:F( { Briefing = Briefing, Coordinate = Coordinate } )
|
||||
|
||||
trigger.action.markToGroup( 1, Briefing, Vec3, GroupID )
|
||||
--trigger.action.markToAll( 1, Briefing, Vec3 )
|
||||
Coordinate:MarkToGroup( Briefing, TaskGroup )
|
||||
--Coordinate:MarkToAll( Briefing )
|
||||
end
|
||||
|
||||
--- Report the task status.
|
||||
|
||||
@ -323,13 +323,18 @@ do -- TASK_A2G_SEAD
|
||||
|
||||
Mission:AddTask( self )
|
||||
|
||||
self:SetBriefing(
|
||||
TaskBriefing or
|
||||
"Execute a Suppression of Enemy Air Defenses.\n"
|
||||
)
|
||||
|
||||
self:UpdateTaskInfo()
|
||||
|
||||
local ThreatLevel, ThreatText = TargetSetUnit:CalculateThreatLevelA2G()
|
||||
local TargetUnit = TargetSetUnit:GetFirst()
|
||||
local TargetCoord = TargetUnit:GetCoordinate() -- Core.Point#COORDINATE
|
||||
|
||||
self:SetBriefing(
|
||||
TaskBriefing or
|
||||
"Execute a Suppression of Enemy Air Defenses. " ..
|
||||
ThreatText .. " targets to be expected. Target is " .. TargetCoord:GetMovingText() .. "."
|
||||
)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@ -466,12 +471,17 @@ do -- TASK_A2G_BAI
|
||||
|
||||
Mission:AddTask( self )
|
||||
|
||||
self:UpdateTaskInfo()
|
||||
|
||||
local ThreatLevel, ThreatText = TargetSetUnit:CalculateThreatLevelA2G()
|
||||
local TargetUnit = TargetSetUnit:GetFirst()
|
||||
local TargetCoord = TargetUnit:GetCoordinate() -- Core.Point#COORDINATE
|
||||
|
||||
self:SetBriefing(
|
||||
TaskBriefing or
|
||||
"Execute a Battlefield Air Interdiction of a group of enemy targets.\n"
|
||||
"Execute a Battlefield Air Interdiction of a group of enemy targets. " ..
|
||||
ThreatText .. " targets to be expected. Target is " .. TargetCoord:GetMovingText() .. "."
|
||||
)
|
||||
|
||||
self:UpdateTaskInfo()
|
||||
|
||||
return self
|
||||
end
|
||||
@ -610,13 +620,20 @@ do -- TASK_A2G_CAS
|
||||
|
||||
Mission:AddTask( self )
|
||||
|
||||
self:UpdateTaskInfo()
|
||||
|
||||
local ThreatLevel, ThreatText = TargetSetUnit:CalculateThreatLevelA2G()
|
||||
local TargetUnit = TargetSetUnit:GetFirst()
|
||||
local TargetCoord = TargetUnit:GetCoordinate() -- Core.Point#COORDINATE
|
||||
|
||||
self:SetBriefing(
|
||||
TaskBriefing or
|
||||
"Execute a Close Air Support for a group of enemy targets.\n" ..
|
||||
"Beware of friendlies at the vicinity!\n"
|
||||
"Execute a Close Air Support for a group of enemy targets. " ..
|
||||
"Beware of friendlies at the vicinity! " ..
|
||||
ThreatText .. " targets to be expected. Target is " .. TargetCoord:GetMovingText() .. "."
|
||||
|
||||
)
|
||||
|
||||
self:UpdateTaskInfo()
|
||||
|
||||
return self
|
||||
end
|
||||
@ -626,7 +643,9 @@ do -- TASK_A2G_CAS
|
||||
local TargetCoordinate = self.Detection and self.Detection:GetDetectedItemCoordinate( self.DetectedItemIndex ) or self.TargetSetUnit:GetFirst():GetCoordinate()
|
||||
self:SetInfo( "Coordinates", TargetCoordinate, 0 )
|
||||
|
||||
self:SetInfo( "Threat", "[" .. string.rep( "■", self.Detection and self.Detection:GetDetectedItemThreatLevel( self.DetectedItemIndex ) or self.TargetSetUnit:CalculateThreatLevelA2G() ) .. "]", 11 )
|
||||
local ThreatLevel = self.Detection and self.Detection:GetDetectedItemThreatLevel( self.DetectedItemIndex ) or self.TargetSetUnit:CalculateThreatLevelA2G()
|
||||
|
||||
self:SetInfo( "Threat", "[" .. string.rep( "■", ThreatLevel ) .. "]", 11 )
|
||||
|
||||
if self.Detection then
|
||||
local DetectedItemsCount = self.TargetSetUnit:Count()
|
||||
|
||||
@ -31,7 +31,9 @@ FLARECOLOR = trigger.flareColor -- #FLARECOLOR
|
||||
|
||||
--- Utilities static class.
|
||||
-- @type UTILS
|
||||
UTILS = {}
|
||||
UTILS = {
|
||||
_MarkID = 1
|
||||
}
|
||||
|
||||
--- 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
|
||||
|
||||
@ -166,6 +166,7 @@ function POSITIONABLE:GetCoordinate()
|
||||
|
||||
local PositionableCoordinate = COORDINATE:NewFromVec3( PositionableVec3 )
|
||||
PositionableCoordinate:SetHeading( self:GetHeading() )
|
||||
PositionableCoordinate:SetVelocity( self:GetVelocityMPS() )
|
||||
|
||||
self:T2( PositionableCoordinate )
|
||||
return PositionableCoordinate
|
||||
|
||||
@ -662,6 +662,7 @@
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<a id="#(AI_A2A).IdleCount" >
|
||||
<strong>AI_A2A.IdleCount</strong>
|
||||
</a>
|
||||
|
||||
@ -3543,6 +3543,7 @@ The range till cargo will board.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<a id="#(CARGO_UNIT).RunCount" >
|
||||
<strong>CARGO_UNIT.RunCount</strong>
|
||||
</a>
|
||||
|
||||
@ -1097,7 +1097,7 @@ function below will use the range 1-7 just in case</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<em></em>
|
||||
<a id="#(DESIGNATE).LaseDuration" >
|
||||
<strong>DESIGNATE.LaseDuration</strong>
|
||||
</a>
|
||||
@ -1151,7 +1151,10 @@ function below will use the range 1-7 just in case</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<em></em>
|
||||
=======
|
||||
>>>>>>> master
|
||||
<a id="#(DESIGNATE).LaserCodes" >
|
||||
<strong>DESIGNATE.LaserCodes</strong>
|
||||
</a>
|
||||
|
||||
@ -2466,6 +2466,7 @@ The index of the DetectedItem.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<a id="#(DETECTION_BASE).DetectedItemCount" >
|
||||
<strong>DETECTION_BASE.DetectedItemCount</strong>
|
||||
</a>
|
||||
@ -2479,6 +2480,7 @@ The index of the DetectedItem.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<a id="#(DETECTION_BASE).DetectedItemMax" >
|
||||
<strong>DETECTION_BASE.DetectedItemMax</strong>
|
||||
</a>
|
||||
|
||||
@ -316,6 +316,30 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(COORDINATE).IsLOS">COORDINATE:IsLOS(ToCoordinate)</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns if a Coordinate has Line of Sight (LOS) with the ToCoordinate.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(COORDINATE).MarkToAll">COORDINATE:MarkToAll(MarkText)</a></td>
|
||||
<td class="summary">
|
||||
<p>Mark to All</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(COORDINATE).MarkToCoalition">COORDINATE:MarkToCoalition(MarkText, Coalition)</a></td>
|
||||
<td class="summary">
|
||||
<p>Mark to Coalition</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(COORDINATE).MarkToCoalitionBlue">COORDINATE:MarkToCoalitionBlue(MarkText)</a></td>
|
||||
<td class="summary">
|
||||
<p>Mark to Blue Coalition</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(COORDINATE).MarkToCoalitionRed">COORDINATE:MarkToCoalitionRed(MarkText)</a></td>
|
||||
<td class="summary">
|
||||
<p>Mark to Red Coalition</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -334,6 +358,12 @@
|
||||
<td class="name" nowrap="nowrap"><a href="##(COORDINATE).NewFromVec3">COORDINATE:NewFromVec3(Vec3)</a></td>
|
||||
<td class="summary">
|
||||
<p>Create a new COORDINATE object from Vec3 coordinates.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(COORDINATE).RemoveMark">COORDINATE:RemoveMark(MarkID)</a></td>
|
||||
<td class="summary">
|
||||
<p>Remove a mark</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -863,6 +893,20 @@
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Markings</h2>
|
||||
|
||||
<p>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:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(COORDINATE).MarkToAll">COORDINATE.MarkToAll</a>(): Place a mark to all players.</li>
|
||||
<li><a href="##(COORDINATE).MarkToCoalition">COORDINATE.MarkToCoalition</a>(): Place a mark to a coalition.</li>
|
||||
<li><a href="##(COORDINATE).MarkToCoalitionRed">COORDINATE.MarkToCoalitionRed</a>(): Place a mark to the red coalition.</li>
|
||||
<li><a href="##(COORDINATE).MarkToCoalitionBlue">COORDINATE.MarkToCoalitionBlue</a>(): Place a mark to the blue coalition.</li>
|
||||
<li><a href="##(COORDINATE).MarkToGroup">COORDINATE.MarkToGroup</a>(): Place a mark to a group (needs to have a client in it or a CA group (CA group is bugged)).</li>
|
||||
<li><a href="##(COORDINATE).RemoveMark">COORDINATE.RemoveMark</a>(): Removes a mark from the map.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>3D calculation methods</h2>
|
||||
|
||||
<p>Various calculation methods exist to use or manipulate 3D space. Find below a short description of each method:</p>
|
||||
@ -1701,6 +1745,135 @@ true If the ToCoordinate has LOS with the Coordinate, otherwise false.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(COORDINATE).MarkToAll" >
|
||||
<strong>COORDINATE:MarkToAll(MarkText)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Mark to All</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string MarkText </em></code>:
|
||||
Free format text that shows the marking clarification.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#number:</em>
|
||||
The resulting Mark ID which is a number.</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code> local TargetCoord = TargetGroup:GetCoordinate()
|
||||
local MarkID = TargetCoord:MarkToAll( "This is a target for all players" )</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(COORDINATE).MarkToCoalition" >
|
||||
<strong>COORDINATE:MarkToCoalition(MarkText, Coalition)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Mark to Coalition</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string MarkText </em></code>:
|
||||
Free format text that shows the marking clarification.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em> Coalition </em></code>: </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#number:</em>
|
||||
The resulting Mark ID which is a number.</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code> local TargetCoord = TargetGroup:GetCoordinate()
|
||||
local MarkID = TargetCoord:MarkToCoalition( "This is a target for the red coalition", coalition.side.RED )</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(COORDINATE).MarkToCoalitionBlue" >
|
||||
<strong>COORDINATE:MarkToCoalitionBlue(MarkText)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Mark to Blue Coalition</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string MarkText </em></code>:
|
||||
Free format text that shows the marking clarification.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#number:</em>
|
||||
The resulting Mark ID which is a number.</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code> local TargetCoord = TargetGroup:GetCoordinate()
|
||||
local MarkID = TargetCoord:MarkToCoalitionBlue( "This is a target for the blue coalition" )</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(COORDINATE).MarkToCoalitionRed" >
|
||||
<strong>COORDINATE:MarkToCoalitionRed(MarkText)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Mark to Red Coalition</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#string MarkText </em></code>:
|
||||
Free format text that shows the marking clarification.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#number:</em>
|
||||
The resulting Mark ID which is a number.</p>
|
||||
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code> local TargetCoord = TargetGroup:GetCoordinate()
|
||||
local MarkID = TargetCoord:MarkToCoalitionRed( "This is a target for the red coalition" )</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(COORDINATE).New" >
|
||||
<strong>COORDINATE:New(x, y, z)</strong>
|
||||
</a>
|
||||
@ -1795,6 +1968,35 @@ The Vec3 point.</p>
|
||||
<p><em><a href="##(COORDINATE)">#COORDINATE</a>:</em></p>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(COORDINATE).RemoveMark" >
|
||||
<strong>COORDINATE:RemoveMark(MarkID)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Remove a mark</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em>#number MarkID </em></code>:
|
||||
The ID of the mark to be removed.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Usage:</h3>
|
||||
<pre class="example"><code> 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</code></pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -2937,7 +3139,6 @@ The y coordinate.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(POINT_VEC2).z" >
|
||||
<strong>POINT_VEC2.z</strong>
|
||||
</a>
|
||||
|
||||
@ -823,6 +823,12 @@ and any spaces before and after the resulting name are removed.</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPAWN).uncontrolled">SPAWN.uncontrolled</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2195,9 +2201,6 @@ The group that was spawned. You can use this group for further actions.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -2736,6 +2739,9 @@ when nothing was spawned.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Overwrite unit names by default with group name.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -3737,6 +3743,20 @@ True = Continue Scheduler</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(SPAWN).uncontrolled" >
|
||||
<strong>SPAWN.uncontrolled</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
@ -437,6 +437,7 @@ ptional) The name of the new static.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<a id="#(SPAWNSTATIC).SpawnIndex" >
|
||||
<strong>SPAWNSTATIC.SpawnIndex</strong>
|
||||
</a>
|
||||
|
||||
@ -237,6 +237,12 @@ which are excellent tools to be reused in an OO environment!.</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(UTILS).FeetToMeters">UTILS.FeetToMeters(feet)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(UTILS).GetMarkID">UTILS.GetMarkID()</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -333,6 +339,12 @@ use negative idp for rounding ahead of decimal place, positive for rounding afte
|
||||
<td class="name" nowrap="nowrap"><a href="##(UTILS).ToRadian">UTILS.ToRadian(angle)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(UTILS)._MarkID">UTILS._MarkID</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -638,6 +650,22 @@ use negative idp for rounding ahead of decimal place, positive for rounding afte
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(UTILS).GetMarkID" >
|
||||
<strong>UTILS.GetMarkID()</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> get a new mark ID for markings</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(UTILS).IsInstanceOf" >
|
||||
<strong>UTILS.IsInstanceOf(object, className)</strong>
|
||||
</a>
|
||||
@ -944,6 +972,20 @@ use negative idp for rounding ahead of decimal place, positive for rounding afte
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<a id="#(UTILS)._MarkID" >
|
||||
<strong>UTILS._MarkID</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user