mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Compare commits
154 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d1a7c770b | ||
|
|
1889df4952 | ||
|
|
7ca219748d | ||
|
|
b3f944e82e | ||
|
|
2fc16ba694 | ||
|
|
432fc0ef4b | ||
|
|
20c50c751f | ||
|
|
d3b62d0260 | ||
|
|
d0449265c1 | ||
|
|
a4feafab8e | ||
|
|
309eedd165 | ||
|
|
997baf21a0 | ||
|
|
fa676cc750 | ||
|
|
b126cc00d0 | ||
|
|
1e0c27f599 | ||
|
|
09b7922b84 | ||
|
|
66032d6894 | ||
|
|
7c98a793c7 | ||
|
|
7a5b9a75f3 | ||
|
|
0ea5631955 | ||
|
|
4bab2ee1de | ||
|
|
f5b9713639 | ||
|
|
1bfb4fc4e1 | ||
|
|
d7defe6f7f | ||
|
|
ebb94c07b3 | ||
|
|
f4cdbec376 | ||
|
|
21d5a5dfac | ||
|
|
f8947aab9c | ||
|
|
db869bcb6d | ||
|
|
36a0cfd635 | ||
|
|
ea4a1f9ff9 | ||
|
|
20406e40ca | ||
|
|
acbcb14cba | ||
|
|
3b50fee5a0 | ||
|
|
804004198b | ||
|
|
67ef6c6e7b | ||
|
|
5b8b8a5566 | ||
|
|
0468bacc0b | ||
|
|
eacc43cb5a | ||
|
|
f3dcde075c | ||
|
|
7eba1349ae | ||
|
|
b6074a4795 | ||
|
|
615afb7cc4 | ||
|
|
36c9f551d9 | ||
|
|
89c3f7310b | ||
|
|
6791a0e704 | ||
|
|
a6b622ed31 | ||
|
|
f1af3a50b8 | ||
|
|
f999e45323 | ||
|
|
0c90e90c18 | ||
|
|
4747f3f48f | ||
|
|
f97ef25104 | ||
|
|
e1a670185e | ||
|
|
069c0aa03f | ||
|
|
b145588ed5 | ||
|
|
b678e2cde1 | ||
|
|
db23a0bf2b | ||
|
|
3ad60a95ce | ||
|
|
5c3b7312c0 | ||
|
|
f177d0a257 | ||
|
|
ac4b620f16 | ||
|
|
c49b56eefc | ||
|
|
ccada18a6a | ||
|
|
1547d66327 | ||
|
|
e21236655a | ||
|
|
cdad3bd058 | ||
|
|
0db9c27f7e | ||
|
|
8042e8bfaf | ||
|
|
dd7b87e9cd | ||
|
|
68a539923f | ||
|
|
460d2768ff | ||
|
|
3c74272749 | ||
|
|
3442725525 | ||
|
|
82c409d77a | ||
|
|
195aac4504 | ||
|
|
326e27327d | ||
|
|
08d8f3e25f | ||
|
|
6f72697e26 | ||
|
|
296d4b1e93 | ||
|
|
0f6439cf9f | ||
|
|
9705b49dbe | ||
|
|
9364579a18 | ||
|
|
02a6d8f2c0 | ||
|
|
2c10943cb1 | ||
|
|
a293c59d6d | ||
|
|
544db963ea | ||
|
|
d3fd21e6da | ||
|
|
207698a2dd | ||
|
|
27cd90a0ce | ||
|
|
d1ae2c0f5e | ||
|
|
66e6a603f1 | ||
|
|
0392417189 | ||
|
|
0678ad17f8 | ||
|
|
be4beea9d0 | ||
|
|
5da899138b | ||
|
|
1ec1e00bde | ||
|
|
d7d46d4f1b | ||
|
|
5d93b33d42 | ||
|
|
b2077bfc74 | ||
|
|
e958ca103a | ||
|
|
1d9ef869a7 | ||
|
|
6fdf9a649f | ||
|
|
90c6c57449 | ||
|
|
d013bbc751 | ||
|
|
e0092fdba0 | ||
|
|
ecce2eff9b | ||
|
|
fbeada439f | ||
|
|
6c8858d2f5 | ||
|
|
e2b77878df | ||
|
|
53d7972858 | ||
|
|
04a55e4104 | ||
|
|
d11acecdac | ||
|
|
4b23c86daa | ||
|
|
49c11073e6 | ||
|
|
daa5caa125 | ||
|
|
1a156e7e12 | ||
|
|
6fe88a6319 | ||
|
|
1856754614 | ||
|
|
b9f6c1b9c7 | ||
|
|
6ac452ff15 | ||
|
|
b52176a0ff | ||
|
|
d707a4775c | ||
|
|
ffccc31e38 | ||
|
|
0405af2bde | ||
|
|
d09f0b1f6f | ||
|
|
e50e572c78 | ||
|
|
2e688e7da1 | ||
|
|
3083599158 | ||
|
|
2921f7a76b | ||
|
|
b7b6c1ea19 | ||
|
|
8a185c352e | ||
|
|
5b107ce2da | ||
|
|
5c1e342a79 | ||
|
|
3fc8f52796 | ||
|
|
ddf33da787 | ||
|
|
e7cee4d97b | ||
|
|
b0a192a767 | ||
|
|
986c340211 | ||
|
|
2109537f86 | ||
|
|
bad9d1ea92 | ||
|
|
690db7f12f | ||
|
|
4f3fd06cc9 | ||
|
|
f5b1050086 | ||
|
|
4074023ed3 | ||
|
|
f729b1d358 | ||
|
|
6c00b0c7eb | ||
|
|
5adefe6f7b | ||
|
|
76dc0d690a | ||
|
|
13c16b8674 | ||
|
|
222722225e | ||
|
|
82e1dcfc04 | ||
|
|
c26220d1fd | ||
|
|
d783f7be99 | ||
|
|
b66e91b11f |
@@ -1953,7 +1953,7 @@ local function refct_from_id(id) -- refct = refct_from_id(CTypeID)
|
||||
unsigned = refct.unsigned,
|
||||
size = bit.band(bit.rshift(ctype.info, 16), 127),
|
||||
}
|
||||
refct.bool, refct.const, refct.volatile, refct.unsigned = nil
|
||||
refct.bool, refct.const, refct.volatile, refct.unsigned = nil, nil, nil, nil
|
||||
end
|
||||
|
||||
if CT[4] then -- Merge sibling attributes onto this type.
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
|
||||
--- The AI_A2A_CAP class implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Group} or @{Wrapper.Group}
|
||||
-- and automatically engage any airborne enemies that are within a certain range or within a certain zone.
|
||||
--
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_A2A_CAP is assigned a @{Wrapper.Group} and this must be done before the AI_A2A_CAP process can be started using the **Start** event.
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
-- [DCS WORLD - MOOSE - A2A GCICAP - Build an automatic A2A Defense System](https://www.youtube.com/playlist?list=PL7ZUrU4zZUl0S4KMNUUJpaUs6zZHjLKNx)
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # QUICK START GUIDE
|
||||
--
|
||||
-- There are basically two classes available to model an A2A defense system.
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
--- Implements the core functions to intercept intruders. Use the Engage trigger to intercept intruders.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_A2A_GCI is assigned a @{Wrapper.Group} and this must be done before the AI_A2A_GCI process can be started using the **Start** event.
|
||||
--
|
||||
-- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
--- Implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Group} or @{Wrapper.Group}.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_A2A_PATROL is assigned a @{Wrapper.Group} and this must be done before the AI_A2A_PATROL process can be started using the **Start** event.
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
-- @extends AI.AI_A2A_Engage#AI_A2A_Engage -- TODO: Documentation. This class does not exist, unable to determine what it extends.
|
||||
|
||||
--- Implements the core functions to intercept intruders. Use the Engage trigger to intercept intruders.
|
||||
--
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
||||
-- Therefore, this class is considered to be deprecated
|
||||
--
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
--
|
||||
-- # QUICK START GUIDE
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The following class is available to model an A2G defense system.
|
||||
--
|
||||
-- AI_A2G_DISPATCHER is the main A2G defense class that models the A2G defense system.
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
--- Implements the core functions to SEAD intruders. Use the Engage trigger to intercept intruders.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_A2G_SEAD is assigned a @{Wrapper.Group} and this must be done before the AI_A2G_SEAD process can be started using the **Start** event.
|
||||
--
|
||||
-- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
--- The AI_AIR class implements the core functions to operate an AI @{Wrapper.Group}.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # 1) AI_AIR constructor
|
||||
--
|
||||
@@ -657,8 +658,8 @@ function AI_AIR:onafterRTB( AIGroup, From, Event, To )
|
||||
--- Create a route point of type air.
|
||||
local FromRTBRoutePoint = FromCoord:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
RTBSpeed,
|
||||
true
|
||||
)
|
||||
@@ -666,8 +667,8 @@ function AI_AIR:onafterRTB( AIGroup, From, Event, To )
|
||||
--- Create a route point of type air.
|
||||
local ToRTBRoutePoint = ToAirbaseCoord:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
RTBSpeed,
|
||||
true
|
||||
)
|
||||
@@ -761,10 +762,10 @@ function AI_AIR:onafterRefuel( AIGroup, From, Event, To )
|
||||
local ToRefuelSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed )
|
||||
|
||||
--- Create a route point of type air.
|
||||
local FromRefuelRoutePoint = FromRefuelCoord:WaypointAir(self.PatrolAltType, POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, ToRefuelSpeed, true)
|
||||
local FromRefuelRoutePoint = FromRefuelCoord:WaypointAir(self.PatrolAltType, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, ToRefuelSpeed, true)
|
||||
|
||||
--- Create a route point of type air. NOT used!
|
||||
local ToRefuelRoutePoint = Tanker:GetCoordinate():WaypointAir(self.PatrolAltType, POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, ToRefuelSpeed, true)
|
||||
local ToRefuelRoutePoint = Tanker:GetCoordinate():WaypointAir(self.PatrolAltType, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, ToRefuelSpeed, true)
|
||||
|
||||
self:F( { ToRefuelSpeed = ToRefuelSpeed } )
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
--
|
||||
-- # QUICK START GUIDE
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The following class is available to model an AIR defense system.
|
||||
--
|
||||
-- AI_AIR_DISPATCHER is the main AIR defense class that models the AIR defense system.
|
||||
|
||||
@@ -13,12 +13,14 @@
|
||||
|
||||
|
||||
|
||||
-- @type AI_AIR_ENGAGE
|
||||
--- @type AI_AIR_ENGAGE
|
||||
-- @extends AI.AI_AIR#AI_AIR
|
||||
|
||||
|
||||
--- Implements the core functions to intercept intruders. Use the Engage trigger to intercept intruders.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_AIR_ENGAGE is assigned a @{Wrapper.Group} and this must be done before the AI_AIR_ENGAGE process can be started using the **Start** event.
|
||||
--
|
||||
-- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
|
||||
@@ -453,7 +455,7 @@ function AI_AIR_ENGAGE:onafterEngageRoute( DefenderGroup, From, Event, To, Attac
|
||||
|
||||
--- Calculate the target route point.
|
||||
|
||||
local FromWP = DefenderCoord:WaypointAir(self.PatrolAltType or "RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, EngageSpeed, true)
|
||||
local FromWP = DefenderCoord:WaypointAir(self.PatrolAltType or "RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, EngageSpeed, true)
|
||||
|
||||
EngageRoute[#EngageRoute+1] = FromWP
|
||||
|
||||
@@ -462,7 +464,7 @@ function AI_AIR_ENGAGE:onafterEngageRoute( DefenderGroup, From, Event, To, Attac
|
||||
local FromEngageAngle = DefenderCoord:GetAngleDegrees( DefenderCoord:GetDirectionVec3( TargetCoord ) )
|
||||
local ToCoord=DefenderCoord:Translate( EngageDistance, FromEngageAngle, true )
|
||||
|
||||
local ToWP = ToCoord:WaypointAir(self.PatrolAltType or "RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, EngageSpeed, true)
|
||||
local ToWP = ToCoord:WaypointAir(self.PatrolAltType or "RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, EngageSpeed, true)
|
||||
|
||||
EngageRoute[#EngageRoute+1] = ToWP
|
||||
|
||||
@@ -536,7 +538,7 @@ function AI_AIR_ENGAGE:onafterEngage( DefenderGroup, From, Event, To, AttackSetU
|
||||
local EngageRoute = {}
|
||||
local AttackTasks = {}
|
||||
|
||||
local FromWP = DefenderCoord:WaypointAir(self.EngageAltType or "RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, EngageSpeed, true)
|
||||
local FromWP = DefenderCoord:WaypointAir(self.EngageAltType or "RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, EngageSpeed, true)
|
||||
EngageRoute[#EngageRoute+1] = FromWP
|
||||
|
||||
self:SetTargetDistance( TargetCoord ) -- For RTB status check
|
||||
@@ -544,7 +546,7 @@ function AI_AIR_ENGAGE:onafterEngage( DefenderGroup, From, Event, To, AttackSetU
|
||||
local FromEngageAngle = DefenderCoord:GetAngleDegrees( DefenderCoord:GetDirectionVec3( TargetCoord ) )
|
||||
local ToCoord=DefenderCoord:Translate( EngageDistance, FromEngageAngle, true )
|
||||
|
||||
local ToWP = ToCoord:WaypointAir(self.EngageAltType or "RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, EngageSpeed, true)
|
||||
local ToWP = ToCoord:WaypointAir(self.EngageAltType or "RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, EngageSpeed, true)
|
||||
EngageRoute[#EngageRoute+1] = ToWP
|
||||
|
||||
-- TODO: A factor of * 3 this way too low. This causes the AI NOT to engage until very close or even merged sometimes. Some A2A missiles have a much longer range! Needs more frequent updates of the task!
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
--- The AI_AIR_PATROL class implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Group}
|
||||
-- and automatically engage any airborne enemies that are within a certain range or within a certain zone.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_AIR_PATROL is assigned a @{Wrapper.Group} and this must be done before the AI_AIR_PATROL process can be started using the **Start** event.
|
||||
@@ -309,7 +311,7 @@ function AI_AIR_PATROL:onafterPatrolRoute( AIPatrol, From, Event, To )
|
||||
local ToTargetSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed )
|
||||
local speedkmh=ToTargetSpeed
|
||||
|
||||
local FromWP = CurrentCoord:WaypointAir(self.PatrolAltType or "RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, ToTargetSpeed, true)
|
||||
local FromWP = CurrentCoord:WaypointAir(self.PatrolAltType or "RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, ToTargetSpeed, true)
|
||||
PatrolRoute[#PatrolRoute+1] = FromWP
|
||||
|
||||
if self.racetrack then
|
||||
@@ -359,9 +361,9 @@ function AI_AIR_PATROL:onafterPatrolRoute( AIPatrol, From, Event, To )
|
||||
else
|
||||
|
||||
--- Create a route point of type air.
|
||||
local ToWP = ToTargetCoord:WaypointAir(self.PatrolAltType, POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, ToTargetSpeed, true)
|
||||
local ToWP = ToTargetCoord:WaypointAir(self.PatrolAltType, COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, ToTargetSpeed, true)
|
||||
PatrolRoute[#PatrolRoute+1] = ToWP
|
||||
|
||||
|
||||
local Tasks = {}
|
||||
Tasks[#Tasks+1] = AIPatrol:TaskFunction("AI_AIR_PATROL.___PatrolRoute", self)
|
||||
PatrolRoute[#PatrolRoute].task = AIPatrol:TaskCombo( Tasks )
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
|
||||
-- @type AI_AIR_SQUADRON
|
||||
--- @type AI_AIR_SQUADRON
|
||||
-- @extends Core.Base#BASE
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
||||
-- Therefore, this class is considered to be deprecated
|
||||
--
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
|
||||
--- Implements the core functions to provide BattleGround Air Interdiction in an Engage @{Core.Zone} by an AIR @{Wrapper.Controllable} or @{Wrapper.Group}.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_BAI_ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone.
|
||||
--
|
||||
-- 
|
||||
@@ -521,12 +523,12 @@ function AI_BAI_ZONE:onafterEngage( Controllable, From, Event, To,
|
||||
|
||||
--DONE: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
||||
local CurrentAltitude = self.Controllable:GetAltitude()
|
||||
local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local CurrentPointVec3 = COORDINATE:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local ToEngageZoneSpeed = self.PatrolMaxSpeed
|
||||
local CurrentRoutePoint = CurrentPointVec3:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
self.EngageSpeed,
|
||||
true
|
||||
)
|
||||
@@ -577,13 +579,13 @@ function AI_BAI_ZONE:onafterEngage( Controllable, From, Event, To,
|
||||
self:T2( ToTargetVec2 )
|
||||
|
||||
--- Obtain a 3D @{Point} from the 2D point + altitude.
|
||||
local ToTargetPointVec3 = POINT_VEC3:New( ToTargetVec2.x, self.EngageAltitude, ToTargetVec2.y )
|
||||
local ToTargetPointVec3 = COORDINATE:New( ToTargetVec2.x, self.EngageAltitude, ToTargetVec2.y )
|
||||
|
||||
--- Create a route point of type air.
|
||||
local ToTargetRoutePoint = ToTargetPointVec3:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
self.EngageSpeed,
|
||||
true
|
||||
)
|
||||
|
||||
@@ -33,8 +33,9 @@
|
||||
-- @field Wrapper.Group#GROUP Test
|
||||
-- @extends Core.Fsm#FSM_SET
|
||||
|
||||
|
||||
--- Monitors and manages as many replacement AI groups as there are
|
||||
--- 
|
||||
--
|
||||
-- Monitors and manages as many replacement AI groups as there are
|
||||
-- CLIENTS in a SET\_CLIENT collection, which are not occupied by human players.
|
||||
-- In other words, use AI_BALANCER to simulate human behaviour by spawning in replacement AI in multi player missions.
|
||||
--
|
||||
@@ -220,16 +221,9 @@ function AI_BALANCER:onenterReturning( SetGroup, From, Event, To, AIGroup )
|
||||
AIGroup:MessageToRed( "Returning to home base ...", 30 )
|
||||
else
|
||||
-- Okay, we need to send this Group back to the nearest base of the Coalition of the AI.
|
||||
--TODO: i need to rework the POINT_VEC2 thing.
|
||||
local PointVec2 = POINT_VEC2:New( AIGroup:GetVec2().x, AIGroup:GetVec2().y )
|
||||
local PointVec2 = COORDINATE:New(AIGroup:GetVec2().x, 0, AIGroup:GetVec2().y)
|
||||
local ClosestAirbase = self.ReturnAirbaseSet:FindNearestAirbaseFromPointVec2( PointVec2 )
|
||||
self:T( ClosestAirbase.AirbaseName )
|
||||
--[[
|
||||
AIGroup:MessageToRed( "Returning to " .. ClosestAirbase:GetName().. " ...", 30 )
|
||||
local RTBRoute = AIGroup:RouteReturnToAirbase( ClosestAirbase )
|
||||
AIGroupTemplate.route = RTBRoute
|
||||
AIGroup:Respawn( AIGroupTemplate )
|
||||
]]
|
||||
AIGroup:RouteRTB(ClosestAirbase)
|
||||
end
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
--- Implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Controllable} or @{Wrapper.Group}
|
||||
-- and automatically engage any airborne enemies that are within a certain range or within a certain zone.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_CAP_ZONE is assigned a @{Wrapper.Group} and this must be done before the AI_CAP_ZONE process can be started using the **Start** event.
|
||||
@@ -423,12 +425,12 @@ function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To )
|
||||
|
||||
--DONE: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
||||
local CurrentAltitude = self.Controllable:GetAltitude()
|
||||
local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local CurrentPointVec3 = COORDINATE:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local ToEngageZoneSpeed = self.PatrolMaxSpeed
|
||||
local CurrentRoutePoint = CurrentPointVec3:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
ToEngageZoneSpeed,
|
||||
true
|
||||
)
|
||||
@@ -445,13 +447,13 @@ function AI_CAP_ZONE:onafterEngage( Controllable, From, Event, To )
|
||||
self:T2( { self.PatrolMinSpeed, self.PatrolMaxSpeed, ToTargetSpeed } )
|
||||
|
||||
--- Obtain a 3D @{Point} from the 2D point + altitude.
|
||||
local ToTargetPointVec3 = POINT_VEC3:New( ToTargetVec2.x, ToTargetAltitude, ToTargetVec2.y )
|
||||
local ToTargetPointVec3 = COORDINATE:New( ToTargetVec2.x, ToTargetAltitude, ToTargetVec2.y )
|
||||
|
||||
--- Create a route point of type air.
|
||||
local ToPatrolRoutePoint = ToTargetPointVec3:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
ToTargetSpeed,
|
||||
true
|
||||
)
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
-- @extends AI.AI_Patrol#AI_PATROL_ZONE
|
||||
|
||||
--- Implements the core functions to provide Close Air Support in an Engage @{Core.Zone} by an AIR @{Wrapper.Controllable} or @{Wrapper.Group}.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_CAS_ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone.
|
||||
--
|
||||
-- 
|
||||
@@ -465,12 +468,12 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To,
|
||||
|
||||
--DONE: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
||||
local CurrentAltitude = self.Controllable:GetAltitude()
|
||||
local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local CurrentPointVec3 = COORDINATE:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local ToEngageZoneSpeed = self.PatrolMaxSpeed
|
||||
local CurrentRoutePoint = CurrentPointVec3:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
self.EngageSpeed,
|
||||
true
|
||||
)
|
||||
@@ -507,13 +510,13 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To,
|
||||
self:T2( ToTargetVec2 )
|
||||
|
||||
--- Obtain a 3D @{Point} from the 2D point + altitude.
|
||||
local ToTargetPointVec3 = POINT_VEC3:New( ToTargetVec2.x, self.EngageAltitude, ToTargetVec2.y )
|
||||
local ToTargetPointVec3 = COORDINATE:New( ToTargetVec2.x, self.EngageAltitude, ToTargetVec2.y )
|
||||
|
||||
--- Create a route point of type air.
|
||||
local ToTargetRoutePoint = ToTargetPointVec3:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
self.EngageSpeed,
|
||||
true
|
||||
)
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
-- @module AI.AI_Cargo
|
||||
-- @image Cargo.JPG
|
||||
|
||||
-- @type AI_CARGO
|
||||
--- @type AI_CARGO
|
||||
-- @extends Core.Fsm#FSM_CONTROLLABLE
|
||||
|
||||
|
||||
--- Base class for the dynamic cargo handling capability for AI groups.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Carriers can be mobilized to intelligently transport infantry and other cargo within the simulation.
|
||||
-- The AI_CARGO module uses the @{Cargo.Cargo} capabilities within the MOOSE framework.
|
||||
-- CARGO derived objects must be declared within the mission to make the AI_CARGO object recognize the cargo.
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
--- Brings a dynamic cargo handling capability for an AI vehicle group.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Armoured Personnel Carriers (APC), Trucks, Jeeps and other ground based carrier equipment can be mobilized to intelligently transport infantry and other cargo within the simulation.
|
||||
--
|
||||
-- The AI_CARGO_APC class uses the @{Cargo.Cargo} capabilities within the MOOSE framework.
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
|
||||
--- Brings a dynamic cargo handling capability for an AI airplane group.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Airplane carrier equipment can be mobilized to intelligently transport infantry and other cargo within the simulation between airbases.
|
||||
--
|
||||
@@ -440,7 +442,7 @@ function AI_CARGO_AIRPLANE:Route( Airplane, Airbase, Speed, Height, Uncontrolled
|
||||
|
||||
-- To point.
|
||||
local AirbasePointVec2 = Airbase:GetPointVec2()
|
||||
local ToWaypoint = AirbasePointVec2:WaypointAir(POINT_VEC3.RoutePointAltType.BARO, "Land", "Landing", Speed or Airplane:GetSpeedMax()*0.8, true, Airbase)
|
||||
local ToWaypoint = AirbasePointVec2:WaypointAir(COORDINATE.WaypointAltType.BARO, "Land", "Landing", Speed or Airplane:GetSpeedMax()*0.8, true, Airbase)
|
||||
|
||||
--ToWaypoint["airdromeId"] = Airbase:GetID()
|
||||
--ToWaypoint["speed_locked"] = true
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # The dispatcher concept.
|
||||
--
|
||||
-- Carrier equipment can be mobilized to intelligently transport infantry and other cargo within the simulation.
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
|
||||
--- A dynamic cargo transportation capability for AI groups.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Armoured Personnel APCs (APC), Trucks, Jeeps and other carrier equipment can be mobilized to intelligently transport infantry and other cargo within the simulation.
|
||||
--
|
||||
-- The AI_CARGO_DISPATCHER_APC module is derived from the AI_CARGO_DISPATCHER module.
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
|
||||
--- Brings a dynamic cargo handling capability for AI groups.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Airplanes can be mobilized to intelligently transport infantry and other cargo within the simulation.
|
||||
--
|
||||
-- The AI_CARGO_DISPATCHER_AIRPLANE module is derived from the AI_CARGO_DISPATCHER module.
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
|
||||
--- A dynamic cargo handling capability for AI helicopter groups.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Helicopters can be mobilized to intelligently transport infantry and other cargo within the simulation.
|
||||
--
|
||||
--
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
--- A dynamic cargo transportation capability for AI groups.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Naval vessels can be mobilized to semi-intelligently transport cargo within the simulation.
|
||||
--
|
||||
-- The AI_CARGO_DISPATCHER_SHIP module is derived from the AI_CARGO_DISPATCHER module.
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
--- Brings a dynamic cargo handling capability for an AI helicopter group.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Helicopter carriers can be mobilized to intelligently transport infantry and other cargo within the simulation.
|
||||
--
|
||||
-- The AI_CARGO_HELICOPTER class uses the @{Cargo.Cargo} capabilities within the MOOSE framework.
|
||||
@@ -367,8 +369,8 @@ function AI_CARGO_HELICOPTER:onafterQueue( Helicopter, From, Event, To, Coordina
|
||||
-- local CoordinateFrom = Helicopter:GetCoordinate()
|
||||
-- local WaypointFrom = CoordinateFrom:WaypointAir(
|
||||
-- "RADIO",
|
||||
-- POINT_VEC3.RoutePointType.TurningPoint,
|
||||
-- POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
-- COORDINATE.WaypointType.TurningPoint,
|
||||
-- COORDINATE.WaypointAction.TurningPoint,
|
||||
-- Speed,
|
||||
-- true
|
||||
-- )
|
||||
@@ -380,8 +382,8 @@ function AI_CARGO_HELICOPTER:onafterQueue( Helicopter, From, Event, To, Coordina
|
||||
|
||||
local WaypointTo = CoordinateTo:WaypointAir(
|
||||
"RADIO",
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
50,
|
||||
true
|
||||
)
|
||||
@@ -427,7 +429,7 @@ function AI_CARGO_HELICOPTER:onafterOrbit( Helicopter, From, Event, To, Coordina
|
||||
local landheight = CoordinateTo:GetLandHeight() -- get target height
|
||||
CoordinateTo.y = landheight + 50 -- flight height should be 50m above ground
|
||||
|
||||
local WaypointTo = CoordinateTo:WaypointAir("RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, 50, true)
|
||||
local WaypointTo = CoordinateTo:WaypointAir("RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, 50, true)
|
||||
Route[#Route+1] = WaypointTo
|
||||
|
||||
local Tasks = {}
|
||||
@@ -496,14 +498,14 @@ function AI_CARGO_HELICOPTER:onafterPickup( Helicopter, From, Event, To, Coordin
|
||||
local CoordinateFrom = Helicopter:GetCoordinate()
|
||||
|
||||
--- Create a route point of type air.
|
||||
local WaypointFrom = CoordinateFrom:WaypointAir("RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, _speed, true)
|
||||
local WaypointFrom = CoordinateFrom:WaypointAir("RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, _speed, true)
|
||||
|
||||
--- Create a route point of type air.
|
||||
local CoordinateTo = Coordinate
|
||||
local landheight = CoordinateTo:GetLandHeight() -- get target height
|
||||
CoordinateTo.y = landheight + 50 -- flight height should be 50m above ground
|
||||
|
||||
local WaypointTo = CoordinateTo:WaypointAir("RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint,_speed, true)
|
||||
local WaypointTo = CoordinateTo:WaypointAir("RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint,_speed, true)
|
||||
|
||||
Route[#Route+1] = WaypointFrom
|
||||
Route[#Route+1] = WaypointTo
|
||||
@@ -563,7 +565,7 @@ function AI_CARGO_HELICOPTER:onafterDeploy( Helicopter, From, Event, To, Coordin
|
||||
|
||||
--- Create a route point of type air.
|
||||
local CoordinateFrom = Helicopter:GetCoordinate()
|
||||
local WaypointFrom = CoordinateFrom:WaypointAir("RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, _speed, true)
|
||||
local WaypointFrom = CoordinateFrom:WaypointAir("RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, _speed, true)
|
||||
Route[#Route+1] = WaypointFrom
|
||||
Route[#Route+1] = WaypointFrom
|
||||
|
||||
@@ -573,7 +575,7 @@ function AI_CARGO_HELICOPTER:onafterDeploy( Helicopter, From, Event, To, Coordin
|
||||
local landheight = CoordinateTo:GetLandHeight() -- get target height
|
||||
CoordinateTo.y = landheight + 50 -- flight height should be 50m above ground
|
||||
|
||||
local WaypointTo = CoordinateTo:WaypointAir("RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, _speed, true)
|
||||
local WaypointTo = CoordinateTo:WaypointAir("RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, _speed, true)
|
||||
|
||||
Route[#Route+1] = WaypointTo
|
||||
Route[#Route+1] = WaypointTo
|
||||
@@ -631,7 +633,7 @@ function AI_CARGO_HELICOPTER:onafterHome( Helicopter, From, Event, To, Coordinat
|
||||
--- Create a route point of type air.
|
||||
local CoordinateFrom = Helicopter:GetCoordinate()
|
||||
|
||||
local WaypointFrom = CoordinateFrom:WaypointAir("RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, Speed, true)
|
||||
local WaypointFrom = CoordinateFrom:WaypointAir("RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, Speed, true)
|
||||
Route[#Route+1] = WaypointFrom
|
||||
|
||||
--- Create a route point of type air.
|
||||
@@ -639,7 +641,7 @@ function AI_CARGO_HELICOPTER:onafterHome( Helicopter, From, Event, To, Coordinat
|
||||
local landheight = CoordinateTo:GetLandHeight() -- get target height
|
||||
CoordinateTo.y = landheight + Height -- flight height should be 50m above ground
|
||||
|
||||
local WaypointTo = CoordinateTo:WaypointAir("RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, Speed, true)
|
||||
local WaypointTo = CoordinateTo:WaypointAir("RADIO", COORDINATE.WaypointType.TurningPoint, COORDINATE.WaypointAction.TurningPoint, Speed, true)
|
||||
|
||||
Route[#Route+1] = WaypointTo
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
--- Brings a dynamic cargo handling capability for an AI naval group.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Naval ships can be utilized to transport cargo around the map following naval shipping lanes.
|
||||
-- The AI_CARGO_SHIP class uses the @{Cargo.Cargo} capabilities within the MOOSE framework.
|
||||
-- @{Cargo.Cargo} must be declared within the mission or warehouse to make the AI_CARGO_SHIP recognize the cargo.
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
--
|
||||
-- Allows you to interact with escorting AI on your flight and take the lead.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Each escorting group can be commanded with a complete set of radio commands (radio menu in your flight, and then F10).
|
||||
--
|
||||
-- The radio commands will vary according the category of the group. The richest set of commands are with helicopters and airPlanes.
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
||||
-- Therefore, this class is considered to be deprecated
|
||||
--
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
--- Models the assignment of AI escorts to player flights upon request using the radio menu.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
--
|
||||
-- Allows you to interact with escorting AI on your flight and take the lead.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Each escorting group can be commanded with a complete set of radio commands (radio menu in your flight, and then F10).
|
||||
--
|
||||
-- The radio commands will vary according the category of the group. The richest set of commands are with helicopters and airPlanes.
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
|
||||
|
||||
--- Build large formations, make AI follow a @{Wrapper.Client#CLIENT} (player) leader or a @{Wrapper.Unit#UNIT} (AI) leader.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- AI_FORMATION makes AI @{Wrapper.Group#GROUP}s fly in formation of various compositions.
|
||||
-- The AI_FORMATION class models formations in a different manner than the internal DCS formation logic!!!
|
||||
@@ -725,7 +727,7 @@ function AI_FORMATION:onafterFormationLine( FollowGroupSet, From , Event , To, X
|
||||
|
||||
for FollowID, FollowGroup in pairs( FollowSet ) do
|
||||
|
||||
local PointVec3 = POINT_VEC3:New()
|
||||
local PointVec3 = COORDINATE:New()
|
||||
PointVec3:SetX( XStart + i * XSpace )
|
||||
PointVec3:SetY( YStart + i * YSpace )
|
||||
PointVec3:SetZ( ZStart + i * ZSpace )
|
||||
@@ -877,7 +879,7 @@ function AI_FORMATION:onafterFormationCenterWing( FollowGroupSet, From , Event ,
|
||||
|
||||
for FollowID, FollowGroup in pairs( FollowSet ) do
|
||||
|
||||
local PointVec3 = POINT_VEC3:New()
|
||||
local PointVec3 = COORDINATE:New()
|
||||
|
||||
local Side = ( i % 2 == 0 ) and 1 or -1
|
||||
local Row = i / 2 + 1
|
||||
@@ -936,7 +938,7 @@ function AI_FORMATION:onafterFormationBox( FollowGroupSet, From , Event , To, XS
|
||||
|
||||
for FollowID, FollowGroup in pairs( FollowSet ) do
|
||||
|
||||
local PointVec3 = POINT_VEC3:New()
|
||||
local PointVec3 = COORDINATE:New()
|
||||
|
||||
local ZIndex = i % ZLevels
|
||||
local XIndex = math.floor( i / ZLevels )
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
|
||||
--- Implements the core functions to patrol a @{Core.Zone} by an AI @{Wrapper.Controllable} or @{Wrapper.Group}.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The AI_PATROL_ZONE is assigned a @{Wrapper.Group} and this must be done before the AI_PATROL_ZONE process can be started using the **Start** event.
|
||||
@@ -751,12 +753,12 @@ function AI_PATROL_ZONE:onafterRoute( Controllable, From, Event, To )
|
||||
if not CurrentVec2 then return end
|
||||
--Done: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
||||
local CurrentAltitude = self.Controllable:GetAltitude()
|
||||
local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local CurrentPointVec3 = COORDINATE:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local ToPatrolZoneSpeed = self.PatrolMaxSpeed
|
||||
local CurrentRoutePoint = CurrentPointVec3:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TakeOffParking,
|
||||
POINT_VEC3.RoutePointAction.FromParkingArea,
|
||||
COORDINATE.WaypointType.TakeOffParking,
|
||||
COORDINATE.WaypointAction.FromParkingArea,
|
||||
ToPatrolZoneSpeed,
|
||||
true
|
||||
)
|
||||
@@ -767,12 +769,12 @@ function AI_PATROL_ZONE:onafterRoute( Controllable, From, Event, To )
|
||||
if not CurrentVec2 then return end
|
||||
--DONE: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
||||
local CurrentAltitude = self.Controllable:GetAltitude()
|
||||
local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local CurrentPointVec3 = COORDINATE:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local ToPatrolZoneSpeed = self.PatrolMaxSpeed
|
||||
local CurrentRoutePoint = CurrentPointVec3:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
ToPatrolZoneSpeed,
|
||||
true
|
||||
)
|
||||
@@ -792,13 +794,13 @@ function AI_PATROL_ZONE:onafterRoute( Controllable, From, Event, To )
|
||||
self:T2( { self.PatrolMinSpeed, self.PatrolMaxSpeed, ToTargetSpeed } )
|
||||
|
||||
--- Obtain a 3D @{Point} from the 2D point + altitude.
|
||||
local ToTargetPointVec3 = POINT_VEC3:New( ToTargetVec2.x, ToTargetAltitude, ToTargetVec2.y )
|
||||
local ToTargetPointVec3 = COORDINATE:New( ToTargetVec2.x, ToTargetAltitude, ToTargetVec2.y )
|
||||
|
||||
--- Create a route point of type air.
|
||||
local ToTargetRoutePoint = ToTargetPointVec3:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
ToTargetSpeed,
|
||||
true
|
||||
)
|
||||
@@ -890,12 +892,12 @@ function AI_PATROL_ZONE:onafterRTB()
|
||||
--DONE: Create GetAltitude function for GROUP, and delete GetUnit(1).
|
||||
--local CurrentAltitude = self.Controllable:GetUnit(1):GetAltitude()
|
||||
local CurrentAltitude = self.Controllable:GetAltitude()
|
||||
local CurrentPointVec3 = POINT_VEC3:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local CurrentPointVec3 = COORDINATE:New( CurrentVec2.x, CurrentAltitude, CurrentVec2.y )
|
||||
local ToPatrolZoneSpeed = self.PatrolMaxSpeed
|
||||
local CurrentRoutePoint = CurrentPointVec3:WaypointAir(
|
||||
self.PatrolAltType,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
COORDINATE.WaypointType.TurningPoint,
|
||||
COORDINATE.WaypointAction.TurningPoint,
|
||||
ToPatrolZoneSpeed,
|
||||
true
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- **Actions** - ACT_ACCOUNT_ classes **account for** (detect, count & report) various DCS events occurring on UNITs.
|
||||
--
|
||||
-- 
|
||||
-- 
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
@@ -8,9 +8,11 @@
|
||||
-- @image MOOSE.JPG
|
||||
|
||||
do -- ACT_ACCOUNT
|
||||
|
||||
|
||||
--- # @{#ACT_ACCOUNT} FSM class, extends @{Core.Fsm#FSM_PROCESS}
|
||||
--
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- ## ACT_ACCOUNT state machine:
|
||||
--
|
||||
-- This class is a state machine: it manages a process that is triggered by events causing state transitions to occur.
|
||||
@@ -133,7 +135,7 @@ do -- ACT_ACCOUNT
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
function ACT_ACCOUNT:onafterEvent( ProcessUnit, From, Event, To, Event )
|
||||
function ACT_ACCOUNT:onafterEvent( ProcessUnit, From, Event, To )
|
||||
|
||||
self:__NoMore( 1 )
|
||||
end
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
--- (SP) (MP) (FSM) Accept or reject process for player (task) assignments.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # @{#ACT_ASSIGN} FSM template class, extends @{Core.Fsm#FSM_PROCESS}
|
||||
--
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
--- (SP) (MP) (FSM) Route AI or players through waypoints or to zones.
|
||||
--
|
||||
-- 
|
||||
-- ## ACT_ASSIST state machine:
|
||||
--
|
||||
-- This class is a state machine: it manages a process that is triggered by events causing state transitions to occur.
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # @{#ACT_ROUTE} FSM class, extends @{Core.Fsm#FSM_PROCESS}
|
||||
--
|
||||
-- ## ACT_ROUTE state machine:
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # 1) MOOSE Cargo System.
|
||||
--
|
||||
-- #### Those who have used the mission editor, know that the DCS mission editor provides cargo facilities.
|
||||
@@ -275,14 +277,14 @@
|
||||
-- The cargo must be in the **Loaded** state.
|
||||
-- @function [parent=#CARGO] UnBoard
|
||||
-- @param #CARGO self
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2 (optional) @{Core.Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
|
||||
-- @param Core.Point#COORDINATE ToPointVec2 (optional) @{Core.Point#COORDINATE) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
|
||||
|
||||
--- UnBoards the cargo to a Carrier. The event will create a movement (= running or driving) of the cargo from the Carrier.
|
||||
-- The cargo must be in the **Loaded** state.
|
||||
-- @function [parent=#CARGO] __UnBoard
|
||||
-- @param #CARGO self
|
||||
-- @param #number DelaySeconds The amount of seconds to delay the action.
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2 (optional) @{Core.Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
|
||||
-- @param Core.Point#COORDINATE ToPointVec2 (optional) @{Core.Point#COORDINATE) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.
|
||||
|
||||
|
||||
-- Load
|
||||
@@ -307,14 +309,14 @@
|
||||
-- The cargo must be in the **Loaded** state.
|
||||
-- @function [parent=#CARGO] UnLoad
|
||||
-- @param #CARGO self
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2 (optional) @{Core.Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
|
||||
-- @param Core.Point#COORDINATE ToPointVec2 (optional) @{Core.Point#COORDINATE) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
|
||||
|
||||
--- UnLoads the cargo to a Carrier. The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading.
|
||||
-- The cargo must be in the **Loaded** state.
|
||||
-- @function [parent=#CARGO] __UnLoad
|
||||
-- @param #CARGO self
|
||||
-- @param #number DelaySeconds The amount of seconds to delay the action.
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2 (optional) @{Core.Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
|
||||
-- @param Core.Point#COORDINATE ToPointVec2 (optional) @{Core.Point#COORDINATE) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.
|
||||
|
||||
-- State Transition Functions
|
||||
|
||||
@@ -467,7 +469,7 @@ do -- CARGO
|
||||
self.Type = Type
|
||||
self.Name = Name
|
||||
self.Weight = Weight or 0
|
||||
self.CargoObject = nil
|
||||
self.CargoObject = nil -- Wrapper.Group#GROUP
|
||||
self.CargoCarrier = nil -- Wrapper.Client#CLIENT
|
||||
self.Representable = false
|
||||
self.Slingloadable = false
|
||||
@@ -897,7 +899,7 @@ do -- CARGO
|
||||
|
||||
--- Get the current PointVec2 of the cargo.
|
||||
-- @param #CARGO self
|
||||
-- @return Core.Point#POINT_VEC2
|
||||
-- @return Core.Point#COORDINATE
|
||||
function CARGO:GetPointVec2()
|
||||
return self.CargoObject:GetPointVec2()
|
||||
end
|
||||
@@ -1094,7 +1096,7 @@ do -- CARGO_REPRESENTABLE
|
||||
|
||||
--- Route a cargo unit to a PointVec2.
|
||||
-- @param #CARGO_REPRESENTABLE self
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number Speed
|
||||
-- @return #CARGO_REPRESENTABLE
|
||||
function CARGO_REPRESENTABLE:RouteTo( ToPointVec2, Speed )
|
||||
|
||||
@@ -22,6 +22,9 @@ do -- CARGO_CRATE
|
||||
-- @type CARGO_CRATE
|
||||
-- @extends Cargo.Cargo#CARGO_REPRESENTABLE
|
||||
|
||||
---
|
||||
-- 
|
||||
--
|
||||
--- Defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier.
|
||||
-- Use the event functions as described above to Load, UnLoad, Board, UnBoard the CARGO\_CRATE objects to and from carriers.
|
||||
--
|
||||
@@ -114,7 +117,7 @@ do -- CARGO_CRATE
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#POINT_VEC2
|
||||
-- @param Core.Point#COORDINATE
|
||||
function CARGO_CRATE:onenterUnLoaded( From, Event, To, ToPointVec2 )
|
||||
--self:T( { ToPointVec2, From, Event, To } )
|
||||
|
||||
|
||||
@@ -22,9 +22,12 @@ do -- CARGO_GROUP
|
||||
--- @type CARGO_GROUP
|
||||
-- @field Core.Set#SET_CARGO CargoSet The collection of derived CARGO objects.
|
||||
-- @field #string GroupName The name of the CargoGroup.
|
||||
-- @field Wrapper.Group#GROUÜ CargoCarrier The carrier group.
|
||||
-- @extends Cargo.Cargo#CARGO_REPORTABLE
|
||||
|
||||
--- Defines a cargo that is represented by a @{Wrapper.Group} object within the simulator.
|
||||
--
|
||||
-- 
|
||||
-- The cargo can be Loaded, UnLoaded, Boarded, UnBoarded to and from Carriers.
|
||||
--
|
||||
-- The above cargo classes are used by the following AI_CARGO_ classes to allow AI groups to transport cargo:
|
||||
@@ -410,7 +413,7 @@ do -- CARGO_GROUP
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier.
|
||||
function CARGO_GROUP:onafterUnBoard( From, Event, To, ToPointVec2, NearRadius, ... )
|
||||
self:T( {From, Event, To, ToPointVec2, NearRadius } )
|
||||
@@ -453,7 +456,7 @@ do -- CARGO_GROUP
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier.
|
||||
function CARGO_GROUP:onafterUnBoarding( From, Event, To, ToPointVec2, NearRadius, ... )
|
||||
--self:T( { From, Event, To, ToPointVec2, NearRadius } )
|
||||
@@ -491,7 +494,7 @@ do -- CARGO_GROUP
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
function CARGO_GROUP:onafterUnLoad( From, Event, To, ToPointVec2, ... )
|
||||
--self:T( { From, Event, To, ToPointVec2 } )
|
||||
|
||||
@@ -771,3 +774,4 @@ do -- CARGO_GROUP
|
||||
|
||||
|
||||
end -- CARGO_GROUP
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ do -- CARGO_SLINGLOAD
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
||||
-- Therefore, this class is considered to be deprecated
|
||||
--
|
||||
|
||||
@@ -30,6 +30,8 @@ do -- CARGO_UNIT
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
||||
-- Therefore, this class is considered to be deprecated
|
||||
--
|
||||
@@ -72,7 +74,7 @@ do -- CARGO_UNIT
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number NearRadius (optional) Defaut 25 m.
|
||||
function CARGO_UNIT:onenterUnBoarding( From, Event, To, ToPointVec2, NearRadius )
|
||||
self:T( { From, Event, To, ToPointVec2, NearRadius } )
|
||||
@@ -145,7 +147,7 @@ do -- CARGO_UNIT
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number NearRadius (optional) Defaut 100 m.
|
||||
function CARGO_UNIT:onleaveUnBoarding( From, Event, To, ToPointVec2, NearRadius )
|
||||
self:T( { From, Event, To, ToPointVec2, NearRadius } )
|
||||
@@ -171,7 +173,7 @@ do -- CARGO_UNIT
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#POINT_VEC2 ToPointVec2
|
||||
-- @param Core.Point#COORDINATE ToPointVec2
|
||||
-- @param #number NearRadius (optional) Defaut 100 m.
|
||||
function CARGO_UNIT:onafterUnBoarding( From, Event, To, ToPointVec2, NearRadius )
|
||||
self:T( { From, Event, To, ToPointVec2, NearRadius } )
|
||||
@@ -197,7 +199,7 @@ do -- CARGO_UNIT
|
||||
-- @param #string Event
|
||||
-- @param #string From
|
||||
-- @param #string To
|
||||
-- @param Core.Point#POINT_VEC2
|
||||
-- @param Core.Point#COORDINATE
|
||||
function CARGO_UNIT:onenterUnLoaded( From, Event, To, ToPointVec2 )
|
||||
self:T( { ToPointVec2, From, Event, To } )
|
||||
|
||||
|
||||
@@ -974,7 +974,7 @@ do -- Scheduling
|
||||
-- @param #BASE self
|
||||
-- @param #number Start Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.
|
||||
-- @param #function SchedulerFunction The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.
|
||||
-- @param #table ... Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.
|
||||
-- @param ... Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.
|
||||
-- @return #string The Schedule ID of the planned schedule.
|
||||
function BASE:ScheduleOnce( Start, SchedulerFunction, ... )
|
||||
|
||||
|
||||
@@ -872,6 +872,8 @@ end
|
||||
-- @return Wrapper.Group#GROUP The found GROUP.
|
||||
function DATABASE:FindGroup( GroupName )
|
||||
|
||||
if type(GroupName) ~= "string" or GroupName == "" then return end
|
||||
|
||||
local GroupFound = self.GROUPS[GroupName]
|
||||
|
||||
if GroupFound == nil and GroupName ~= nil and self.Templates.Groups[GroupName] == nil then
|
||||
|
||||
@@ -1372,11 +1372,12 @@ function EVENT:onEvent( Event )
|
||||
-- Scenery
|
||||
---
|
||||
Event.IniDCSUnit = Event.initiator
|
||||
Event.IniDCSUnitName = Event.IniDCSUnit.getName and Event.IniDCSUnit:getName() or "Scenery no name "..math.random(1,20000)
|
||||
Event.IniDCSUnitName = ( Event.IniDCSUnit and Event.IniDCSUnit.getName ) and Event.IniDCSUnit:getName() or "Scenery no name "..math.random(1,20000)
|
||||
Event.IniUnitName = Event.IniDCSUnitName
|
||||
Event.IniUnit = SCENERY:Register( Event.IniDCSUnitName, Event.initiator )
|
||||
Event.IniCategory = Event.IniDCSUnit.getDesc and Event.IniDCSUnit:getDesc().category
|
||||
Event.IniTypeName = Event.initiator:isExist() and Event.IniDCSUnit:getTypeName() or "SCENERY"
|
||||
Event.IniCategory = (Event.IniDCSUnit and Event.IniDCSUnit.getDesc ) and Event.IniDCSUnit:getDesc().category
|
||||
Event.IniTypeName = (Event.initiator and Event.initiator.isExist
|
||||
and Event.initiator:isExist() and Event.IniDCSUnit and Event.IniDCSUnit.getTypeName) and Event.IniDCSUnit:getTypeName() or "SCENERY"
|
||||
|
||||
elseif Event.IniObjectCategory == Object.Category.BASE then
|
||||
---
|
||||
|
||||
@@ -206,7 +206,7 @@ end
|
||||
function MESSAGE:ToGroup( Group, Settings )
|
||||
self:F( Group.GroupName )
|
||||
|
||||
if Group then
|
||||
if Group and Group:IsAlive() then
|
||||
|
||||
if self.MessageType then
|
||||
local Settings = Settings or (Group and _DATABASE:GetPlayerSettings( Group:GetPlayerName() )) or _SETTINGS -- Core.Settings#SETTINGS
|
||||
@@ -231,7 +231,7 @@ end
|
||||
function MESSAGE:ToUnit( Unit, Settings )
|
||||
self:F( Unit.IdentifiableName )
|
||||
|
||||
if Unit then
|
||||
if Unit and Unit:IsAlive() then
|
||||
|
||||
if self.MessageType then
|
||||
local Settings = Settings or ( Unit and _DATABASE:GetPlayerSettings( Unit:GetPlayerName() ) ) or _SETTINGS -- Core.Settings#SETTINGS
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
do -- COORDINATE
|
||||
|
||||
---
|
||||
--- Coordinate class
|
||||
-- @type COORDINATE
|
||||
-- @field #string ClassName Name of the class
|
||||
-- @field #number x Component of the 3D vector.
|
||||
@@ -1157,6 +1157,162 @@ do -- COORDINATE
|
||||
return vec3
|
||||
end
|
||||
|
||||
--- Return the x coordinate of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @return #number The x coordinate.
|
||||
function COORDINATE:GetX()
|
||||
return self.x
|
||||
end
|
||||
|
||||
--- Return the y coordinate of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @return #number The y coordinate.
|
||||
function COORDINATE:GetY()
|
||||
if self:IsInstanceOf("POINT_VEC2") then
|
||||
return self.z
|
||||
end
|
||||
return self.y
|
||||
end
|
||||
|
||||
--- Return the z coordinate of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @return #number The z coordinate.
|
||||
function COORDINATE:GetZ()
|
||||
return self.z
|
||||
end
|
||||
|
||||
--- Set the x coordinate of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number x The x coordinate.
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:SetX( x )
|
||||
self.x = x
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set the y coordinate of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number y The y coordinate.
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:SetY( y )
|
||||
if self:IsInstanceOf("POINT_VEC2") then
|
||||
self.z = y
|
||||
else
|
||||
self.y = y
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set the z coordinate of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number z The z coordinate.
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:SetZ( z )
|
||||
self.z = z
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add to the x coordinate of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number x The x coordinate value to add to the current x coordinate.
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:AddX( x )
|
||||
self.x = self.x + x
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Return Return the Lat(itude) coordinate of the COORDINATE (ie: (parent)COORDINATE.x).
|
||||
-- @param #COORDINATE self
|
||||
-- @return #number The x coordinate.
|
||||
function COORDINATE:GetLat()
|
||||
return self.x
|
||||
end
|
||||
|
||||
--- Set the Lat(itude) coordinate of the COORDINATE (ie: COORDINATE.x).
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number x The x coordinate.
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:SetLat( x )
|
||||
self.x = x
|
||||
return self
|
||||
end
|
||||
|
||||
--- Return the Lon(gitude) coordinate of the COORDINATE (ie: (parent)COORDINATE.z).
|
||||
-- @param #COORDINATE self
|
||||
-- @return #number The y coordinate.
|
||||
function COORDINATE:GetLon()
|
||||
return self.z
|
||||
end
|
||||
|
||||
--- Set the Lon(gitude) coordinate of the COORDINATE (ie: COORDINATE.z).
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number y The y coordinate.
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:SetLon( z )
|
||||
self.z = z
|
||||
return self
|
||||
end
|
||||
|
||||
--- Return the altitude (height) of the land at the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @return #number The land altitude.
|
||||
function COORDINATE:GetAlt()
|
||||
return self.y ~= 0 or land.getHeight( { x = self.x, y = self.z } )
|
||||
end
|
||||
|
||||
--- Set the altitude of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number Altitude The land altitude. If nothing (nil) is given, then the current land altitude is set.
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:SetAlt( Altitude )
|
||||
self.y = Altitude or land.getHeight( { x = self.x, y = self.z } )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add to the current land height an altitude.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number Altitude The Altitude to add. If nothing (nil) is given, then the current land altitude is set.
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:AddAlt( Altitude )
|
||||
self.y = land.getHeight( { x = self.x, y = self.z } ) + Altitude or 0
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Return a random COORDINATE within an Outer Radius and optionally NOT within an Inner Radius of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param DCS#Distance OuterRadius
|
||||
-- @param DCS#Distance InnerRadius
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:GetRandomPointVec2InRadius( OuterRadius, InnerRadius )
|
||||
self:F2( { OuterRadius, InnerRadius } )
|
||||
|
||||
return COORDINATE:NewFromVec2( self:GetRandomVec2InRadius( OuterRadius, InnerRadius ) )
|
||||
end
|
||||
|
||||
--- Add to the y coordinate of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number y The y coordinate value to add to the current y coordinate.
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:AddY( y )
|
||||
if self:IsInstanceOf("POINT_VEC2") then
|
||||
return self:AddZ(y)
|
||||
else
|
||||
self.y = self.y + y
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add to the z coordinate of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number z The z coordinate value to add to the current z coordinate.
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:AddZ( z )
|
||||
self.z = self.z +z
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Returns a text documenting the wind direction (from) and strength according the measurement system @{Core.Settings}.
|
||||
-- The text will reflect the wind like this:
|
||||
@@ -1962,14 +2118,35 @@ do -- COORDINATE
|
||||
end
|
||||
|
||||
|
||||
--- Smokes the point in a color.
|
||||
--- Create colored smoke the point. The smoke we last up to 5 min (DCS limitation) but you can optionally specify a shorter duration or stop it manually.
|
||||
-- @param #COORDINATE self
|
||||
-- @param Utilities.Utils#SMOKECOLOR SmokeColor
|
||||
-- @param #string name (Optional) Name if you want to stop the smoke early (normal duration: 5mins)
|
||||
function COORDINATE:Smoke( SmokeColor, name )
|
||||
self:F2( { SmokeColor } )
|
||||
self.firename = name or "Smoke-"..math.random(1,100000)
|
||||
trigger.action.smoke( self:GetVec3(), SmokeColor, self.firename )
|
||||
-- @param #number SmokeColor Color of smoke, e.g. `SMOKECOLOR.Green` for green smoke.
|
||||
-- @param #number Duration (Optional) Duration of the smoke in seconds. DCS stopps the smoke automatically after 5 min.
|
||||
-- @param #number Delay (Optional) Delay before the smoke is started in seconds.
|
||||
-- @param #string Name (Optional) Name if you want to stop the smoke early (normal duration: 5mins)
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:Smoke( SmokeColor, Duration, Delay, Name)
|
||||
self:F2( { SmokeColor, Name, Duration, Delay } )
|
||||
|
||||
SmokeColor=SmokeColor or SMOKECOLOR.Green
|
||||
|
||||
if Delay and Delay>0 then
|
||||
self:ScheduleOnce(Delay, COORDINATE.Smoke, self, SmokeColor, Duration, 0, Name)
|
||||
else
|
||||
|
||||
-- Create a name which is used to stop the smoke manually
|
||||
self.firename = Name or "Smoke-"..math.random(1,100000)
|
||||
|
||||
-- Create smoke
|
||||
trigger.action.smoke( self:GetVec3(), SmokeColor, self.firename )
|
||||
|
||||
-- Stop smoke
|
||||
if Duration and Duration>0 then
|
||||
self:ScheduleOnce(Duration, COORDINATE.StopSmoke, self, self.firename )
|
||||
end
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Stops smoking the point in a color.
|
||||
@@ -1981,49 +2158,83 @@ do -- COORDINATE
|
||||
|
||||
--- Smoke the COORDINATE Green.
|
||||
-- @param #COORDINATE self
|
||||
function COORDINATE:SmokeGreen()
|
||||
self:F2()
|
||||
self:Smoke( SMOKECOLOR.Green )
|
||||
-- @param #number Duration (Optional) Duration of the smoke in seconds. DCS stopps the smoke automatically after 5 min.
|
||||
-- @param #number Delay (Optional) Delay before the smoke is started in seconds.
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:SmokeGreen(Duration, Delay)
|
||||
self:Smoke( SMOKECOLOR.Green, Duration, Delay )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Smoke the COORDINATE Red.
|
||||
-- @param #COORDINATE self
|
||||
function COORDINATE:SmokeRed()
|
||||
self:F2()
|
||||
self:Smoke( SMOKECOLOR.Red )
|
||||
-- @param #number Duration (Optional) Duration of the smoke in seconds. DCS stopps the smoke automatically after 5 min.
|
||||
-- @param #number Delay (Optional) Delay before the smoke is started in seconds.
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:SmokeRed(Duration, Delay)
|
||||
self:Smoke( SMOKECOLOR.Red, Duration, Delay )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Smoke the COORDINATE White.
|
||||
-- @param #COORDINATE self
|
||||
function COORDINATE:SmokeWhite()
|
||||
self:F2()
|
||||
self:Smoke( SMOKECOLOR.White )
|
||||
-- @param #number Duration (Optional) Duration of the smoke in seconds. DCS stopps the smoke automatically after 5 min.
|
||||
-- @param #number Delay (Optional) Delay before the smoke is started in seconds.
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:SmokeWhite(Duration, Delay)
|
||||
self:Smoke( SMOKECOLOR.White, Duration, Delay )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Smoke the COORDINATE Orange.
|
||||
-- @param #COORDINATE self
|
||||
function COORDINATE:SmokeOrange()
|
||||
self:F2()
|
||||
self:Smoke( SMOKECOLOR.Orange )
|
||||
-- @param #number Duration (Optional) Duration of the smoke in seconds. DCS stopps the smoke automatically after 5 min.
|
||||
-- @param #number Delay (Optional) Delay before the smoke is started in seconds.
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:SmokeOrange(Duration, Delay)
|
||||
self:Smoke( SMOKECOLOR.Orange, Duration, Delay )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Smoke the COORDINATE Blue.
|
||||
-- @param #COORDINATE self
|
||||
function COORDINATE:SmokeBlue()
|
||||
self:F2()
|
||||
self:Smoke( SMOKECOLOR.Blue )
|
||||
-- @param #number Duration (Optional) Duration of the smoke in seconds. DCS stopps the smoke automatically after 5 min.
|
||||
-- @param #number Delay (Optional) Delay before the smoke is started in seconds.
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:SmokeBlue(Duration, Delay)
|
||||
self:Smoke( SMOKECOLOR.Blue, Duration, Delay )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Big smoke and fire at the coordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param Utilities.Utils#BIGSMOKEPRESET preset Smoke preset (1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke).
|
||||
-- @param #number density (Optional) Smoke density. Number in [0,...,1]. Default 0.5.
|
||||
-- @param #string name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
function COORDINATE:BigSmokeAndFire( preset, density, name )
|
||||
self:F2( { preset=preset, density=density } )
|
||||
density=density or 0.5
|
||||
self.firename = name or "Fire-"..math.random(1,10000)
|
||||
trigger.action.effectSmokeBig( self:GetVec3(), preset, density, self.firename )
|
||||
-- @param #number Preset Smoke preset (1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke).
|
||||
-- @param #number Density (Optional) Smoke density. Number in [0,...,1]. Default 0.5.
|
||||
-- @param #number Duration (Optional) Duration of the smoke and fire in seconds.
|
||||
-- @param #number Delay (Optional) Delay before the smoke and fire is started in seconds.
|
||||
-- @param #string Name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:BigSmokeAndFire( Preset, Density, Duration, Delay, Name )
|
||||
self:F2( { preset=Preset, density=Density } )
|
||||
|
||||
Preset=Preset or BIGSMOKEPRESET.SmallSmokeAndFire
|
||||
Density=Density or 0.5
|
||||
|
||||
if Delay and Delay>0 then
|
||||
self:ScheduleOnce(Delay, COORDINATE.BigSmokeAndFire, self, Preset, Density, Duration, 0, Name)
|
||||
else
|
||||
|
||||
self.firename = Name or "Fire-"..math.random(1,10000)
|
||||
|
||||
trigger.action.effectSmokeBig( self:GetVec3(), Preset, Density, self.firename )
|
||||
|
||||
-- Stop smoke
|
||||
if Duration and Duration>0 then
|
||||
self:ScheduleOnce(Duration, COORDINATE.StopBigSmokeAndFire, self, self.firename )
|
||||
end
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Stop big smoke and fire at the coordinate.
|
||||
@@ -2036,82 +2247,98 @@ do -- COORDINATE
|
||||
|
||||
--- Small smoke and fire at the coordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number density (Optional) Smoke density. Number between 0 and 1. Default 0.5.
|
||||
-- @param #string name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
function COORDINATE:BigSmokeAndFireSmall( density, name )
|
||||
self:F2( { density=density } )
|
||||
density=density or 0.5
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.SmallSmokeAndFire, density, name)
|
||||
-- @param #number Density (Optional) Smoke density. Number between 0 and 1. Default 0.5.
|
||||
-- @param #number Duration (Optional) Duration of the smoke and fire in seconds.
|
||||
-- @param #number Delay (Optional) Delay before the smoke and fire is started in seconds.
|
||||
-- @param #string Name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:BigSmokeAndFireSmall( Density, Duration, Delay, Name )
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.SmallSmokeAndFire, Density, Duration, Delay, Name)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Medium smoke and fire at the coordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number density (Optional) Smoke density. Number between 0 and 1. Default 0.5.
|
||||
-- @param #number Duration (Optional) Duration of the smoke and fire in seconds.
|
||||
-- @param #number Delay (Optional) Delay before the smoke and fire is started in seconds.
|
||||
-- @param #string name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
function COORDINATE:BigSmokeAndFireMedium( density, name )
|
||||
self:F2( { density=density } )
|
||||
density=density or 0.5
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.MediumSmokeAndFire, density, name)
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:BigSmokeAndFireMedium( Density, Duration, Delay, Name )
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.MediumSmokeAndFire, Density, Duration, Delay, Name)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Large smoke and fire at the coordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number density (Optional) Smoke density. Number between 0 and 1. Default 0.5.
|
||||
-- @param #number Duration (Optional) Duration of the smoke and fire in seconds.
|
||||
-- @param #number Delay (Optional) Delay before the smoke and fire is started in seconds.
|
||||
-- @param #string name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
function COORDINATE:BigSmokeAndFireLarge( density, name )
|
||||
self:F2( { density=density } )
|
||||
density=density or 0.5
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.LargeSmokeAndFire, density, name)
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:BigSmokeAndFireLarge( Density, Duration, Delay, Name )
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.LargeSmokeAndFire, Density, Duration, Delay, Name)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Huge smoke and fire at the coordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number density (Optional) Smoke density. Number between 0 and 1. Default 0.5.
|
||||
-- @param #number Duration (Optional) Duration of the smoke and fire in seconds.
|
||||
-- @param #number Delay (Optional) Delay before the smoke and fire is started in seconds.
|
||||
-- @param #string name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
function COORDINATE:BigSmokeAndFireHuge( density, name )
|
||||
self:F2( { density=density } )
|
||||
density=density or 0.5
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.HugeSmokeAndFire, density, name)
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:BigSmokeAndFireHuge( Density, Duration, Delay, Name )
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.HugeSmokeAndFire, Density, Duration, Delay, Name)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Small smoke at the coordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number density (Optional) Smoke density. Number between 0 and 1. Default 0.5.
|
||||
-- @param #number Duration (Optional) Duration of the smoke and fire in seconds.
|
||||
-- @param #number Delay (Optional) Delay before the smoke and fire is started in seconds.
|
||||
-- @param #string name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
function COORDINATE:BigSmokeSmall( density, name )
|
||||
self:F2( { density=density } )
|
||||
density=density or 0.5
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.SmallSmoke, density, name)
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:BigSmokeSmall( Density, Duration, Delay, Name )
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.SmallSmoke, Density, Duration, Delay, Name)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Medium smoke at the coordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param number density (Optional) Smoke density. Number between 0 and 1. Default 0.5.
|
||||
-- @param #number Duration (Optional) Duration of the smoke and fire in seconds.
|
||||
-- @param #number Delay (Optional) Delay before the smoke and fire is started in seconds.
|
||||
-- @param #string name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
function COORDINATE:BigSmokeMedium( density, name )
|
||||
self:F2( { density=density } )
|
||||
density=density or 0.5
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.MediumSmoke, density, name)
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:BigSmokeMedium( Density, Duration, Delay, Name )
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.MediumSmoke, Density, Duration, Delay, Name)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Large smoke at the coordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number density (Optional) Smoke density. Number between 0 and 1. Default 0.5.
|
||||
-- @param #number Duration (Optional) Duration of the smoke and fire in seconds.
|
||||
-- @param #number Delay (Optional) Delay before the smoke and fire is started in seconds.
|
||||
-- @param #string name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
function COORDINATE:BigSmokeLarge( density, name )
|
||||
self:F2( { density=density } )
|
||||
density=density or 0.5
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.LargeSmoke, density,name)
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:BigSmokeLarge( Density, Duration, Delay, Name )
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.LargeSmoke, Density, Duration, Delay, Name)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Huge smoke at the coordinate.
|
||||
-- @param #COORDINATE self
|
||||
-- @param #number density (Optional) Smoke density. Number between 0 and 1. Default 0.5.
|
||||
-- @param #number Duration (Optional) Duration of the smoke and fire in seconds.
|
||||
-- @param #number Delay (Optional) Delay before the smoke and fire is started in seconds.
|
||||
-- @param #string name (Optional) Name of the fire to stop it later again if not using the same COORDINATE object. Defaults to "Fire-" plus a random 5-digit-number.
|
||||
function COORDINATE:BigSmokeHuge( density, name )
|
||||
self:F2( { density=density } )
|
||||
density=density or 0.5
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.HugeSmoke, density,name)
|
||||
-- @return #COORDINATE self
|
||||
function COORDINATE:BigSmokeHuge( Density, Duration, Delay, Name )
|
||||
self:BigSmokeAndFire(BIGSMOKEPRESET.HugeSmoke, Density, Duration, Delay, Name)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Flares the point in a color.
|
||||
@@ -2765,8 +2992,10 @@ do -- COORDINATE
|
||||
local sunrise=UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, true, Tdiff)
|
||||
local sunset=UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, false, Tdiff)
|
||||
|
||||
if sunrise == "N/R" then return false end
|
||||
if sunrise == "N/S" then return true end
|
||||
if type(sunrise) == "string" or type(sunset) == "string" then
|
||||
if sunrise == "N/R" then return false end
|
||||
if sunset == "N/S" then return true end
|
||||
end
|
||||
|
||||
local time=UTILS.ClockToSeconds(clock)
|
||||
|
||||
@@ -2784,6 +3013,11 @@ do -- COORDINATE
|
||||
|
||||
-- Todays sun set in sec.
|
||||
local sunset=self:GetSunset(true)
|
||||
|
||||
if type(sunrise) == "string" or type(sunset) == "string" then
|
||||
if sunrise == "N/R" then return false end
|
||||
if sunset == "N/S" then return true end
|
||||
end
|
||||
|
||||
-- Seconds passed since midnight.
|
||||
local time=UTILS.SecondsOfToday()
|
||||
@@ -3474,9 +3708,18 @@ do -- COORDINATE
|
||||
return flat, elev
|
||||
end
|
||||
|
||||
--- Return a random COORDINATE within an Outer Radius and optionally NOT within an Inner Radius of the COORDINATE.
|
||||
-- @param #COORDINATE self
|
||||
-- @param DCS#Distance OuterRadius
|
||||
-- @param DCS#Distance InnerRadius
|
||||
-- @return #COORDINATE
|
||||
function COORDINATE:GetRandomPointVec3InRadius( OuterRadius, InnerRadius )
|
||||
return COORDINATE:NewFromVec3( self:GetRandomVec3InRadius( OuterRadius, InnerRadius ) )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
do -- POINT_VEC3
|
||||
do
|
||||
|
||||
--- The POINT_VEC3 class
|
||||
-- @type POINT_VEC3
|
||||
@@ -3493,6 +3736,8 @@ do -- POINT_VEC3
|
||||
|
||||
--- Defines a 3D point in the simulator and with its methods, you can use or manipulate the point in 3D space.
|
||||
--
|
||||
-- **DEPRECATED - PLEASE USE COORDINATE!**
|
||||
--
|
||||
-- **Important Note:** Most of the functions in this section were taken from MIST, and reworked to OO concepts.
|
||||
-- In order to keep the credibility of the the author,
|
||||
-- I want to emphasize that the formulas embedded in the MIST framework were created by Grimes or previous authors,
|
||||
@@ -3580,130 +3825,19 @@ do -- POINT_VEC3
|
||||
return self
|
||||
end
|
||||
|
||||
--- Create a new POINT_VEC3 object from Vec2 coordinates.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCS#Vec2 Vec2 The Vec2 point.
|
||||
-- @param DCS#Distance LandHeightAdd (optional) Add a landheight.
|
||||
-- @return Core.Point#POINT_VEC3 self
|
||||
function POINT_VEC3:NewFromVec2( Vec2, LandHeightAdd )
|
||||
|
||||
local self = BASE:Inherit( self, COORDINATE:NewFromVec2( Vec2, LandHeightAdd ) ) -- Core.Point#POINT_VEC3
|
||||
self:F2( self )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Create a new POINT_VEC3 object from Vec3 coordinates.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCS#Vec3 Vec3 The Vec3 point.
|
||||
-- @return Core.Point#POINT_VEC3 self
|
||||
function POINT_VEC3:NewFromVec3( Vec3 )
|
||||
|
||||
local self = BASE:Inherit( self, COORDINATE:NewFromVec3( Vec3 ) ) -- Core.Point#POINT_VEC3
|
||||
self:F2( self )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Return the x coordinate of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @return #number The x coordinate.
|
||||
function POINT_VEC3:GetX()
|
||||
return self.x
|
||||
end
|
||||
|
||||
--- Return the y coordinate of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @return #number The y coordinate.
|
||||
function POINT_VEC3:GetY()
|
||||
return self.y
|
||||
end
|
||||
|
||||
--- Return the z coordinate of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @return #number The z coordinate.
|
||||
function POINT_VEC3:GetZ()
|
||||
return self.z
|
||||
end
|
||||
|
||||
--- Set the x coordinate of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param #number x The x coordinate.
|
||||
-- @return #POINT_VEC3
|
||||
function POINT_VEC3:SetX( x )
|
||||
self.x = x
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set the y coordinate of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param #number y The y coordinate.
|
||||
-- @return #POINT_VEC3
|
||||
function POINT_VEC3:SetY( y )
|
||||
self.y = y
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set the z coordinate of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param #number z The z coordinate.
|
||||
-- @return #POINT_VEC3
|
||||
function POINT_VEC3:SetZ( z )
|
||||
self.z = z
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add to the x coordinate of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param #number x The x coordinate value to add to the current x coordinate.
|
||||
-- @return #POINT_VEC3
|
||||
function POINT_VEC3:AddX( x )
|
||||
self.x = self.x + x
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add to the y coordinate of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param #number y The y coordinate value to add to the current y coordinate.
|
||||
-- @return #POINT_VEC3
|
||||
function POINT_VEC3:AddY( y )
|
||||
self.y = self.y + y
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add to the z coordinate of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param #number z The z coordinate value to add to the current z coordinate.
|
||||
-- @return #POINT_VEC3
|
||||
function POINT_VEC3:AddZ( z )
|
||||
self.z = self.z +z
|
||||
return self
|
||||
end
|
||||
|
||||
--- Return a random POINT_VEC3 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param DCS#Distance OuterRadius
|
||||
-- @param DCS#Distance InnerRadius
|
||||
-- @return #POINT_VEC3
|
||||
function POINT_VEC3:GetRandomPointVec3InRadius( OuterRadius, InnerRadius )
|
||||
|
||||
return POINT_VEC3:NewFromVec3( self:GetRandomVec3InRadius( OuterRadius, InnerRadius ) )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
do -- POINT_VEC2
|
||||
do
|
||||
|
||||
-- @type POINT_VEC2
|
||||
--- @type POINT_VEC2
|
||||
-- @field DCS#Distance x The x coordinate in meters.
|
||||
-- @field DCS#Distance y the y coordinate in meters.
|
||||
-- @extends Core.Point#COORDINATE
|
||||
|
||||
--- Defines a 2D point in the simulator. The height coordinate (if needed) will be the land height + an optional added height specified.
|
||||
--
|
||||
-- **DEPRECATED - PLEASE USE COORDINATE!**
|
||||
--
|
||||
-- ## POINT_VEC2 constructor
|
||||
--
|
||||
-- A new POINT_VEC2 instance can be created with:
|
||||
@@ -3751,166 +3885,4 @@ do -- POINT_VEC2
|
||||
return self
|
||||
end
|
||||
|
||||
--- Create a new POINT_VEC2 object from Vec2 coordinates.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param DCS#Vec2 Vec2 The Vec2 point.
|
||||
-- @return Core.Point#POINT_VEC2 self
|
||||
function POINT_VEC2:NewFromVec2( Vec2, LandHeightAdd )
|
||||
|
||||
local LandHeight = land.getHeight( Vec2 )
|
||||
|
||||
LandHeightAdd = LandHeightAdd or 0
|
||||
LandHeight = LandHeight + LandHeightAdd
|
||||
|
||||
local self = BASE:Inherit( self, COORDINATE:NewFromVec2( Vec2, LandHeightAdd ) ) -- #POINT_VEC2
|
||||
self:F2( self )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Create a new POINT_VEC2 object from Vec3 coordinates.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param DCS#Vec3 Vec3 The Vec3 point.
|
||||
-- @return Core.Point#POINT_VEC2 self
|
||||
function POINT_VEC2:NewFromVec3( Vec3 )
|
||||
|
||||
local self = BASE:Inherit( self, COORDINATE:NewFromVec3( Vec3 ) ) -- #POINT_VEC2
|
||||
self:F2( self )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Return the x coordinate of the POINT_VEC2.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @return #number The x coordinate.
|
||||
function POINT_VEC2:GetX()
|
||||
return self.x
|
||||
end
|
||||
|
||||
--- Return the y coordinate of the POINT_VEC2.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @return #number The y coordinate.
|
||||
function POINT_VEC2:GetY()
|
||||
return self.z
|
||||
end
|
||||
|
||||
--- Set the x coordinate of the POINT_VEC2.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #number x The x coordinate.
|
||||
-- @return #POINT_VEC2
|
||||
function POINT_VEC2:SetX( x )
|
||||
self.x = x
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set the y coordinate of the POINT_VEC2.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #number y The y coordinate.
|
||||
-- @return #POINT_VEC2
|
||||
function POINT_VEC2:SetY( y )
|
||||
self.z = y
|
||||
return self
|
||||
end
|
||||
|
||||
--- Return Return the Lat(itude) coordinate of the POINT_VEC2 (ie: (parent)POINT_VEC3.x).
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @return #number The x coordinate.
|
||||
function POINT_VEC2:GetLat()
|
||||
return self.x
|
||||
end
|
||||
|
||||
--- Set the Lat(itude) coordinate of the POINT_VEC2 (ie: POINT_VEC3.x).
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #number x The x coordinate.
|
||||
-- @return #POINT_VEC2
|
||||
function POINT_VEC2:SetLat( x )
|
||||
self.x = x
|
||||
return self
|
||||
end
|
||||
|
||||
--- Return the Lon(gitude) coordinate of the POINT_VEC2 (ie: (parent)POINT_VEC3.z).
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @return #number The y coordinate.
|
||||
function POINT_VEC2:GetLon()
|
||||
return self.z
|
||||
end
|
||||
|
||||
--- Set the Lon(gitude) coordinate of the POINT_VEC2 (ie: POINT_VEC3.z).
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #number y The y coordinate.
|
||||
-- @return #POINT_VEC2
|
||||
function POINT_VEC2:SetLon( z )
|
||||
self.z = z
|
||||
return self
|
||||
end
|
||||
|
||||
--- Return the altitude (height) of the land at the POINT_VEC2.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @return #number The land altitude.
|
||||
function POINT_VEC2:GetAlt()
|
||||
return self.y ~= 0 or land.getHeight( { x = self.x, y = self.z } )
|
||||
end
|
||||
|
||||
--- Set the altitude of the POINT_VEC2.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #number Altitude The land altitude. If nothing (nil) is given, then the current land altitude is set.
|
||||
-- @return #POINT_VEC2
|
||||
function POINT_VEC2:SetAlt( Altitude )
|
||||
self.y = Altitude or land.getHeight( { x = self.x, y = self.z } )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add to the x coordinate of the POINT_VEC2.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #number x The x coordinate.
|
||||
-- @return #POINT_VEC2
|
||||
function POINT_VEC2:AddX( x )
|
||||
self.x = self.x + x
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add to the y coordinate of the POINT_VEC2.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #number y The y coordinate.
|
||||
-- @return #POINT_VEC2
|
||||
function POINT_VEC2:AddY( y )
|
||||
self.z = self.z + y
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add to the current land height an altitude.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #number Altitude The Altitude to add. If nothing (nil) is given, then the current land altitude is set.
|
||||
-- @return #POINT_VEC2
|
||||
function POINT_VEC2:AddAlt( Altitude )
|
||||
self.y = land.getHeight( { x = self.x, y = self.z } ) + Altitude or 0
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- Return a random POINT_VEC2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC2.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param DCS#Distance OuterRadius
|
||||
-- @param DCS#Distance InnerRadius
|
||||
-- @return #POINT_VEC2
|
||||
function POINT_VEC2:GetRandomPointVec2InRadius( OuterRadius, InnerRadius )
|
||||
self:F2( { OuterRadius, InnerRadius } )
|
||||
|
||||
return POINT_VEC2:NewFromVec2( self:GetRandomVec2InRadius( OuterRadius, InnerRadius ) )
|
||||
end
|
||||
|
||||
-- TODO: Check this to replace
|
||||
--- Calculate the distance from a reference @{#POINT_VEC2}.
|
||||
-- @param #POINT_VEC2 self
|
||||
-- @param #POINT_VEC2 PointVec2Reference The reference @{#POINT_VEC2}.
|
||||
-- @return DCS#Distance The distance from the reference @{#POINT_VEC2} in meters.
|
||||
function POINT_VEC2:DistanceFromPointVec2( PointVec2Reference )
|
||||
self:F2( PointVec2Reference )
|
||||
|
||||
local Distance = ( ( PointVec2Reference.x - self.x ) ^ 2 + ( PointVec2Reference.z - self.z ) ^2 ) ^ 0.5
|
||||
|
||||
self:T2( Distance )
|
||||
return Distance
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -629,14 +629,14 @@ do -- SET_BASE
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the SET_BASE while identifying the nearest object in the set from a @{Core.Point#POINT_VEC2}.
|
||||
--- Iterate the SET_BASE while identifying the nearest object in the set from a @{Core.Point#COORDINATE}.
|
||||
-- @param #SET_BASE self
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Core.Point#COORDINATE} or @{Core.Point#POINT_VEC2} object (but **not** a simple DCS#Vec2!) from where to evaluate the closest object in the set.
|
||||
-- @param Core.Point#COORDINATE Coordinate A @{Core.Point#COORDINATE} object (but **not** a simple DCS#Vec2!) from where to evaluate the closest object in the set.
|
||||
-- @return Core.Base#BASE The closest object.
|
||||
-- @usage
|
||||
-- myset:FindNearestObjectFromPointVec2( ZONE:New("Test Zone"):GetCoordinate() )
|
||||
function SET_BASE:FindNearestObjectFromPointVec2( PointVec2 )
|
||||
--self:F2( PointVec2 )
|
||||
function SET_BASE:FindNearestObjectFromPointVec2( Coordinate )
|
||||
--self:F2( Coordinate )
|
||||
|
||||
local NearestObject = nil
|
||||
local ClosestDistance = nil
|
||||
@@ -644,9 +644,9 @@ do -- SET_BASE
|
||||
for ObjectID, ObjectData in pairs( self.Set ) do
|
||||
if NearestObject == nil then
|
||||
NearestObject = ObjectData
|
||||
ClosestDistance = PointVec2:DistanceFromPointVec2( ObjectData:GetCoordinate() )
|
||||
ClosestDistance = Coordinate:DistanceFromPointVec2( ObjectData:GetCoordinate() )
|
||||
else
|
||||
local Distance = PointVec2:DistanceFromPointVec2( ObjectData:GetCoordinate() )
|
||||
local Distance = Coordinate:DistanceFromPointVec2( ObjectData:GetCoordinate() )
|
||||
if Distance < ClosestDistance then
|
||||
NearestObject = ObjectData
|
||||
ClosestDistance = Distance
|
||||
@@ -1242,12 +1242,12 @@ do
|
||||
return GroupFound
|
||||
end
|
||||
|
||||
--- Iterate the SET_GROUP while identifying the nearest object from a @{Core.Point#POINT_VEC2}.
|
||||
--- Iterate the SET_GROUP while identifying the nearest object from a @{Core.Point#COORDINATE}.
|
||||
-- @param #SET_GROUP self
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Core.Point#POINT_VEC2} object from where to evaluate the closest object in the set.
|
||||
-- @param Core.Point#COORDINATE Coordinate A @{Core.Point#COORDINATE} object from where to evaluate the closest object in the set.
|
||||
-- @return Wrapper.Group#GROUP The closest group.
|
||||
function SET_GROUP:FindNearestGroupFromPointVec2( PointVec2 )
|
||||
--self:F2( PointVec2 )
|
||||
function SET_GROUP:FindNearestGroupFromPointVec2( Coordinate )
|
||||
--self:F2( Coordinate )
|
||||
|
||||
local NearestGroup = nil -- Wrapper.Group#GROUP
|
||||
local ClosestDistance = nil
|
||||
@@ -1257,9 +1257,9 @@ do
|
||||
for ObjectID, ObjectData in pairs( Set ) do
|
||||
if NearestGroup == nil then
|
||||
NearestGroup = ObjectData
|
||||
ClosestDistance = PointVec2:DistanceFromPointVec2( ObjectData:GetCoordinate() )
|
||||
ClosestDistance = Coordinate:DistanceFromPointVec2( ObjectData:GetCoordinate() )
|
||||
else
|
||||
local Distance = PointVec2:DistanceFromPointVec2( ObjectData:GetCoordinate() )
|
||||
local Distance = Coordinate:DistanceFromPointVec2( ObjectData:GetCoordinate() )
|
||||
if Distance < ClosestDistance then
|
||||
NearestGroup = ObjectData
|
||||
ClosestDistance = Distance
|
||||
@@ -2519,6 +2519,35 @@ do -- SET_UNIT
|
||||
)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Builds a set of units which belong to groups with certain **group names**.
|
||||
-- @param #SET_UNIT self
|
||||
-- @param #string Prefixes The (partial) group names to look for. Can be a single string or a table of strings.
|
||||
-- @return #SET_UNIT self
|
||||
function SET_UNIT:FilterGroupPrefixes(Prefixes)
|
||||
if type(Prefixes) == "string" then
|
||||
Prefixes = {Prefixes}
|
||||
end
|
||||
self:FilterFunction(
|
||||
function(unit,prefixes)
|
||||
local outcome = false
|
||||
if unit then
|
||||
local grp = unit:GetGroup()
|
||||
local gname = grp ~= nil and grp:GetName() or "none"
|
||||
for _,_fix in pairs(prefixes or {}) do
|
||||
if string.find(gname,_fix) then
|
||||
outcome = true
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
return outcome
|
||||
end, Prefixes
|
||||
)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Builds a set of units having a radar of give types.
|
||||
-- All the units having a radar of a given type will be included within the set.
|
||||
@@ -4434,6 +4463,35 @@ do -- SET_CLIENT
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Builds a set of clients which belong to groups with certain **group names**.
|
||||
-- @param #SET_CLIENT self
|
||||
-- @param #string Prefixes The (partial) group names to look for. Can be anywhere in the group name. Can be a single string or a table of strings.
|
||||
-- @return #SET_CLIENT self
|
||||
function SET_CLIENT:FilterGroupPrefixes(Prefixes)
|
||||
if type(Prefixes) == "string" then
|
||||
Prefixes = {Prefixes}
|
||||
end
|
||||
self:FilterFunction(
|
||||
function(unit,prefixes)
|
||||
local outcome = false
|
||||
if unit then
|
||||
local grp = unit:GetGroup()
|
||||
local gname = grp ~= nil and grp:GetName() or "none"
|
||||
for _,_fix in pairs(prefixes or {}) do
|
||||
if string.find(gname,_fix) then
|
||||
outcome = true
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
return outcome
|
||||
end, Prefixes
|
||||
)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Builds a set of clients that are only active.
|
||||
-- Only the clients that are active will be included within the set.
|
||||
@@ -5670,14 +5728,14 @@ do -- SET_AIRBASE
|
||||
return self
|
||||
end
|
||||
|
||||
--- Iterate the SET_AIRBASE while identifying the nearest @{Wrapper.Airbase#AIRBASE} from a @{Core.Point#POINT_VEC2}.
|
||||
--- Iterate the SET_AIRBASE while identifying the nearest @{Wrapper.Airbase#AIRBASE} from a @{Core.Point#COORDINATE}.
|
||||
-- @param #SET_AIRBASE self
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Core.Point#POINT_VEC2} object from where to evaluate the closest @{Wrapper.Airbase#AIRBASE}.
|
||||
-- @param Core.Point#COORDINATE Coordinate A @{Core.Point#COORDINATE} object from where to evaluate the closest @{Wrapper.Airbase#AIRBASE}.
|
||||
-- @return Wrapper.Airbase#AIRBASE The closest @{Wrapper.Airbase#AIRBASE}.
|
||||
function SET_AIRBASE:FindNearestAirbaseFromPointVec2( PointVec2 )
|
||||
--self:F2( PointVec2 )
|
||||
function SET_AIRBASE:FindNearestAirbaseFromPointVec2( Coordinate )
|
||||
--self:F2( Coordinate )
|
||||
|
||||
local NearestAirbase = self:FindNearestObjectFromPointVec2( PointVec2 )
|
||||
local NearestAirbase = self:FindNearestObjectFromPointVec2( Coordinate )
|
||||
return NearestAirbase
|
||||
end
|
||||
|
||||
@@ -6007,17 +6065,19 @@ do -- SET_CARGO
|
||||
return self
|
||||
end
|
||||
|
||||
--- (R2.1) Iterate the SET_CARGO while identifying the nearest @{Cargo.Cargo#CARGO} from a @{Core.Point#POINT_VEC2}.
|
||||
--- (R2.1) Iterate the SET_CARGO while identifying the nearest @{Cargo.Cargo#CARGO} from a @{Core.Point#COORDINATE}.
|
||||
-- @param #SET_CARGO self
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Core.Point#POINT_VEC2} object from where to evaluate the closest @{Cargo.Cargo#CARGO}.
|
||||
-- @param Core.Point#COORDINATE Coordinate A @{Core.Point#COORDINATE} object from where to evaluate the closest @{Cargo.Cargo#CARGO}.
|
||||
-- @return Cargo.Cargo#CARGO The closest @{Cargo.Cargo#CARGO}.
|
||||
function SET_CARGO:FindNearestCargoFromPointVec2( PointVec2 ) -- R2.1
|
||||
--self:F2( PointVec2 )
|
||||
function SET_CARGO:FindNearestCargoFromPointVec2( Coordinate ) -- R2.1
|
||||
--self:F2( Coordinate )
|
||||
|
||||
local NearestCargo = self:FindNearestObjectFromPointVec2( PointVec2 )
|
||||
local NearestCargo = self:FindNearestObjectFromPointVec2( Coordinate )
|
||||
return NearestCargo
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- @param #SET_CARGO self
|
||||
function SET_CARGO:FirstCargoWithState( State )
|
||||
|
||||
local FirstCargo = nil
|
||||
@@ -6032,6 +6092,8 @@ do -- SET_CARGO
|
||||
return FirstCargo
|
||||
end
|
||||
|
||||
---
|
||||
-- @param #SET_CARGO self
|
||||
function SET_CARGO:FirstCargoWithStateAndNotDeployed( State )
|
||||
|
||||
local FirstCargo = nil
|
||||
@@ -8693,7 +8755,6 @@ do -- SET_DYNAMICCARGO
|
||||
-- @field #SET_DYNAMICCARGO SET_DYNAMICCARGO
|
||||
SET_DYNAMICCARGO = {
|
||||
ClassName = "SET_DYNAMICCARGO",
|
||||
Filter = {},
|
||||
Set = {},
|
||||
List = {},
|
||||
Index = {},
|
||||
|
||||
@@ -1631,7 +1631,7 @@ function SPAWN:SpawnWithIndex( SpawnIndex, NoBirth )
|
||||
|
||||
if SpawnTemplate then
|
||||
|
||||
local PointVec3 = POINT_VEC3:New( SpawnTemplate.route.points[1].x, SpawnTemplate.route.points[1].alt, SpawnTemplate.route.points[1].y )
|
||||
local PointVec3 = COORDINATE:New( SpawnTemplate.route.points[1].x, SpawnTemplate.route.points[1].alt, SpawnTemplate.route.points[1].y )
|
||||
--self:T2( { "Current point of ", self.SpawnTemplatePrefix, PointVec3 } )
|
||||
|
||||
-- If RandomizePosition, then Randomize the formation in the zone band, keeping the template.
|
||||
@@ -2830,7 +2830,7 @@ end
|
||||
function SPAWN:SpawnFromVec3( Vec3, SpawnIndex )
|
||||
--self:F( { self.SpawnTemplatePrefix, Vec3, SpawnIndex } )
|
||||
|
||||
local PointVec3 = POINT_VEC3:NewFromVec3( Vec3 )
|
||||
local PointVec3 = COORDINATE:NewFromVec3( Vec3 )
|
||||
--self:T2( PointVec3 )
|
||||
|
||||
if SpawnIndex then
|
||||
@@ -2906,7 +2906,7 @@ end
|
||||
-- Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
|
||||
-- You can use the returned group to further define the route to be followed.
|
||||
-- @param #SPAWN self
|
||||
-- @param Core.Point#POINT_VEC3 PointVec3 The PointVec3 coordinates where to spawn the group.
|
||||
-- @param Core.Point#COORDINATE PointVec3 The COORDINATE coordinates where to spawn the group.
|
||||
-- @param #number SpawnIndex (optional) The index which group to spawn within the given zone.
|
||||
-- @return Wrapper.Group#GROUP that was spawned or #nil if nothing was spawned.
|
||||
-- @usage
|
||||
@@ -2954,12 +2954,12 @@ function SPAWN:SpawnFromVec2( Vec2, MinHeight, MaxHeight, SpawnIndex )
|
||||
return self:SpawnFromVec3( { x = Vec2.x, y = Height, z = Vec2.y }, SpawnIndex ) -- y can be nil. In this case, spawn on the ground for vehicles, and in the template altitude for air.
|
||||
end
|
||||
|
||||
--- Will spawn a group from a POINT_VEC2 in 3D space.
|
||||
--- Will spawn a group from a COORDINATE in 3D space.
|
||||
-- This method is mostly advisable to be used if you want to simulate spawning groups on the ground from air units, like vehicles.
|
||||
-- Note that each point in the route assigned to the spawning group is reset to the point of the spawn.
|
||||
-- You can use the returned group to further define the route to be followed.
|
||||
-- @param #SPAWN self
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 The PointVec2 coordinates where to spawn the group.
|
||||
-- @param Core.Point#COORDINATE PointVec2 The coordinates where to spawn the group.
|
||||
-- @param #number MinHeight (optional) The minimum height to spawn an airborne group into the zone.
|
||||
-- @param #number MaxHeight (optional) The maximum height to spawn an airborne group into the zone.
|
||||
-- @param #number SpawnIndex (optional) The index which group to spawn within the given zone.
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
--
|
||||
-- * @{#SPAWNSTATIC.Spawn}(Heading, NewName) spawns the static with the set parameters. Optionally, heading and name can be given. The name **must be unique**!
|
||||
-- * @{#SPAWNSTATIC.SpawnFromCoordinate}(Coordinate, Heading, NewName) spawn the static at the given coordinate. Optionally, heading and name can be given. The name **must be unique**!
|
||||
-- * @{#SPAWNSTATIC.SpawnFromPointVec2}(PointVec2, Heading, NewName) spawns the static at a POINT_VEC2 coordinate. Optionally, heading and name can be given. The name **must be unique**!
|
||||
-- * @{#SPAWNSTATIC.SpawnFromPointVec2}(PointVec2, Heading, NewName) spawns the static at a COORDINATE coordinate. Optionally, heading and name can be given. The name **must be unique**!
|
||||
-- * @{#SPAWNSTATIC.SpawnFromZone}(Zone, Heading, NewName) spawns the static at the center of a @{Core.Zone}. Optionally, heading and name can be given. The name **must be unique**!
|
||||
--
|
||||
-- @field #SPAWNSTATIC SPAWNSTATIC
|
||||
@@ -411,9 +411,9 @@ function SPAWNSTATIC:Spawn(Heading, NewName)
|
||||
|
||||
end
|
||||
|
||||
--- Creates a new @{Wrapper.Static} from a POINT_VEC2.
|
||||
--- Creates a new @{Wrapper.Static} from a COORDINATE.
|
||||
-- @param #SPAWNSTATIC self
|
||||
-- @param Core.Point#POINT_VEC2 PointVec2 The 2D coordinate where to spawn the static.
|
||||
-- @param Core.Point#COORDINATE PointVec2 The 2D coordinate where to spawn the static.
|
||||
-- @param #number Heading The heading of the static, which is a number in degrees from 0 to 360.
|
||||
-- @param #string NewName (Optional) The name of the new static.
|
||||
-- @return Wrapper.Static#STATIC The static spawned.
|
||||
|
||||
@@ -213,7 +213,7 @@ end
|
||||
|
||||
--- Returns if a PointVec3 is within the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param Core.Point#POINT_VEC3 PointVec3 The PointVec3 to test.
|
||||
-- @param Core.Point#COORDINATE PointVec3 The PointVec3 to test.
|
||||
-- @return #boolean true if the PointVec3 is within the zone.
|
||||
function ZONE_BASE:IsPointVec3InZone( PointVec3 )
|
||||
local InZone = self:IsPointVec2InZone( PointVec3 )
|
||||
@@ -227,16 +227,16 @@ function ZONE_BASE:GetVec2()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns a @{Core.Point#POINT_VEC2} of the zone.
|
||||
--- Returns a @{Core.Point#COORDINATE} of the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
||||
-- @return Core.Point#POINT_VEC2 The PointVec2 of the zone.
|
||||
-- @return Core.Point#COORDINATE The COORDINATE of the zone.
|
||||
function ZONE_BASE:GetPointVec2()
|
||||
--self:F2( self.ZoneName )
|
||||
|
||||
local Vec2 = self:GetVec2()
|
||||
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
local PointVec2 = COORDINATE:NewFromVec2( Vec2 )
|
||||
|
||||
--self:T2( { PointVec2 } )
|
||||
|
||||
@@ -261,16 +261,16 @@ function ZONE_BASE:GetVec3( Height )
|
||||
return Vec3
|
||||
end
|
||||
|
||||
--- Returns a @{Core.Point#POINT_VEC3} of the zone.
|
||||
--- Returns a @{Core.Point#COORDINATE} of the zone.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @param DCS#Distance Height The height to add to the land height where the center of the zone is located.
|
||||
-- @return Core.Point#POINT_VEC3 The PointVec3 of the zone.
|
||||
-- @return Core.Point#COORDINATE The PointVec3 of the zone.
|
||||
function ZONE_BASE:GetPointVec3( Height )
|
||||
--self:F2( self.ZoneName )
|
||||
|
||||
local Vec3 = self:GetVec3( Height )
|
||||
|
||||
local PointVec3 = POINT_VEC3:NewFromVec3( Vec3 )
|
||||
local PointVec3 = COORDINATE:NewFromVec3( Vec3 )
|
||||
|
||||
--self:T2( { PointVec3 } )
|
||||
|
||||
@@ -330,16 +330,16 @@ function ZONE_BASE:GetRandomVec2()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Define a random @{Core.Point#POINT_VEC2} within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
--- Define a random @{Core.Point#COORDINATE} within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @return Core.Point#POINT_VEC2 The PointVec2 coordinates.
|
||||
-- @return Core.Point#COORDINATE The COORDINATE coordinates.
|
||||
function ZONE_BASE:GetRandomPointVec2()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Define a random @{Core.Point#POINT_VEC3} within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec3 table.
|
||||
--- Define a random @{Core.Point#COORDINATE} within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec3 table.
|
||||
-- @param #ZONE_BASE self
|
||||
-- @return Core.Point#POINT_VEC3 The PointVec3 coordinates.
|
||||
-- @return Core.Point#COORDINATE The COORDINATE coordinates.
|
||||
function ZONE_BASE:GetRandomPointVec3()
|
||||
return nil
|
||||
end
|
||||
@@ -814,8 +814,8 @@ end
|
||||
-- Various functions exist to find random points within the zone.
|
||||
--
|
||||
-- * @{#ZONE_RADIUS.GetRandomVec2}(): Gets a random 2D point in the zone.
|
||||
-- * @{#ZONE_RADIUS.GetRandomPointVec2}(): Gets a @{Core.Point#POINT_VEC2} object representing a random 2D point in the zone.
|
||||
-- * @{#ZONE_RADIUS.GetRandomPointVec3}(): Gets a @{Core.Point#POINT_VEC3} object representing a random 3D point in the zone. Note that the height of the point is at landheight.
|
||||
-- * @{#ZONE_RADIUS.GetRandomPointVec2}(): Gets a @{Core.Point#COORDINATE} object representing a random 2D point in the zone.
|
||||
-- * @{#ZONE_RADIUS.GetRandomPointVec3}(): Gets a @{Core.Point#COORDINATE} object representing a random 3D point in the zone. Note that the height of the point is at landheight.
|
||||
--
|
||||
-- ## Draw zone
|
||||
--
|
||||
@@ -1010,7 +1010,7 @@ function ZONE_RADIUS:SmokeZone( SmokeColor, Points, AddHeight, AngleOffset )
|
||||
local Radial = ( Angle + AngleOffset ) * RadialBase / 360
|
||||
Point.x = Vec2.x + math.cos( Radial ) * self:GetRadius()
|
||||
Point.y = Vec2.y + math.sin( Radial ) * self:GetRadius()
|
||||
POINT_VEC2:New( Point.x, Point.y, AddHeight ):Smoke( SmokeColor )
|
||||
COORDINATE:New( Point.x, AddHeight, Point.y ):Smoke( SmokeColor )
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -1040,7 +1040,7 @@ function ZONE_RADIUS:FlareZone( FlareColor, Points, Azimuth, AddHeight )
|
||||
local Radial = Angle * RadialBase / 360
|
||||
Point.x = Vec2.x + math.cos( Radial ) * self:GetRadius()
|
||||
Point.y = Vec2.y + math.sin( Radial ) * self:GetRadius()
|
||||
POINT_VEC2:New( Point.x, Point.y, AddHeight ):Flare( FlareColor, Azimuth )
|
||||
COORDINATE:New( Point.x, AddHeight, Point.y ):Flare( FlareColor, Azimuth )
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -1561,15 +1561,15 @@ function ZONE_RADIUS:GetRandomVec2(inner, outer, surfacetypes)
|
||||
return point
|
||||
end
|
||||
|
||||
--- Returns a @{Core.Point#POINT_VEC2} object reflecting a random 2D location within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
--- Returns a @{Core.Point#COORDINATE} object reflecting a random 2D location within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param #number inner (optional) Minimal distance from the center of the zone. Default is 0.
|
||||
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
||||
-- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone.
|
||||
-- @return Core.Point#COORDINATE The @{Core.Point#COORDINATE} object reflecting the random 3D location within the zone.
|
||||
function ZONE_RADIUS:GetRandomPointVec2( inner, outer )
|
||||
--self:F( self.ZoneName, inner, outer )
|
||||
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2( inner, outer ) )
|
||||
local PointVec2 = COORDINATE:NewFromVec2( self:GetRandomVec2( inner, outer ) )
|
||||
|
||||
--self:T3( { PointVec2 } )
|
||||
|
||||
@@ -1592,15 +1592,15 @@ function ZONE_RADIUS:GetRandomVec3( inner, outer )
|
||||
end
|
||||
|
||||
|
||||
--- Returns a @{Core.Point#POINT_VEC3} object reflecting a random 3D location within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec3 table.
|
||||
--- Returns a @{Core.Point#COORDINATE} object reflecting a random 3D location within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec3 table.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @param #number inner (optional) Minimal distance from the center of the zone. Default is 0.
|
||||
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
||||
-- @return Core.Point#POINT_VEC3 The @{Core.Point#POINT_VEC3} object reflecting the random 3D location within the zone.
|
||||
-- @return Core.Point#COORDINATE The @{Core.Point#COORDINATE} object reflecting the random 3D location within the zone.
|
||||
function ZONE_RADIUS:GetRandomPointVec3( inner, outer )
|
||||
--self:F( self.ZoneName, inner, outer )
|
||||
|
||||
local PointVec3 = POINT_VEC3:NewFromVec2( self:GetRandomVec2( inner, outer ) )
|
||||
local PointVec3 = COORDINATE:NewFromVec2( self:GetRandomVec2( inner, outer ) )
|
||||
|
||||
--self:T3( { PointVec3 } )
|
||||
|
||||
@@ -2036,15 +2036,15 @@ function ZONE_GROUP:GetRandomVec2()
|
||||
return Point
|
||||
end
|
||||
|
||||
--- Returns a @{Core.Point#POINT_VEC2} object reflecting a random 2D location within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
--- Returns a @{Core.Point#COORDINATE} object reflecting a random 2D location within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
-- @param #ZONE_GROUP self
|
||||
-- @param #number inner (optional) Minimal distance from the center of the zone. Default is 0.
|
||||
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
||||
-- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone.
|
||||
-- @return Core.Point#COORDINATE The @{Core.Point#COORDINATE} object reflecting the random 3D location within the zone.
|
||||
function ZONE_GROUP:GetRandomPointVec2( inner, outer )
|
||||
--self:F( self.ZoneName, inner, outer )
|
||||
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() )
|
||||
local PointVec2 = COORDINATE:NewFromVec2( self:GetRandomVec2() )
|
||||
|
||||
--self:T3( { PointVec2 } )
|
||||
|
||||
@@ -2192,8 +2192,8 @@ end
|
||||
-- Various functions exist to find random points within the zone.
|
||||
--
|
||||
-- * @{#ZONE_POLYGON_BASE.GetRandomVec2}(): Gets a random 2D point in the zone.
|
||||
-- * @{#ZONE_POLYGON_BASE.GetRandomPointVec2}(): Return a @{Core.Point#POINT_VEC2} object representing a random 2D point within the zone.
|
||||
-- * @{#ZONE_POLYGON_BASE.GetRandomPointVec3}(): Return a @{Core.Point#POINT_VEC3} object representing a random 3D point at landheight within the zone.
|
||||
-- * @{#ZONE_POLYGON_BASE.GetRandomPointVec2}(): Return a @{Core.Point#COORDINATE} object representing a random 2D point within the zone.
|
||||
-- * @{#ZONE_POLYGON_BASE.GetRandomPointVec3}(): Return a @{Core.Point#COORDINATE} object representing a random 3D point at landheight within the zone.
|
||||
--
|
||||
-- ## Draw zone
|
||||
--
|
||||
@@ -2769,7 +2769,7 @@ function ZONE_POLYGON_BASE:SmokeZone( SmokeColor, Segments )
|
||||
for Segment = 0, Segments do -- We divide each line in 5 segments and smoke a point on the line.
|
||||
local PointX = self._.Polygon[i].x + ( Segment * DeltaX / Segments )
|
||||
local PointY = self._.Polygon[i].y + ( Segment * DeltaY / Segments )
|
||||
POINT_VEC2:New( PointX, PointY ):Smoke( SmokeColor )
|
||||
COORDINATE:New( PointX, 0, PointY ):Smoke( SmokeColor )
|
||||
end
|
||||
j = i
|
||||
i = i + 1
|
||||
@@ -2804,7 +2804,7 @@ function ZONE_POLYGON_BASE:FlareZone( FlareColor, Segments, Azimuth, AddHeight )
|
||||
for Segment = 0, Segments do -- We divide each line in 5 segments and smoke a point on the line.
|
||||
local PointX = self._.Polygon[i].x + ( Segment * DeltaX / Segments )
|
||||
local PointY = self._.Polygon[i].y + ( Segment * DeltaY / Segments )
|
||||
POINT_VEC2:New( PointX, PointY, AddHeight ):Flare(FlareColor, Azimuth)
|
||||
COORDINATE:New( PointX, AddHeight, PointY ):Flare(FlareColor, Azimuth)
|
||||
end
|
||||
j = i
|
||||
i = i + 1
|
||||
@@ -2880,26 +2880,26 @@ function ZONE_POLYGON_BASE:GetRandomVec2()
|
||||
end
|
||||
end
|
||||
|
||||
--- Return a @{Core.Point#POINT_VEC2} object representing a random 2D point at landheight within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
--- Return a @{Core.Point#COORDINATE} object representing a random 2D point at landheight within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @return @{Core.Point#POINT_VEC2}
|
||||
-- @return @{Core.Point#COORDINATE}
|
||||
function ZONE_POLYGON_BASE:GetRandomPointVec2()
|
||||
--self:F2()
|
||||
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() )
|
||||
local PointVec2 = COORDINATE:NewFromVec2( self:GetRandomVec2() )
|
||||
|
||||
--self:T2( PointVec2 )
|
||||
|
||||
return PointVec2
|
||||
end
|
||||
|
||||
--- Return a @{Core.Point#POINT_VEC3} object representing a random 3D point at landheight within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec3 table.
|
||||
--- Return a @{Core.Point#COORDINATE} object representing a random 3D point at landheight within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec3 table.
|
||||
-- @param #ZONE_POLYGON_BASE self
|
||||
-- @return @{Core.Point#POINT_VEC3}
|
||||
-- @return @{Core.Point#COORDINATE}
|
||||
function ZONE_POLYGON_BASE:GetRandomPointVec3()
|
||||
--self:F2()
|
||||
|
||||
local PointVec3 = POINT_VEC3:NewFromVec2( self:GetRandomVec2() )
|
||||
local PointVec3 = COORDINATE:NewFromVec2( self:GetRandomVec2() )
|
||||
|
||||
--self:T2( PointVec3 )
|
||||
|
||||
@@ -3931,18 +3931,18 @@ function ZONE_OVAL:GetRandomVec2()
|
||||
return {x=rx, y=ry}
|
||||
end
|
||||
|
||||
--- Define a random @{Core.Point#POINT_VEC2} within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
--- Define a random @{Core.Point#COORDINATE} within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
-- @param #ZONE_OVAL self
|
||||
-- @return Core.Point#POINT_VEC2 The PointVec2 coordinates.
|
||||
-- @return Core.Point#COORDINATE The COORDINATE coordinates.
|
||||
function ZONE_OVAL:GetRandomPointVec2()
|
||||
return POINT_VEC2:NewFromVec2(self:GetRandomVec2())
|
||||
return COORDINATE:NewFromVec2(self:GetRandomVec2())
|
||||
end
|
||||
|
||||
--- Define a random @{Core.Point#POINT_VEC2} within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec3 table.
|
||||
--- Define a random @{Core.Point#COORDINATE} within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec3 table.
|
||||
-- @param #ZONE_OVAL self
|
||||
-- @return Core.Point#POINT_VEC2 The PointVec2 coordinates.
|
||||
-- @return Core.Point#COORDINATE The COORDINATE coordinates.
|
||||
function ZONE_OVAL:GetRandomPointVec3()
|
||||
return POINT_VEC3:NewFromVec3(self:GetRandomVec2())
|
||||
return COORDINATE:NewFromVec3(self:GetRandomVec2())
|
||||
end
|
||||
|
||||
--- Draw the zone on the F10 map.
|
||||
@@ -4082,15 +4082,15 @@ do -- ZONE_AIRBASE
|
||||
return ZoneVec2
|
||||
end
|
||||
|
||||
--- Returns a @{Core.Point#POINT_VEC2} object reflecting a random 2D location within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
--- Returns a @{Core.Point#COORDINATE} object reflecting a random 2D location within the zone. Note that this is actually a @{Core.Point#COORDINATE} type object, and not a simple Vec2 table.
|
||||
-- @param #ZONE_AIRBASE self
|
||||
-- @param #number inner (optional) Minimal distance from the center of the zone. Default is 0.
|
||||
-- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone.
|
||||
-- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone.
|
||||
-- @return Core.Point#COORDINATE The @{Core.Point#COORDINATE} object reflecting the random 3D location within the zone.
|
||||
function ZONE_AIRBASE:GetRandomPointVec2( inner, outer )
|
||||
--self:F( self.ZoneName, inner, outer )
|
||||
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() )
|
||||
local PointVec2 = COORDINATE:NewFromVec2( self:GetRandomVec2() )
|
||||
|
||||
--self:T3( { PointVec2 } )
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ function ZONE_DETECTION:SmokeZone( SmokeColor, Points, AddHeight, AngleOffset )
|
||||
local Radial = ( Angle + AngleOffset ) * RadialBase / 360
|
||||
Point.x = Vec2.x + math.cos( Radial ) * self:GetRadius()
|
||||
Point.y = Vec2.y + math.sin( Radial ) * self:GetRadius()
|
||||
POINT_VEC2:New( Point.x, Point.y, AddHeight ):Smoke( SmokeColor )
|
||||
COORDINATE:New( Point.x, AddHeight, Point.y):Smoke( SmokeColor )
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -138,7 +138,7 @@ function ZONE_DETECTION:FlareZone( FlareColor, Points, Azimuth, AddHeight )
|
||||
local Radial = Angle * RadialBase / 360
|
||||
Point.x = Vec2.x + math.cos( Radial ) * self:GetRadius()
|
||||
Point.y = Vec2.y + math.sin( Radial ) * self:GetRadius()
|
||||
POINT_VEC2:New( Point.x, Point.y, AddHeight ):Flare( FlareColor, Azimuth )
|
||||
COORDINATE:New( Point.x, AddHeight, Point.y ):Flare( FlareColor, Azimuth )
|
||||
end
|
||||
|
||||
return self
|
||||
@@ -202,4 +202,3 @@ function ZONE_DETECTION:IsVec3InZone( Vec3 )
|
||||
|
||||
return InZone
|
||||
end
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ end -- env
|
||||
|
||||
do -- radio
|
||||
|
||||
---@type radio
|
||||
--@type radio
|
||||
-- @field #radio.modulation modulation
|
||||
|
||||
---
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
-- @module Functional.Mantis
|
||||
-- @image Functional.Mantis.jpg
|
||||
--
|
||||
-- Last Update: Mar 2025
|
||||
-- Last Update: May 2025
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
--- **MANTIS** class, extends Core.Base#BASE
|
||||
@@ -62,7 +62,9 @@
|
||||
-- @field #table FilterZones Table of Core.Zone#ZONE Zones Consider SAM groups in this zone(s) only for this MANTIS instance, must be handed as #table of Zone objects.
|
||||
-- @field #boolean SmokeDecoy If true, smoke short range SAM units as decoy if a plane is in firing range.
|
||||
-- @field #number SmokeDecoyColor Color to use, defaults to SMOKECOLOR.White
|
||||
-- @field #number checkcounter Counter for SAM Table refreshes
|
||||
-- @field #number checkcounter Counter for SAM Table refreshes.
|
||||
-- @field #number DLinkCacheTime Seconds after which cached contacts in DLink will decay.
|
||||
-- @field #boolean logsamstatus Log SAM status in dcs.log every cycle if true
|
||||
-- @extends Core.Base#BASE
|
||||
|
||||
|
||||
@@ -74,10 +76,9 @@
|
||||
--
|
||||
-- * Moose derived Modular, Automatic and Network capable Targeting and Interception System.
|
||||
-- * Controls a network of SAM sites. Uses detection to switch on the SAM site closest to the enemy.
|
||||
-- * **Automatic mode** (default since 0.8) will set-up your SAM site network automatically for you
|
||||
-- * **Classic mode** behaves like before
|
||||
-- * Leverage evasiveness from SEAD, leverage attack range setting
|
||||
-- * Automatic setup of SHORAD based on groups of the class "short-range"
|
||||
-- * **Automatic mode** (default) will set-up your SAM site network automatically for you.
|
||||
-- * Leverage evasiveness from SEAD, leverage attack range setting.
|
||||
-- * Automatic setup of SHORAD based on groups of the class "short-range".
|
||||
--
|
||||
-- # 0. Base considerations and naming conventions
|
||||
--
|
||||
@@ -133,10 +134,10 @@
|
||||
--
|
||||
-- # 0.1 Set-up in the mission editor
|
||||
--
|
||||
-- Set up your SAM sites in the mission editor. Name the groups using a systematic approach like above.
|
||||
-- Set up your EWR system in the mission editor. Name the groups using a systematic approach like above. Can be e.g. AWACS or a combination of AWACS and Search Radars like e.g. EWR 1L13 etc.
|
||||
-- Set up your SAM sites in the mission editor. Name the groups using a systematic approach like above.Can be e.g. AWACS or a combination of AWACS and Search Radars like e.g. EWR 1L13 etc.
|
||||
-- Search Radars usually have "SR" or "STR" in their names. Use the encyclopedia in the mission editor to inform yourself.
|
||||
-- Set up your SHORAD systems. They need to be **close** to (i.e. around) the SAM sites to be effective. Use **one** group per SAM location. SA-15 TOR systems offer a good missile defense.
|
||||
-- Set up your SHORAD systems. They need to be **close** to (i.e. around) the SAM sites to be effective. Use **one unit ** per group (multiple groups) for the SAM location.
|
||||
-- Else, evasive manoevers might club up all defenders in one place. Red SA-15 TOR systems offer a good missile defense.
|
||||
--
|
||||
-- [optional] Set up your HQ. Can be any group, e.g. a command vehicle.
|
||||
--
|
||||
@@ -188,7 +189,7 @@
|
||||
--
|
||||
-- ## 2.1 Auto mode features
|
||||
--
|
||||
-- ### 2.1.1 You can now add Accept-, Reject- and Conflict-Zones to your setup, e.g. to consider borders or de-militarized zones:
|
||||
-- ### 2.1.1 You can add Accept-, Reject- and Conflict-Zones to your setup, e.g. to consider borders or de-militarized zones:
|
||||
--
|
||||
-- -- Parameters are tables of Core.Zone#ZONE objects!
|
||||
-- -- This is effectively a 3-stage filter allowing for zone overlap. A coordinate is accepted first when
|
||||
@@ -205,9 +206,6 @@
|
||||
-- ### 2.1.3 SHORAD/Point defense will automatically be added from SAM sites of type "point" or if the range is less than 5km or if the type is AAA.
|
||||
--
|
||||
-- ### 2.1.4 Advanced features
|
||||
--
|
||||
-- -- Option to switch off auto mode **before** you start MANTIS (not recommended)
|
||||
-- mybluemantis.automode = false
|
||||
--
|
||||
-- -- Option to set the scale of the activation range, i.e. don't activate at the fringes of max range, defaults below.
|
||||
-- -- also see engagerange below.
|
||||
@@ -220,6 +218,12 @@
|
||||
--
|
||||
-- -- For some scenarios, like Cold War, it might be useful not to activate SAMs if friendly aircraft are around to avoid death by friendly fire.
|
||||
-- mybluemantis.checkforfriendlies = true
|
||||
--
|
||||
-- ### 2.1.6 Shoot & Scoot
|
||||
--
|
||||
-- -- Option to make the (driveable) SHORAD units drive around and shuffle positions
|
||||
-- -- We use a SET_ZONE for that, number of zones to consider defaults to three, Random is true for random coordinates and Formation is e.g. "Vee".
|
||||
-- mybluemantis:AddScootZones(ZoneSet, Number, Random, Formation)
|
||||
--
|
||||
-- # 3. Default settings [both modes unless stated otherwise]
|
||||
--
|
||||
@@ -242,26 +246,8 @@
|
||||
-- E.g. mymantis:SetAdvancedMode( true, 90 )
|
||||
--
|
||||
-- Use this option if you want to make use of or allow advanced SEAD tactics.
|
||||
--
|
||||
-- # 5. Integrate SHORAD [classic mode, not necessary in automode, not recommended for manual setup]
|
||||
--
|
||||
-- You can also choose to integrate Mantis with @{Functional.Shorad#SHORAD} for protection against HARMs and AGMs manually. When SHORAD detects a missile fired at one of MANTIS' SAM sites, it will activate SHORAD systems in
|
||||
-- the given defense checkradius around that SAM site. Create a SHORAD object first, then integrate with MANTIS like so:
|
||||
--
|
||||
-- local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart()
|
||||
-- myshorad = SHORAD:New("BlueShorad", "Blue SHORAD", SamSet, 22000, 600, "blue")
|
||||
-- -- now set up MANTIS
|
||||
-- mymantis = MANTIS:New("BlueMantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs")
|
||||
-- mymantis:AddShorad(myshorad,720)
|
||||
-- mymantis:Start()
|
||||
--
|
||||
-- If you systematically name your SHORAD groups starting with "Blue SHORAD" you'll need exactly **one** SHORAD instance to manage all SHORAD groups.
|
||||
--
|
||||
-- (Optionally) you can remove the link later on with
|
||||
--
|
||||
-- mymantis:RemoveShorad()
|
||||
--
|
||||
-- # 6. Integrated SEAD
|
||||
-- # 5. Integrated SEAD
|
||||
--
|
||||
-- MANTIS is using @{Functional.Sead#SEAD} internally to both detect and evade HARM attacks. No extra efforts needed to set this up!
|
||||
-- Once a HARM attack is detected, MANTIS (via SEAD) will shut down the radars of the attacked SAM site and take evasive action by moving the SAM
|
||||
@@ -336,6 +322,8 @@ MANTIS = {
|
||||
SmokeDecoy = false,
|
||||
SmokeDecoyColor = SMOKECOLOR.White,
|
||||
checkcounter = 1,
|
||||
DLinkCacheTime = 120,
|
||||
logsamstatus = false,
|
||||
}
|
||||
|
||||
--- Advanced state enumerator
|
||||
@@ -374,7 +362,7 @@ MANTIS.radiusscale[MANTIS.SamType.POINT] = 3
|
||||
MANTIS.SamData = {
|
||||
["Hawk"] = { Range=35, Blindspot=0, Height=12, Type="Medium", Radar="Hawk" }, -- measures in km
|
||||
["NASAMS"] = { Range=14, Blindspot=0, Height=7, Type="Short", Radar="NSAMS" }, -- AIM 120B
|
||||
["Patriot"] = { Range=99, Blindspot=0, Height=25, Type="Long", Radar="Patriot" },
|
||||
["Patriot"] = { Range=99, Blindspot=0, Height=25, Type="Long", Radar="Patriot str" },
|
||||
["Rapier"] = { Range=10, Blindspot=0, Height=3, Type="Short", Radar="rapier" },
|
||||
["SA-2"] = { Range=40, Blindspot=7, Height=25, Type="Medium", Radar="S_75M_Volhov" },
|
||||
["SA-3"] = { Range=18, Blindspot=6, Height=18, Type="Short", Radar="5p73 s-125 ln" },
|
||||
@@ -382,7 +370,8 @@ MANTIS.SamData = {
|
||||
["SA-6"] = { Range=25, Blindspot=0, Height=8, Type="Medium", Radar="1S91" },
|
||||
["SA-10"] = { Range=119, Blindspot=0, Height=18, Type="Long" , Radar="S-300PS 4"},
|
||||
["SA-11"] = { Range=35, Blindspot=0, Height=20, Type="Medium", Radar="SA-11" },
|
||||
["Roland"] = { Range=5, Blindspot=0, Height=5, Type="Point", Radar="Roland" },
|
||||
["Roland"] = { Range=6, Blindspot=0, Height=5, Type="Short", Radar="Roland" },
|
||||
["Gepard"] = { Range=5, Blindspot=0, Height=4, Type="Point", Radar="Gepard" },
|
||||
["HQ-7"] = { Range=12, Blindspot=0, Height=3, Type="Short", Radar="HQ-7" },
|
||||
["SA-9"] = { Range=4, Blindspot=0, Height=3, Type="Point", Radar="Strela", Point="true" },
|
||||
["SA-8"] = { Range=10, Blindspot=0, Height=5, Type="Short", Radar="Osa 9A33" },
|
||||
@@ -393,6 +382,7 @@ MANTIS.SamData = {
|
||||
["Chaparral"] = { Range=8, Blindspot=0, Height=3, Type="Short", Radar="Chaparral" },
|
||||
["Linebacker"] = { Range=4, Blindspot=0, Height=3, Type="Point", Radar="Linebacker", Point="true" },
|
||||
["Silkworm"] = { Range=90, Blindspot=1, Height=0.2, Type="Long", Radar="Silkworm" },
|
||||
["HEMTT_C-RAM_Phalanx"] = { Range=2, Blindspot=0, Height=2, Type="Point", Radar="HEMTT_C-RAM_Phalanx", Point="true" },
|
||||
-- units from HDS Mod, multi launcher options is tricky
|
||||
["SA-10B"] = { Range=75, Blindspot=0, Height=18, Type="Medium" , Radar="SA-10B"},
|
||||
["SA-17"] = { Range=50, Blindspot=3, Height=30, Type="Medium", Radar="SA-17" },
|
||||
@@ -437,16 +427,16 @@ MANTIS.SamDataSMA = {
|
||||
-- units from SMA Mod (Sweedish Military Assets)
|
||||
-- https://forum.dcs.world/topic/295202-swedish-military-assets-for-dcs-by-currenthill/
|
||||
-- group name MUST contain SMA to ID launcher type correctly!
|
||||
["RBS98M SMA"] = { Range=20, Blindspot=0, Height=8, Type="Short", Radar="RBS-98" },
|
||||
["RBS70 SMA"] = { Range=8, Blindspot=0, Height=5.5, Type="Short", Radar="RBS-70" },
|
||||
["RBS70M SMA"] = { Range=8, Blindspot=0, Height=5.5, Type="Short", Radar="BV410_RBS70" },
|
||||
["RBS90 SMA"] = { Range=8, Blindspot=0, Height=5.5, Type="Short", Radar="RBS-90" },
|
||||
["RBS90M SMA"] = { Range=8, Blindspot=0, Height=5.5, Type="Short", Radar="BV410_RBS90" },
|
||||
["RBS103A SMA"] = { Range=150, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_Rb103A" },
|
||||
["RBS103B SMA"] = { Range=35, Blindspot=0, Height=36, Type="Medium", Radar="LvS-103_Lavett103_Rb103B" },
|
||||
["RBS103AM SMA"] = { Range=150, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_HX_Rb103A" },
|
||||
["RBS103BM SMA"] = { Range=35, Blindspot=0, Height=36, Type="Medium", Radar="LvS-103_Lavett103_HX_Rb103B" },
|
||||
["Lvkv9040M SMA"] = { Range=4, Blindspot=0, Height=2.5, Type="Point", Radar="LvKv9040",Point="true" },
|
||||
["RBS98M SMA"] = { Range=20, Blindspot=0.2, Height=8, Type="Short", Radar="RBS-98" },
|
||||
["RBS70 SMA"] = { Range=8, Blindspot=0.25, Height=6, Type="Short", Radar="RBS-70" },
|
||||
["RBS70M SMA"] = { Range=8, Blindspot=0.25, Height=6, Type="Short", Radar="BV410_RBS70" },
|
||||
["RBS90 SMA"] = { Range=8, Blindspot=0.25, Height=6, Type="Short", Radar="RBS-90" },
|
||||
["RBS90M SMA"] = { Range=8, Blindspot=0.25, Height=6, Type="Short", Radar="BV410_RBS90" },
|
||||
["RBS103A SMA"] = { Range=160, Blindspot=1, Height=36, Type="Long", Radar="LvS-103_Lavett103_Rb103A" },
|
||||
["RBS103B SMA"] = { Range=120, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_Rb103B" },
|
||||
["RBS103AM SMA"] = { Range=160, Blindspot=1, Height=36, Type="Long", Radar="LvS-103_Lavett103_HX_Rb103A" },
|
||||
["RBS103BM SMA"] = { Range=120, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_HX_Rb103B" },
|
||||
["Lvkv9040M SMA"] = { Range=2, Blindspot=0.1, Height=1.2, Type="Point", Radar="LvKv9040",Point="true" },
|
||||
}
|
||||
|
||||
--- SAM data CH
|
||||
@@ -461,47 +451,49 @@ MANTIS.SamDataCH = {
|
||||
-- units from CH (Military Assets by Currenthill)
|
||||
-- https://www.currenthill.com/
|
||||
-- group name MUST contain CHM to ID launcher type correctly!
|
||||
["2S38 CHM"] = { Range=8, Blindspot=0.5, Height=6, Type="Short", Radar="2S38" },
|
||||
["2S38 CHM"] = { Range=6, Blindspot=0.1, Height=4.5, Type="Short", Radar="2S38" },
|
||||
["PantsirS1 CHM"] = { Range=20, Blindspot=1.2, Height=15, Type="Short", Radar="PantsirS1" },
|
||||
["PantsirS2 CHM"] = { Range=30, Blindspot=1.2, Height=18, Type="Medium", Radar="PantsirS2" },
|
||||
["PGL-625 CHM"] = { Range=10, Blindspot=0.5, Height=5, Type="Short", Radar="PGL_625" },
|
||||
["HQ-17A CHM"] = { Range=20, Blindspot=1.5, Height=10, Type="Short", Radar="HQ17A" },
|
||||
["M903PAC2 CHM"] = { Range=160, Blindspot=3, Height=24.5, Type="Long", Radar="MIM104_M903_PAC2" },
|
||||
["M903PAC3 CHM"] = { Range=120, Blindspot=1, Height=40, Type="Long", Radar="MIM104_M903_PAC3" },
|
||||
["PGL-625 CHM"] = { Range=10, Blindspot=1, Height=5, Type="Short", Radar="PGL_625" },
|
||||
["HQ-17A CHM"] = { Range=15, Blindspot=1.5, Height=10, Type="Short", Radar="HQ17A" },
|
||||
["M903PAC2 CHM"] = { Range=120, Blindspot=3, Height=24.5, Type="Long", Radar="MIM104_M903_PAC2" },
|
||||
["M903PAC3 CHM"] = { Range=160, Blindspot=1, Height=40, Type="Long", Radar="MIM104_M903_PAC3" },
|
||||
["TorM2 CHM"] = { Range=12, Blindspot=1, Height=10, Type="Short", Radar="TorM2" },
|
||||
["TorM2K CHM"] = { Range=12, Blindspot=1, Height=10, Type="Short", Radar="TorM2K" },
|
||||
["TorM2M CHM"] = { Range=16, Blindspot=1, Height=10, Type="Short", Radar="TorM2M" },
|
||||
["NASAMS3-AMRAAMER CHM"] = { Range=50, Blindspot=2, Height=35.7, Type="Medium", Radar="CH_NASAMS3_LN_AMRAAM_ER" },
|
||||
["NASAMS3-AIM9X2 CHM"] = { Range=20, Blindspot=0.2, Height=18, Type="Short", Radar="CH_NASAMS3_LN_AIM9X2" },
|
||||
["C-RAM CHM"] = { Range=2, Blindspot=0, Height=2, Type="Point", Radar="CH_Centurion_C_RAM", Point="true" },
|
||||
["PGZ-09 CHM"] = { Range=4, Blindspot=0, Height=3, Type="Point", Radar="CH_PGZ09", Point="true" },
|
||||
["S350-9M100 CHM"] = { Range=15, Blindspot=1.5, Height=8, Type="Short", Radar="CH_S350_50P6_9M100" },
|
||||
["PGZ-09 CHM"] = { Range=4, Blindspot=0.5, Height=3, Type="Point", Radar="CH_PGZ09", Point="true" },
|
||||
["S350-9M100 CHM"] = { Range=15, Blindspot=1, Height=8, Type="Short", Radar="CH_S350_50P6_9M100" },
|
||||
["S350-9M96D CHM"] = { Range=150, Blindspot=2.5, Height=30, Type="Long", Radar="CH_S350_50P6_9M96D" },
|
||||
["LAV-AD CHM"] = { Range=8, Blindspot=0.2, Height=4.8, Type="Short", Radar="CH_LAVAD" },
|
||||
["LAV-AD CHM"] = { Range=8, Blindspot=0.16, Height=4.8, Type="Short", Radar="CH_LAVAD" },
|
||||
["HQ-22 CHM"] = { Range=170, Blindspot=5, Height=27, Type="Long", Radar="CH_HQ22_LN" },
|
||||
["PGZ-95 CHM"] = { Range=2, Blindspot=0, Height=2, Type="Point", Radar="CH_PGZ95",Point="true" },
|
||||
["LD-3000 CHM"] = { Range=3, Blindspot=0, Height=3, Type="Point", Radar="CH_LD3000_stationary", Point="true" },
|
||||
["LD-3000M CHM"] = { Range=3, Blindspot=0, Height=3, Type="Point", Radar="CH_LD3000", Point="true" },
|
||||
["FlaRakRad CHM"] = { Range=8, Blindspot=1.5, Height=6, Type="Short", Radar="HQ17A" },
|
||||
["PGZ-95 CHM"] = { Range=2.5, Blindspot=0.5, Height=2, Type="Point", Radar="CH_PGZ95",Point="true" },
|
||||
["LD-3000 CHM"] = { Range=2.5, Blindspot=0.1, Height=3, Type="Point", Radar="CH_LD3000_stationary", Point="true" },
|
||||
["LD-3000M CHM"] = { Range=2.5, Blindspot=0.1, Height=3, Type="Point", Radar="CH_LD3000", Point="true" },
|
||||
["FlaRakRad CHM"] = { Range=8, Blindspot=1.5, Height=6, Type="Short", Radar="CH_FlaRakRad" },
|
||||
["IRIS-T SLM CHM"] = { Range=40, Blindspot=0.5, Height=20, Type="Medium", Radar="CH_IRIST_SLM" },
|
||||
["M903PAC2KAT1 CHM"] = { Range=160, Blindspot=3, Height=24.5, Type="Long", Radar="CH_MIM104_M903_PAC2_KAT1" },
|
||||
["Skynex CHM"] = { Range=3.5, Blindspot=0, Height=3.5, Type="Point", Radar="CH_SkynexHX", Point="true" },
|
||||
["Skyshield CHM"] = { Range=3.5, Blindspot=0, Height=3.5, Type="Point", Radar="CH_Skyshield_Gun", Point="true" },
|
||||
["WieselOzelot CHM"] = { Range=8, Blindspot=0.2, Height=4.8, Type="Short", Radar="CH_Wiesel2Ozelot" },
|
||||
["M903PAC2KAT1 CHM"] = { Range=120, Blindspot=3, Height=24.5, Type="Long", Radar="CH_MIM104_M903_PAC2_KAT1" },
|
||||
["Skynex CHM"] = { Range=3.5, Blindspot=0.1, Height=3.5, Type="Point", Radar="CH_SkynexHX", Point="true" },
|
||||
["Skyshield CHM"] = { Range=3.5, Blindspot=0.1, Height=3.5, Type="Point", Radar="CH_Skyshield_Gun", Point="true" },
|
||||
["WieselOzelot CHM"] = { Range=8, Blindspot=0.16, Height=4.8, Type="Short", Radar="CH_Wiesel2Ozelot" },
|
||||
["BukM3-9M317M CHM"] = { Range=70, Blindspot=0.25, Height=35, Type="Medium", Radar="CH_BukM3_9A317M" },
|
||||
["BukM3-9M317MA CHM"] = { Range=70, Blindspot=0.25, Height=35, Type="Medium", Radar="CH_BukM3_9A317MA" },
|
||||
["SkySabre CHM"] = { Range=30, Blindspot=0.5, Height=10, Type="Medium", Radar="CH_SkySabreLN" },
|
||||
["Stormer CHM"] = { Range=7.5, Blindspot=0.3, Height=7, Type="Short", Radar="CH_StormerHVM" },
|
||||
["THAAD CHM"] = { Range=200, Blindspot=40, Height=150, Type="Long", Radar="CH_THAAD_M1120" },
|
||||
["USInfantryFIM92K CHM"] = { Range=8, Blindspot=0.2, Height=4.8, Type="Short", Radar="CH_USInfantry_FIM92" },
|
||||
["RBS98M CHM"] = { Range=20, Blindspot=0, Height=8, Type="Short", Radar="RBS-98" },
|
||||
["RBS70 CHM"] = { Range=8, Blindspot=0, Height=5.5, Type="Short", Radar="RBS-70" },
|
||||
["RBS90 CHM"] = { Range=8, Blindspot=0, Height=5.5, Type="Short", Radar="RBS-90" },
|
||||
["RBS103A CHM"] = { Range=150, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_Rb103A" },
|
||||
["RBS103B CHM"] = { Range=35, Blindspot=0, Height=36, Type="Medium", Radar="LvS-103_Lavett103_Rb103B" },
|
||||
["RBS103AM CHM"] = { Range=150, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_HX_Rb103A" },
|
||||
["RBS103BM CHM"] = { Range=35, Blindspot=0, Height=36, Type="Medium", Radar="LvS-103_Lavett103_HX_Rb103B" },
|
||||
["Lvkv9040M CHM"] = { Range=4, Blindspot=0, Height=2.5, Type="Point", Radar="LvKv9040", Point="true" },
|
||||
["USInfantryFIM92K CHM"] = { Range=8, Blindspot=0.16, Height=4.8, Type="Short", Radar="CH_USInfantry_FIM92" },
|
||||
["RBS98M CHM"] = { Range=20, Blindspot=0.2, Height=8, Type="Short", Radar="RBS-98" },
|
||||
["RBS70 CHM"] = { Range=8, Blindspot=0.25, Height=6, Type="Short", Radar="RBS-70" },
|
||||
["RBS70M CHM"] = { Range=8, Blindspot=0.25, Height=6, Type="Short", Radar="BV410_RBS70" },
|
||||
["RBS90 CHM"] = { Range=8, Blindspot=0.25, Height=6, Type="Short", Radar="RBS-90" },
|
||||
["RBS90M CHM"] = { Range=8, Blindspot=0.25, Height=6, Type="Short", Radar="BV410_RBS90" },
|
||||
["RBS103A CHM"] = { Range=160, Blindspot=1, Height=36, Type="Long", Radar="LvS-103_Lavett103_Rb103A" },
|
||||
["RBS103B CHM"] = { Range=120, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_Rb103B" },
|
||||
["RBS103AM CHM"] = { Range=160, Blindspot=1, Height=36, Type="Long", Radar="LvS-103_Lavett103_HX_Rb103A" },
|
||||
["RBS103BM CHM"] = { Range=120, Blindspot=3, Height=24.5, Type="Long", Radar="LvS-103_Lavett103_HX_Rb103B" },
|
||||
["Lvkv9040M CHM"] = { Range=2, Blindspot=0.1, Height=1.2, Type="Point", Radar="LvKv9040",Point="true" },
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
@@ -623,7 +615,8 @@ do
|
||||
self.advAwacs = false
|
||||
end
|
||||
|
||||
|
||||
self:SetDLinkCacheTime()
|
||||
|
||||
-- Set the string id for output to DCS.log file.
|
||||
self.lid=string.format("MANTIS %s | ", self.name)
|
||||
|
||||
@@ -656,6 +649,8 @@ do
|
||||
table.insert(self.ewr_templates,awacs)
|
||||
end
|
||||
|
||||
self.logsamstatus = false
|
||||
|
||||
self:T({self.ewr_templates})
|
||||
|
||||
self.SAM_Group = SET_GROUP:New():FilterPrefixes(self.SAM_Templates_Prefix):FilterCoalitions(self.Coalition)
|
||||
@@ -687,7 +682,7 @@ do
|
||||
|
||||
-- TODO Version
|
||||
-- @field #string version
|
||||
self.version="0.9.27"
|
||||
self.version="0.9.30"
|
||||
self:I(string.format("***** Starting MANTIS Version %s *****", self.version))
|
||||
|
||||
--- FSM Functions ---
|
||||
@@ -1037,6 +1032,16 @@ do
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Function to set how long INTEL DLINK remembers contacts.
|
||||
-- @param #MANTIS self
|
||||
-- @param #number seconds Remember this many seconds, at least 5 seconds.
|
||||
-- @return #MANTIS self
|
||||
function MANTIS:SetDLinkCacheTime(seconds)
|
||||
self.DLinkCacheTime = math.abs(seconds or 120)
|
||||
if self.DLinkCacheTime < 5 then self.DLinkCacheTime = 5 end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Function to set the detection interval
|
||||
-- @param #MANTIS self
|
||||
@@ -1429,7 +1434,9 @@ do
|
||||
--IntelTwo:SetClusterRadius(5000)
|
||||
IntelTwo:Start()
|
||||
|
||||
local IntelDlink = INTEL_DLINK:New({IntelOne,IntelTwo},self.name.." DLINK",22,300)
|
||||
local CacheTime = self.DLinkCacheTime or 120
|
||||
local IntelDlink = INTEL_DLINK:New({IntelOne,IntelTwo},self.name.." DLINK",22,CacheTime)
|
||||
|
||||
IntelDlink:__Start(1)
|
||||
|
||||
self:SetUsingDLink(IntelDlink)
|
||||
@@ -1491,7 +1498,7 @@ do
|
||||
elseif chm then
|
||||
SAMData = self.SamDataCH
|
||||
end
|
||||
--self:T("Looking to auto-match for "..grpname)
|
||||
--self:I("Looking to auto-match for "..grpname)
|
||||
for _,_unit in pairs(units) do
|
||||
local unit = _unit -- Wrapper.Unit#UNIT
|
||||
local type = string.lower(unit:GetTypeName())
|
||||
@@ -1692,7 +1699,9 @@ do
|
||||
local grpname = group:GetName()
|
||||
local grpcoord = group:GetCoordinate()
|
||||
local grprange, grpheight,type,blind = self:_GetSAMRange(grpname)
|
||||
local radaralive = group:IsSAM()
|
||||
-- TODO the below might stop working at some point after some hours, needs testing
|
||||
--local radaralive = group:IsSAM()
|
||||
local radaralive = true
|
||||
table.insert( SAM_Tbl, {grpname, grpcoord, grprange, grpheight, blind, type}) -- make the table lighter, as I don't really use the zone here
|
||||
table.insert( SEAD_Grps, grpname )
|
||||
if type == MANTIS.SamType.LONG and radaralive then
|
||||
@@ -1854,7 +1863,7 @@ do
|
||||
end --end alive
|
||||
end --end check
|
||||
end --for loop
|
||||
if self.debug or self.verbose then
|
||||
if self.debug or self.verbose or self.logsamstatus then
|
||||
for _,_status in pairs(self.SamStateTracker) do
|
||||
if _status == "GREEN" then
|
||||
instatusgreen=instatusgreen+1
|
||||
@@ -1875,8 +1884,9 @@ do
|
||||
-- @param #MANTIS self
|
||||
-- @param Functional.Detection#DETECTION_AREAS detection Detection object
|
||||
-- @param #boolean dlink
|
||||
-- @param #boolean reporttolog
|
||||
-- @return #MANTIS self
|
||||
function MANTIS:_Check(detection,dlink)
|
||||
function MANTIS:_Check(detection,dlink,reporttolog)
|
||||
self:T(self.lid .. "Check")
|
||||
--get detected set
|
||||
local detset = detection:GetDetectedItemCoordinates()
|
||||
@@ -1903,7 +1913,8 @@ do
|
||||
local samset = self:_GetSAMTable() -- table of i.1=names, i.2=coordinates, i.3=firing range, i.4=firing height
|
||||
instatusred, instatusgreen, activeshorads = self:_CheckLoop(samset,detset,dlink,self.maxclassic)
|
||||
end
|
||||
if self.debug or self.verbose then
|
||||
|
||||
local function GetReport()
|
||||
local statusreport = REPORT:New("\nMANTIS Status "..self.name)
|
||||
statusreport:Add("+-----------------------------+")
|
||||
statusreport:Add(string.format("+ SAM in RED State: %2d",instatusred))
|
||||
@@ -1912,7 +1923,15 @@ do
|
||||
statusreport:Add(string.format("+ SHORAD active: %2d",activeshorads))
|
||||
end
|
||||
statusreport:Add("+-----------------------------+")
|
||||
return statusreport
|
||||
end
|
||||
|
||||
if self.debug or self.verbose then
|
||||
local statusreport = GetReport()
|
||||
MESSAGE:New(statusreport:Text(),10):ToAll():ToLog()
|
||||
elseif reporttolog == true then
|
||||
local statusreport = GetReport()
|
||||
MESSAGE:New(statusreport:Text(),10):ToLog()
|
||||
end
|
||||
return self
|
||||
end
|
||||
@@ -2020,7 +2039,7 @@ do
|
||||
self:T({From, Event, To})
|
||||
-- check detection
|
||||
if not self.state2flag then
|
||||
self:_Check(self.Detection,self.DLink)
|
||||
self:_Check(self.Detection,self.DLink,self.logsamstatus)
|
||||
end
|
||||
|
||||
local EWRAlive = self:_CheckAnyEWRAlive()
|
||||
|
||||
@@ -53,6 +53,8 @@
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE.
|
||||
-- Therefore, this class is considered to be deprecated and superseded by the [Functional.Fox](https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Fox.html) class, which provides the same functionality.
|
||||
--
|
||||
|
||||
@@ -603,7 +603,7 @@ RANGE.MenuF10Root = nil
|
||||
|
||||
--- Range script version.
|
||||
-- @field #string version
|
||||
RANGE.version = "2.8.0"
|
||||
RANGE.version = "2.8.1"
|
||||
|
||||
-- TODO list:
|
||||
-- TODO: Verbosity level for messages.
|
||||
@@ -2032,10 +2032,10 @@ function RANGE._OnImpact(weapon, self, playerData, attackHdg, attackAlt, attackV
|
||||
|
||||
-- Smoke impact point of bomb.
|
||||
if playerData and playerData.smokebombimpact and insidezone then
|
||||
if playerData and playerData.delaysmoke then
|
||||
timer.scheduleFunction( self._DelayedSmoke, { coord = impactcoord, color = playerData.smokecolor }, timer.getTime() + self.TdelaySmoke )
|
||||
if playerData.delaysmoke then
|
||||
impactcoord:Smoke(playerData.smokecolor, 30, self.TdelaySmoke)
|
||||
else
|
||||
impactcoord:Smoke( playerData.smokecolor )
|
||||
impactcoord:Smoke(playerData.smokecolor, 30)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2102,7 +2102,12 @@ function RANGE._OnImpact(weapon, self, playerData, attackHdg, attackAlt, attackV
|
||||
result.attackHdg = attackHdg
|
||||
result.attackVel = attackVel
|
||||
result.attackAlt = attackAlt
|
||||
result.date=os and os.date() or "n/a"
|
||||
if os and os.date then
|
||||
result.date=os.date()
|
||||
else
|
||||
self:E(self.lid.."os or os.date() not available")
|
||||
result.date = "n/a"
|
||||
end
|
||||
|
||||
-- Add to table.
|
||||
table.insert( _results, result )
|
||||
@@ -2635,13 +2640,6 @@ end
|
||||
-- Display Messages
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--- Start smoking a coordinate with a delay.
|
||||
-- @param #table _args Argements passed.
|
||||
function RANGE._DelayedSmoke( _args )
|
||||
_args.coord:Smoke(_args.color)
|
||||
--trigger.action.smoke( _args.coord:GetVec3(), _args.color )
|
||||
end
|
||||
|
||||
--- Display top 10 stafing results of a specific player.
|
||||
-- @param #RANGE self
|
||||
-- @param #string _unitName Name of the player unit.
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
--
|
||||
-- # Developer Note
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE
|
||||
-- Therefore, this class is considered to be deprecated
|
||||
--
|
||||
|
||||
@@ -501,6 +501,7 @@ ATIS.Alphabet = {
|
||||
-- @field #number Kola +15° (East).
|
||||
-- @field #number Afghanistan +3° (East).
|
||||
-- @field #number Iraq +4.4° (East).
|
||||
-- @field #number GermanyCW +0.1° (East).
|
||||
ATIS.RunwayM2T = {
|
||||
Caucasus = 0,
|
||||
Nevada = 12,
|
||||
@@ -513,7 +514,8 @@ ATIS.RunwayM2T = {
|
||||
SinaiMap = 5,
|
||||
Kola = 15,
|
||||
Afghanistan = 3,
|
||||
Iraq=4.4
|
||||
Iraq=4.4,
|
||||
GermanyCW=0.1,
|
||||
}
|
||||
|
||||
--- Whether ICAO phraseology is used for ATIS broadcasts.
|
||||
@@ -530,6 +532,7 @@ ATIS.RunwayM2T = {
|
||||
-- @field #boolean Kola true.
|
||||
-- @field #boolean Afghanistan true.
|
||||
-- @field #boolean Iraq true.
|
||||
-- @field #boolean GermanyCW true.
|
||||
ATIS.ICAOPhraseology = {
|
||||
Caucasus = true,
|
||||
Nevada = false,
|
||||
@@ -543,6 +546,7 @@ ATIS.ICAOPhraseology = {
|
||||
Kola = true,
|
||||
Afghanistan = true,
|
||||
Iraq = true,
|
||||
GermanyCW = true,
|
||||
}
|
||||
|
||||
--- Nav point data.
|
||||
@@ -2794,7 +2798,7 @@ function ATIS:onafterBroadcast( From, Event, To )
|
||||
|
||||
end
|
||||
_RUNACT = subtitle
|
||||
alltext = alltext .. ";\n" .. subtitle
|
||||
--alltext = alltext .. ";\n" .. subtitle
|
||||
|
||||
-- Runway length.
|
||||
if self.rwylength then
|
||||
|
||||
@@ -1731,10 +1731,10 @@ AIRBOSS.Difficulty = {
|
||||
-- @field #table trapsheet Groove data table recorded every 0.5 seconds.
|
||||
-- @field #boolean trapon If true, save trap sheets.
|
||||
-- @field #string debriefschedulerID Debrief scheduler ID.
|
||||
--
|
||||
--
|
||||
-- @field Sound.SRS#MSRS SRS
|
||||
-- @field Sound.SRS#MSRSQUEUE SRSQ
|
||||
--
|
||||
--
|
||||
-- @extends #AIRBOSS.FlightGroup
|
||||
|
||||
--- Main group level radio menu: F10 Other/Airboss.
|
||||
@@ -1912,6 +1912,9 @@ function AIRBOSS:New( carriername, alias )
|
||||
-- Set max section members. Default 2.
|
||||
self:SetMaxSectionSize()
|
||||
|
||||
-- Set max section distance. Default 100 meters.
|
||||
self:SetMaxSectionDistance()
|
||||
|
||||
-- Set max flights per stack. Default is 2.
|
||||
self:SetMaxFlightsPerStack()
|
||||
|
||||
@@ -2539,7 +2542,7 @@ function AIRBOSS:AddRecoveryWindow( starttime, stoptime, case, holdingoffset, tu
|
||||
return self
|
||||
end
|
||||
if Tstop <= Tnow then
|
||||
string.format( "WARNING: Recovery stop time %s already over. Tnow=%s! Recovery window rejected.", UTILS.SecondsToClock( Tstop ), UTILS.SecondsToClock( Tnow ) )
|
||||
string.format( "WARNING: Recovery stop time %s already over. Tnow=%s! Recovery window rejected.", UTILS.SecondsToClock( Tstop ), UTILS.SecondsToClock( Tnow ) )
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -3066,7 +3069,7 @@ end
|
||||
-- @param #number Port Port of the SRS server, defaults to 5002.
|
||||
-- @param #string Culture (Optional, Airboss Culture) Culture, defaults to "en-US".
|
||||
-- @param #string Gender (Optional, Airboss Gender) Gender, e.g. "male" or "female". Defaults to "male".
|
||||
-- @param #string Voice (Optional, Airboss Voice) Set to use a specific voice. Will **override gender and culture** settings.
|
||||
-- @param #string Voice (Optional, Airboss Voice) Set to use a specific voice. Will **override gender and culture** settings.
|
||||
-- @param #string GoogleCreds (Optional) Path to Google credentials, e.g. "C:\\Program Files\\DCS-SimpleRadio-Standalone\\yourgooglekey.json".
|
||||
-- @param #number Volume (Optional) E.g. 0.75. Defaults to 1.0 (loudest).
|
||||
-- @param #table AltBackend (Optional) See MSRS for details.
|
||||
@@ -3098,10 +3101,10 @@ function AIRBOSS:EnableSRS(PathToSRS,Port,Culture,Gender,Voice,GoogleCreds,Volum
|
||||
-- SRSQUEUE
|
||||
self.SRSQ = MSRSQUEUE:New("AIRBOSS")
|
||||
self.SRSQ:SetTransmitOnlyWithPlayers(true)
|
||||
if not self.PilotRadio then
|
||||
if not self.PilotRadio then
|
||||
self:SetSRSPilotVoice()
|
||||
end
|
||||
return self
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set LSO radio frequency and modulation. Default frequency is 264 MHz AM.
|
||||
@@ -3344,6 +3347,22 @@ function AIRBOSS:SetMaxSectionSize( nmax )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set maximum distance up to which section members are allowed (default: 100 meters).
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number dmax Max distance in meters (default 100 m). Minimum is 10 m, maximum is 5000 m.
|
||||
-- @return #AIRBOSS self
|
||||
function AIRBOSS:SetMaxSectionDistance( dmax )
|
||||
if dmax then
|
||||
if dmax < 10 then
|
||||
dmax = 10
|
||||
elseif dmax > 5000 then
|
||||
dmax = 5000
|
||||
end
|
||||
end
|
||||
self.maxsectiondistance = dmax or 100
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set max number of flights per stack. All members of a section count as one "flight".
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #number nmax Number of max allowed flights per stack. Default is two. Minimum is one, maximum is 4.
|
||||
@@ -11598,7 +11617,7 @@ function AIRBOSS:GetHeadingIntoWind_old( vdeck, magnetic, coord )
|
||||
local function adjustDegreesForWindSpeed(windSpeed)
|
||||
local degreesAdjustment = 0
|
||||
-- the windspeeds are in m/s
|
||||
|
||||
|
||||
-- +0 degrees at 15m/s = 37kts
|
||||
-- +0 degrees at 14m/s = 35kts
|
||||
-- +0 degrees at 13m/s = 33kts
|
||||
@@ -11613,7 +11632,7 @@ function AIRBOSS:GetHeadingIntoWind_old( vdeck, magnetic, coord )
|
||||
-- +20 degrees at 4m/s = 26kts
|
||||
-- +20 degrees at 3m/s = 26kts
|
||||
-- +30 degrees at 2m/s = 26kts 1s
|
||||
|
||||
|
||||
if windSpeed > 0 and windSpeed < 3 then
|
||||
degreesAdjustment = 30
|
||||
elseif windSpeed >= 3 and windSpeed < 5 then
|
||||
@@ -11625,7 +11644,7 @@ function AIRBOSS:GetHeadingIntoWind_old( vdeck, magnetic, coord )
|
||||
elseif windSpeed >= 13 then
|
||||
degreesAdjustment = 0
|
||||
end
|
||||
|
||||
|
||||
return degreesAdjustment
|
||||
end
|
||||
|
||||
@@ -11684,60 +11703,60 @@ function AIRBOSS:GetHeadingIntoWind_new( vdeck, magnetic, coord )
|
||||
local h=self:GetHeading(magnetic)
|
||||
return h, math.min(vdeck, Vmax)
|
||||
end
|
||||
|
||||
|
||||
-- Convert wind speed to knots.
|
||||
vwind=UTILS.MpsToKnots(vwind)
|
||||
|
||||
|
||||
-- Wind to in knots.
|
||||
local windto=(windfrom+180)%360
|
||||
|
||||
|
||||
-- Offset angle in rad. We also define the rotation to be clock-wise, which requires a minus sign.
|
||||
local alpha=math.rad(-Offset)
|
||||
|
||||
|
||||
-- Constant.
|
||||
local C = math.sqrt(math.cos(alpha)^2 / math.sin(alpha)^2 + 1)
|
||||
|
||||
|
||||
|
||||
-- Upper limit of desired speed due to max boat speed.
|
||||
local vdeckMax=vwind + math.cos(alpha) * Vmax
|
||||
|
||||
|
||||
-- Lower limit of desired speed due to min boat speed.
|
||||
local vdeckMin=vwind + math.cos(alpha) * Vmin
|
||||
|
||||
|
||||
|
||||
|
||||
-- Speed of ship so it matches the desired speed.
|
||||
local v=0
|
||||
|
||||
-- Angle wrt. to wind TO-direction
|
||||
|
||||
-- Angle wrt. to wind TO-direction
|
||||
local theta=0
|
||||
|
||||
if vdeck>vdeckMax then
|
||||
-- Boat cannot go fast enough
|
||||
|
||||
|
||||
-- Set max speed.
|
||||
v=Vmax
|
||||
|
||||
|
||||
-- Calculate theta.
|
||||
theta = math.asin(v/(vwind*C)) - math.asin(-1/C)
|
||||
|
||||
|
||||
elseif vdeck<vdeckMin then
|
||||
-- Boat cannot go slow enought
|
||||
|
||||
|
||||
-- Set min speed.
|
||||
v=Vmin
|
||||
|
||||
|
||||
-- Calculatge theta.
|
||||
theta = math.asin(v/(vwind*C)) - math.asin(-1/C)
|
||||
|
||||
|
||||
elseif vdeck*math.sin(alpha)>vwind then
|
||||
-- Too little wind
|
||||
|
||||
|
||||
-- Set theta to 90°
|
||||
theta=math.pi/2
|
||||
|
||||
|
||||
-- Set speed.
|
||||
v = math.sqrt(vdeck^2 - vwind^2)
|
||||
|
||||
|
||||
else
|
||||
-- Normal case
|
||||
theta = math.asin(vdeck * math.sin(alpha) / vwind)
|
||||
@@ -11746,9 +11765,9 @@ function AIRBOSS:GetHeadingIntoWind_new( vdeck, magnetic, coord )
|
||||
|
||||
-- Magnetic heading.
|
||||
local magvar= magnetic and self.magvar or 0
|
||||
|
||||
|
||||
-- Ship heading so cross wind is min for the given wind.
|
||||
local intowind = (540 + (windto - magvar + math.deg(theta) )) % 360
|
||||
local intowind = (540 + (windto - magvar + math.deg(theta) )) % 360
|
||||
|
||||
return intowind, v
|
||||
end
|
||||
@@ -12206,7 +12225,7 @@ function AIRBOSS:_LSOgrade( playerData )
|
||||
-- Normal laning part at the beginning
|
||||
local Gb = GXX .. " " .. GIM
|
||||
|
||||
-- Number of deviations that occurred at the the beginning of the landing (XX or IM). These are graded like in non-VTOL landings, i.e. on deviations is
|
||||
-- Number of deviations that occurred at the the beginning of the landing (XX or IM). These are graded like in non-VTOL landings, i.e. on deviations is
|
||||
local N=nXX+nIM
|
||||
local nL=count(Gb, '_')/2
|
||||
local nS=count(Gb, '%(')
|
||||
@@ -12224,7 +12243,7 @@ function AIRBOSS:_LSOgrade( playerData )
|
||||
|
||||
if nL>0 or nLv>1 then
|
||||
-- Larger deviations at XX or IM or at least one larger deviation IC or AR==> "No grade" 2.0 points.
|
||||
-- In other words, we allow one larger deviation at IC+AR
|
||||
-- In other words, we allow one larger deviation at IC+AR
|
||||
grade="--"
|
||||
points=2.0
|
||||
elseif nN>0 or nNv>1 or nLv==1 then
|
||||
@@ -13720,7 +13739,7 @@ function AIRBOSS:CarrierTurnIntoWind( time, vdeck, uturn )
|
||||
local deltaH = self:_GetDeltaHeading( hdg, hiw )
|
||||
|
||||
-- Debug output
|
||||
self:I( self.lid .. string.format( "Carrier steaming into the wind (%.1f kts). Heading=%03d-->%03d (Delta=%.1f), Speed=%.1f knots, Distance=%.1f NM, Time=%d sec",
|
||||
self:I( self.lid .. string.format( "Carrier steaming into the wind (%.1f kts). Heading=%03d-->%03d (Delta=%.1f), Speed=%.1f knots, Distance=%.1f NM, Time=%d sec",
|
||||
UTILS.MpsToKnots( vwind ), hdg, hiw, deltaH, speedknots, distNM, speedknots, time ) )
|
||||
|
||||
-- Current coordinate.
|
||||
@@ -14932,12 +14951,12 @@ function AIRBOSS:RadioTransmission( radio, call, loud, delay, interval, click, p
|
||||
if radio == nil or call == nil then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if not self.SRS then
|
||||
|
||||
|
||||
-- Create a new radio transmission item.
|
||||
local transmission = {} -- #AIRBOSS.Radioitem
|
||||
|
||||
|
||||
transmission.radio = radio
|
||||
transmission.call = call
|
||||
transmission.Tplay = timer.getAbsTime() + (delay or 0)
|
||||
@@ -14945,49 +14964,49 @@ function AIRBOSS:RadioTransmission( radio, call, loud, delay, interval, click, p
|
||||
transmission.isplaying = false
|
||||
transmission.Tstarted = nil
|
||||
transmission.loud = loud and call.loud
|
||||
|
||||
|
||||
-- Player onboard number if sender has one.
|
||||
if self:_IsOnboard( call.modexsender ) then
|
||||
self:_Number2Radio( radio, call.modexsender, delay, 0.3, pilotcall )
|
||||
end
|
||||
|
||||
|
||||
-- Play onboard number if receiver has one.
|
||||
if self:_IsOnboard( call.modexreceiver ) then
|
||||
self:_Number2Radio( radio, call.modexreceiver, delay, 0.3, pilotcall )
|
||||
end
|
||||
|
||||
|
||||
-- Add transmission to the right queue.
|
||||
local caller = ""
|
||||
if radio.alias == "LSO" then
|
||||
|
||||
|
||||
table.insert( self.RQLSO, transmission )
|
||||
|
||||
|
||||
caller = "LSOCall"
|
||||
|
||||
|
||||
-- Schedule radio queue checks.
|
||||
if not self.RQLid then
|
||||
self:T( self.lid .. string.format( "Starting LSO radio queue." ) )
|
||||
self.RQLid = self.radiotimer:Schedule( nil, AIRBOSS._CheckRadioQueue, { self, self.RQLSO, "LSO" }, 0.02, 0.05 )
|
||||
end
|
||||
|
||||
|
||||
elseif radio.alias == "MARSHAL" then
|
||||
|
||||
|
||||
table.insert( self.RQMarshal, transmission )
|
||||
|
||||
|
||||
caller = "MarshalCall"
|
||||
|
||||
|
||||
if not self.RQMid then
|
||||
self:T( self.lid .. string.format( "Starting Marhal radio queue." ) )
|
||||
self.RQMid = self.radiotimer:Schedule( nil, AIRBOSS._CheckRadioQueue, { self, self.RQMarshal, "MARSHAL" }, 0.02, 0.05 )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- Append radio click sound at the end of the transmission.
|
||||
if click then
|
||||
self:RadioTransmission( radio, self[caller].CLICK, false, delay )
|
||||
end
|
||||
|
||||
|
||||
else
|
||||
|
||||
-- SRS transmission
|
||||
@@ -14998,7 +15017,7 @@ function AIRBOSS:RadioTransmission( radio, call, loud, delay, interval, click, p
|
||||
local voice = nil
|
||||
local gender = nil
|
||||
local culture = nil
|
||||
|
||||
|
||||
if radio.alias == "AIRBOSS" then
|
||||
frequency = self.AirbossRadio.frequency
|
||||
modulation = self.AirbossRadio.modulation
|
||||
@@ -15006,13 +15025,13 @@ function AIRBOSS:RadioTransmission( radio, call, loud, delay, interval, click, p
|
||||
gender = self.AirbossRadio.gender
|
||||
culture = self.AirbossRadio.culture
|
||||
end
|
||||
|
||||
|
||||
if radio.alias == "MARSHAL" then
|
||||
voice = self.MarshalRadio.voice
|
||||
gender = self.MarshalRadio.gender
|
||||
culture = self.MarshalRadio.culture
|
||||
end
|
||||
|
||||
|
||||
if radio.alias == "LSO" then
|
||||
frequency = self.LSORadio.frequency
|
||||
modulation = self.LSORadio.modulation
|
||||
@@ -15020,7 +15039,7 @@ function AIRBOSS:RadioTransmission( radio, call, loud, delay, interval, click, p
|
||||
gender = self.LSORadio.gender
|
||||
culture = self.LSORadio.culture
|
||||
end
|
||||
|
||||
|
||||
if pilotcall then
|
||||
voice = self.PilotRadio.voice
|
||||
gender = self.PilotRadio.gender
|
||||
@@ -15034,16 +15053,16 @@ function AIRBOSS:RadioTransmission( radio, call, loud, delay, interval, click, p
|
||||
modulation = self.AirbossRadio.modulation
|
||||
radio.alias = "AIRBOSS"
|
||||
end
|
||||
|
||||
|
||||
local volume = nil
|
||||
|
||||
|
||||
if loud then
|
||||
volume = 1.0
|
||||
end
|
||||
|
||||
|
||||
--local text = tostring(call.modexreceiver).."; "..radio.alias.."; "..call.subtitle
|
||||
local text = call.subtitle
|
||||
self:T(self.lid..text)
|
||||
self:T(self.lid..text)
|
||||
local srstext = self:_GetNiceSRSText(text)
|
||||
self.SRSQ:NewTransmission(srstext, call.duration, self.SRS, nil, 0.1, nil, call.subtitle, call.subduration, frequency, modulation, gender, culture, voice, volume, radio.alias)
|
||||
end
|
||||
@@ -15063,11 +15082,11 @@ function AIRBOSS:SetSRSPilotVoice( Voice, Gender, Culture )
|
||||
self.PilotRadio.voice = Voice or MSRS.Voices.Microsoft.David
|
||||
self.PilotRadio.gender = Gender or "male"
|
||||
self.PilotRadio.culture = Culture or "en-US"
|
||||
|
||||
|
||||
if (not Voice) and self.SRS and self.SRS:GetProvider() == MSRS.Provider.GOOGLE then
|
||||
self.PilotRadio.voice = MSRS.Voices.Google.Standard.en_US_Standard_J
|
||||
end
|
||||
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -15381,44 +15400,44 @@ function AIRBOSS:MessageToPlayer( playerData, message, sender, receiver, duratio
|
||||
-- SCHEDULER:New(nil, self.MessageToPlayer, {self, playerData, message, sender, receiver, duration, clear}, delay)
|
||||
self:ScheduleOnce( delay, self.MessageToPlayer, self, playerData, message, sender, receiver, duration, clear )
|
||||
else
|
||||
|
||||
|
||||
if not self.SRS then
|
||||
-- Wait until previous sound finished.
|
||||
local wait = 0
|
||||
|
||||
|
||||
-- Onboard number to get the attention.
|
||||
if receiver == playerData.onboard then
|
||||
|
||||
|
||||
-- Which voice over number to use.
|
||||
if sender and (sender == "LSO" or sender == "MARSHAL" or sender == "AIRBOSS") then
|
||||
|
||||
|
||||
-- User sound of board number.
|
||||
wait = wait + self:_Number2Sound( playerData, sender, receiver )
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Negative.
|
||||
if string.find( text:lower(), "negative" ) then
|
||||
local filename = self:_RadioFilename( self.MarshalCall.NEGATIVE, false, "MARSHAL" )
|
||||
USERSOUND:New( filename ):ToGroup( playerData.group, wait )
|
||||
wait = wait + self.MarshalCall.NEGATIVE.duration
|
||||
end
|
||||
|
||||
|
||||
-- Affirm.
|
||||
if string.find( text:lower(), "affirm" ) then
|
||||
local filename = self:_RadioFilename( self.MarshalCall.AFFIRMATIVE, false, "MARSHAL" )
|
||||
USERSOUND:New( filename ):ToGroup( playerData.group, wait )
|
||||
wait = wait + self.MarshalCall.AFFIRMATIVE.duration
|
||||
end
|
||||
|
||||
|
||||
-- Roger.
|
||||
if string.find( text:lower(), "roger" ) then
|
||||
local filename = self:_RadioFilename( self.MarshalCall.ROGER, false, "MARSHAL" )
|
||||
USERSOUND:New( filename ):ToGroup( playerData.group, wait )
|
||||
wait = wait + self.MarshalCall.ROGER.duration
|
||||
end
|
||||
|
||||
|
||||
-- Play click sound to end message.
|
||||
if wait > 0 then
|
||||
local filename = self:_RadioFilename( self.MarshalCall.CLICK )
|
||||
@@ -15431,7 +15450,7 @@ function AIRBOSS:MessageToPlayer( playerData, message, sender, receiver, duratio
|
||||
local voice = self.MarshalRadio.voice
|
||||
local gender = self.MarshalRadio.gender
|
||||
local culture = self.MarshalRadio.culture
|
||||
|
||||
|
||||
if not sender then sender = "AIRBOSS" end
|
||||
|
||||
if string.find(sender,"AIRBOSS" ) then
|
||||
@@ -17049,7 +17068,7 @@ function AIRBOSS:_RemoveSectionMember( playerData, sectionmember )
|
||||
return false
|
||||
end
|
||||
|
||||
--- Set all flights within 100 meters to be part of my section.
|
||||
--- Set all flights within maxsectiondistance meters to be part of my section (default: 100 meters).
|
||||
-- @param #AIRBOSS self
|
||||
-- @param #string _unitName Name of the player unit.
|
||||
function AIRBOSS:_SetSection( _unitName )
|
||||
@@ -17067,7 +17086,7 @@ function AIRBOSS:_SetSection( _unitName )
|
||||
local mycoord = _unit:GetCoordinate()
|
||||
|
||||
-- Max distance up to which section members are allowed.
|
||||
local dmax = 100
|
||||
local dmax = self.maxsectiondistance
|
||||
|
||||
-- Check if player is in Marshal or pattern queue already.
|
||||
local text
|
||||
|
||||
@@ -1717,7 +1717,7 @@ end
|
||||
|
||||
--- **[AIR]** Create a STRIKE mission. Flight will attack the closest map object to the specified coordinate.
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Core.Point#COORDINATE Target The target coordinate. Can also be given as a GROUP, UNIT, STATIC or TARGET object.
|
||||
-- @param Core.Point#COORDINATE Target The target coordinate. Can also be given as a GROUP, UNIT, STATIC, SET_GROUP, SET_UNIT, SET_STATIC or TARGET object.
|
||||
-- @param #number Altitude Engage altitude in feet. Default 2000 ft.
|
||||
-- @param #number EngageWeaponType Which weapon to use. Defaults to auto, ie ENUMS.WeaponFlag.Auto. See ENUMS.WeaponFlag for options.
|
||||
-- @return #AUFTRAG self
|
||||
@@ -1749,7 +1749,7 @@ end
|
||||
--- **[AIR]** Create a BOMBING mission. Flight will drop bombs a specified coordinate.
|
||||
-- See [DCS task bombing](https://wiki.hoggitworld.com/view/DCS_task_bombing).
|
||||
-- @param #AUFTRAG self
|
||||
-- @param Core.Point#COORDINATE Target Target coordinate. Can also be specified as a GROUP, UNIT, STATIC or TARGET object.
|
||||
-- @param Core.Point#COORDINATE Target Target coordinate. Can also be specified as a GROUP, UNIT, STATIC, SET_GROUP, SET_UNIT, SET_STATIC or TARGET object.
|
||||
-- @param #number Altitude Engage altitude in feet. Default 25000 ft.
|
||||
-- @param #number EngageWeaponType Which weapon to use. Defaults to auto, ie ENUMS.WeaponFlag.Auto. See ENUMS.WeaponFlag for options.
|
||||
-- @return #AUFTRAG self
|
||||
@@ -6108,10 +6108,13 @@ function AUFTRAG:GetDCSMissionTask()
|
||||
-- BOMBING Mission --
|
||||
---------------------
|
||||
|
||||
local DCStask=CONTROLLABLE.TaskBombing(nil, self:GetTargetVec2(), self.engageAsGroup, self.engageWeaponExpend, self.engageQuantity, self.engageDirection, self.engageAltitude, self.engageWeaponType, Divebomb)
|
||||
local coords = self.engageTarget:GetCoordinates()
|
||||
for _, coord in pairs(coords) do
|
||||
local DCStask = CONTROLLABLE.TaskBombing(nil, coord:GetVec2(), self.engageAsGroup, self.engageWeaponExpend, self.engageQuantity, self.engageDirection, self.engageAltitude, self.engageWeaponType)
|
||||
|
||||
table.insert(DCStasks, DCStask)
|
||||
end
|
||||
|
||||
table.insert(DCStasks, DCStask)
|
||||
|
||||
elseif self.type==AUFTRAG.Type.STRAFING then
|
||||
|
||||
----------------------
|
||||
@@ -6311,9 +6314,12 @@ function AUFTRAG:GetDCSMissionTask()
|
||||
-- STRIKE Mission --
|
||||
--------------------
|
||||
|
||||
local DCStask=CONTROLLABLE.TaskAttackMapObject(nil, self:GetTargetVec2(), self.engageAsGroup, self.engageWeaponExpend, self.engageQuantity, self.engageDirection, self.engageAltitude, self.engageWeaponType)
|
||||
local coords = self.engageTarget:GetCoordinates()
|
||||
for _, coord in pairs(coords) do
|
||||
local DCStask=CONTROLLABLE.TaskAttackMapObject(nil, coord:GetVec2(), self.engageAsGroup, self.engageWeaponExpend, self.engageQuantity, self.engageDirection, self.engageAltitude, self.engageWeaponType)
|
||||
|
||||
table.insert(DCStasks, DCStask)
|
||||
table.insert(DCStasks, DCStask)
|
||||
end
|
||||
|
||||
elseif self.type==AUFTRAG.Type.TANKER or self.type==AUFTRAG.Type.RECOVERYTANKER then
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
-- @image OPS_CSAR.jpg
|
||||
|
||||
---
|
||||
-- Last Update Jan 2025
|
||||
-- Last Update May 2025
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
--- **CSAR** class, extends Core.Base#BASE, Core.Fsm#FSM
|
||||
@@ -313,7 +313,7 @@ CSAR.AircraftType["CH-47Fbl1"] = 31
|
||||
|
||||
--- CSAR class version.
|
||||
-- @field #string version
|
||||
CSAR.version="1.0.30"
|
||||
CSAR.version="1.0.32"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ToDo list
|
||||
@@ -468,7 +468,7 @@ function CSAR:New(Coalition, Template, Alias)
|
||||
-- added 1.0.15
|
||||
self.allowbronco = false -- set to true to use the Bronco mod as a CSAR plane
|
||||
|
||||
self.ADFRadioPwr = 1000
|
||||
self.ADFRadioPwr = 500
|
||||
|
||||
-- added 1.0.16
|
||||
self.PilotWeight = 80
|
||||
@@ -2120,7 +2120,11 @@ end
|
||||
function CSAR:_GetClosestMASH(_heli)
|
||||
self:T(self.lid .. " _GetClosestMASH")
|
||||
local _mashset = self.mash -- Core.Set#SET_GROUP
|
||||
local _mashes = _mashset:GetSetObjects() -- #table
|
||||
local MashSets = {}
|
||||
--local _mashes = _mashset.Set-- #table
|
||||
table.insert(MashSets,_mashset.Set)
|
||||
table.insert(MashSets,self.zonemashes.Set)
|
||||
table.insert(MashSets,self.staticmashes.Set)
|
||||
local _shortestDistance = -1
|
||||
local _distance = 0
|
||||
local _helicoord = _heli:GetCoordinate()
|
||||
@@ -2151,14 +2155,19 @@ function CSAR:_GetClosestMASH(_heli)
|
||||
_shortestDistance = distance
|
||||
end
|
||||
|
||||
for _, _mashUnit in pairs(_mashes) do
|
||||
if _mashUnit and _mashUnit:IsAlive() then
|
||||
local _mashcoord = _mashUnit:GetCoordinate()
|
||||
_distance = self:_GetDistance(_helicoord, _mashcoord)
|
||||
if _distance ~= nil and (_shortestDistance == -1 or _distance < _shortestDistance) then
|
||||
_shortestDistance = _distance
|
||||
end
|
||||
end
|
||||
for _,_mashes in pairs(MashSets) do
|
||||
for _, _mashUnit in pairs(_mashes or {}) do
|
||||
local _mashcoord
|
||||
if _mashUnit and (not _mashUnit:IsInstanceOf("ZONE_BASE")) and _mashUnit:IsAlive() then
|
||||
_mashcoord = _mashUnit:GetCoordinate()
|
||||
elseif _mashUnit and _mashUnit:IsInstanceOf("ZONE_BASE") then
|
||||
_mashcoord = _mashUnit:GetCoordinate()
|
||||
end
|
||||
_distance = self:_GetDistance(_helicoord, _mashcoord)
|
||||
if _distance ~= nil and (_shortestDistance == -1 or _distance < _shortestDistance) then
|
||||
_shortestDistance = _distance
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if _shortestDistance ~= -1 then
|
||||
@@ -2166,6 +2175,7 @@ function CSAR:_GetClosestMASH(_heli)
|
||||
else
|
||||
return -1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- (Internal) Display onboarded rescued pilots.
|
||||
@@ -2323,9 +2333,9 @@ end
|
||||
-- @param #CSAR self
|
||||
-- @param Wrapper.Group#GROUP _group Group #GROUP object.
|
||||
-- @param #number _freq Frequency to use
|
||||
-- @param #string _name Beacon Name to use
|
||||
-- @param #string BeaconName Beacon Name to use
|
||||
-- @return #CSAR self
|
||||
function CSAR:_AddBeaconToGroup(_group, _freq, _name)
|
||||
function CSAR:_AddBeaconToGroup(_group, _freq, BeaconName)
|
||||
self:T(self.lid .. " _AddBeaconToGroup")
|
||||
if self.CreateRadioBeacons == false then return end
|
||||
local _group = _group
|
||||
@@ -2346,10 +2356,11 @@ function CSAR:_AddBeaconToGroup(_group, _freq, _name)
|
||||
if _radioUnit then
|
||||
local name = _radioUnit:GetName()
|
||||
local Frequency = _freq -- Freq in Hertz
|
||||
local name = _radioUnit:GetName()
|
||||
--local name = _radioUnit:GetName()
|
||||
local Sound = "l10n/DEFAULT/"..self.radioSound
|
||||
local vec3 = _radioUnit:GetVec3() or _radioUnit:GetPositionVec3() or {x=0,y=0,z=0}
|
||||
trigger.action.radioTransmission(Sound, vec3, 0, false, Frequency, self.ADFRadioPwr or 1000,_name) -- Beacon in MP only runs for exactly 30secs straight
|
||||
self:I(self.lid..string.format("Added Radio Beacon %d Hertz | Name %s | Position {%d,%d,%d}",Frequency,BeaconName,vec3.x,vec3.y,vec3.z))
|
||||
trigger.action.radioTransmission(Sound, vec3, 0, true, Frequency, self.ADFRadioPwr or 500,BeaconName) -- Beacon in MP only runs for exactly 30secs straight
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2370,9 +2381,13 @@ function CSAR:_RefreshRadioBeacons()
|
||||
local group = pilot.group
|
||||
local frequency = pilot.frequency or 0 -- thanks to @Thrud
|
||||
local bname = pilot.BeaconName or pilot.name..math.random(1,100000)
|
||||
trigger.action.stopRadioTransmission(bname)
|
||||
--trigger.action.stopRadioTransmission(bname)
|
||||
if group and group:IsAlive() and frequency > 0 then
|
||||
self:_AddBeaconToGroup(group,frequency,bname)
|
||||
--self:_AddBeaconToGroup(group,frequency,bname)
|
||||
else
|
||||
if frequency > 0 then
|
||||
trigger.action.stopRadioTransmission(bname)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2454,9 +2469,10 @@ function CSAR:onafterStart(From, Event, To)
|
||||
|
||||
self.mash = SET_GROUP:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterStart()
|
||||
|
||||
local staticmashes = SET_STATIC:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterOnce()
|
||||
local zonemashes = SET_ZONE:New():FilterPrefixes(self.mashprefix):FilterOnce()
|
||||
self.staticmashes = SET_STATIC:New():FilterCoalitions(self.coalitiontxt):FilterPrefixes(self.mashprefix):FilterOnce()
|
||||
self.zonemashes = SET_ZONE:New():FilterPrefixes(self.mashprefix):FilterOnce()
|
||||
|
||||
--[[
|
||||
if staticmashes:Count() > 0 then
|
||||
for _,_mash in pairs(staticmashes.Set) do
|
||||
self.mash:AddObject(_mash)
|
||||
@@ -2464,10 +2480,13 @@ function CSAR:onafterStart(From, Event, To)
|
||||
end
|
||||
|
||||
if zonemashes:Count() > 0 then
|
||||
self:T("Adding zones to self.mash SET")
|
||||
for _,_mash in pairs(zonemashes.Set) do
|
||||
self.mash:AddObject(_mash)
|
||||
end
|
||||
self:T("Objects in SET: "..self.mash:Count())
|
||||
end
|
||||
--]]
|
||||
|
||||
if not self.coordinate then
|
||||
local csarhq = self.mash:GetRandom()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -62,6 +62,7 @@
|
||||
-- @field #number repeatsonfailure
|
||||
-- @field Core.Set#SET_ZONE GoZoneSet
|
||||
-- @field Core.Set#SET_ZONE NoGoZoneSet
|
||||
-- @field Core.Set#SET_ZONE ConflictZoneSet
|
||||
-- @field #boolean Monitor
|
||||
-- @field #boolean TankerInvisible
|
||||
-- @field #number CapFormation
|
||||
@@ -69,6 +70,7 @@
|
||||
-- @field #boolean DespawnAfterLanding
|
||||
-- @field #boolean DespawnAfterHolding
|
||||
-- @field #list<Ops.Auftrag#AUFTRAG> ListOfAuftrag
|
||||
-- @field #string defaulttakeofftype Take off type
|
||||
-- @extends Core.Fsm#FSM
|
||||
|
||||
--- *“Airspeed, altitude, and brains. Two are always needed to successfully complete the flight.”* -- Unknown.
|
||||
@@ -102,6 +104,11 @@
|
||||
-- Next put a late activated template group for your CAP/GCI Squadron on the map. Last, put a zone on the map for the CAP operations, let's name it "Blue Zone 1". Size of the zone plays no role.
|
||||
-- Put an EW radar system on the map and name it aptly, like "Blue EWR".
|
||||
--
|
||||
-- ### Zones
|
||||
--
|
||||
-- For our example, you create a RED and a BLUE border, as a closed polygonal zone representing the borderlines. You can also have conflict zone, where - for our example - BLUE will attack
|
||||
-- RED planes, despite being on RED territory. Think of a no-fly zone or an limited area of engagement. Conflict zones take precedence over borders, i.e. they can overlap all borders.
|
||||
--
|
||||
-- ### Code it
|
||||
--
|
||||
-- -- Set up a basic system for the blue side, we'll reside on Kutaisi, and use GROUP objects with "Blue EWR" in the name as EW Radar Systems.
|
||||
@@ -114,10 +121,10 @@
|
||||
-- mywing:AddSquadron("Blue Sq1 M2000c","CAP Kutaisi",AIRBASE.Caucasus.Kutaisi,20,AI.Skill.GOOD,102,"ec1.5_Vendee_Jeanne_clean")
|
||||
--
|
||||
-- -- Add a couple of zones
|
||||
-- -- We'll defend our border
|
||||
-- -- We'll defend our own border
|
||||
-- mywing:AddAcceptZone(ZONE_POLYGON:New( "Blue Border", GROUP:FindByName( "Blue Border" ) ))
|
||||
-- -- We'll attack intruders also here
|
||||
-- mywing:AddAcceptZone(ZONE_POLYGON:New("Red Defense Zone", GROUP:FindByName( "Red Defense Zone" )))
|
||||
-- -- We'll attack intruders also here - conflictzones can overlap borders(!) - limited zone of engagement
|
||||
-- mywing:AddConflictZone(ZONE_POLYGON:New("Red Defense Zone", GROUP:FindByName( "Red Defense Zone" )))
|
||||
-- -- We'll leave the reds alone on their turf
|
||||
-- mywing:AddRejectZone(ZONE_POLYGON:New( "Red Border", GROUP:FindByName( "Red Border" ) ))
|
||||
--
|
||||
@@ -125,10 +132,10 @@
|
||||
-- -- Set up borders on map
|
||||
-- local BlueBorder = ZONE_POLYGON:New( "Blue Border", GROUP:FindByName( "Blue Border" ) )
|
||||
-- BlueBorder:DrawZone(-1,{0,0,1},1,FillColor,FillAlpha,1,true)
|
||||
-- local BlueNoGoZone = ZONE_POLYGON:New("Red Defense Zone", GROUP:FindByName( "Red Defense Zone" ))
|
||||
-- BlueNoGoZone:DrawZone(-1,{1,1,0},1,FillColor,FillAlpha,2,true)
|
||||
-- local BlueNoGoZone2 = ZONE_POLYGON:New( "Red Border", GROUP:FindByName( "Red Border" ) )
|
||||
-- BlueNoGoZone2:DrawZone(-1,{1,0,0},1,FillColor,FillAlpha,4,true)
|
||||
-- local ConflictZone = ZONE_POLYGON:New("Red Defense Zone", GROUP:FindByName( "Red Defense Zone" ))
|
||||
-- ConflictZone:DrawZone(-1,{1,1,0},1,FillColor,FillAlpha,2,true)
|
||||
-- local BlueNoGoZone = ZONE_POLYGON:New( "Red Border", GROUP:FindByName( "Red Border" ) )
|
||||
-- BlueNoGoZone:DrawZone(-1,{1,0,0},1,FillColor,FillAlpha,4,true)
|
||||
--
|
||||
-- ### Add a second airwing with squads and own CAP point (optional)
|
||||
--
|
||||
@@ -210,13 +217,15 @@ EASYGCICAP = {
|
||||
repeatsonfailure = 3,
|
||||
GoZoneSet = nil,
|
||||
NoGoZoneSet = nil,
|
||||
ConflictZoneSet = nil,
|
||||
Monitor = false,
|
||||
TankerInvisible = true,
|
||||
CapFormation = nil,
|
||||
ReadyFlightGroups = {},
|
||||
DespawnAfterLanding = false,
|
||||
DespawnAfterHolding = true,
|
||||
ListOfAuftrag = {}
|
||||
ListOfAuftrag = {},
|
||||
defaulttakeofftype = "hot",
|
||||
}
|
||||
|
||||
--- Internal Squadron data type
|
||||
@@ -252,7 +261,7 @@ EASYGCICAP = {
|
||||
|
||||
--- EASYGCICAP class version.
|
||||
-- @field #string version
|
||||
EASYGCICAP.version="0.1.17"
|
||||
EASYGCICAP.version="0.1.21"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -287,6 +296,7 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName)
|
||||
self.airbase = AIRBASE:FindByName(self.airbasename)
|
||||
self.GoZoneSet = SET_ZONE:New()
|
||||
self.NoGoZoneSet = SET_ZONE:New()
|
||||
self.ConflictZoneSet = SET_ZONE:New()
|
||||
self.resurrection = 900
|
||||
self.capspeed = 300
|
||||
self.capalt = 25000
|
||||
@@ -304,6 +314,7 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName)
|
||||
self.DespawnAfterLanding = false
|
||||
self.DespawnAfterHolding = true
|
||||
self.ListOfAuftrag = {}
|
||||
self.defaulttakeofftype = "hot"
|
||||
|
||||
-- Set some string id for output to DCS.log file.
|
||||
self.lid=string.format("EASYGCICAP %s | ", self.alias)
|
||||
@@ -392,6 +403,16 @@ function EASYGCICAP:SetDefaultRepeatOnFailure(Retries)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add default take off type for the airwings.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #string Takeoff Can be "hot", "cold", or "air" - default is "hot".
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:SetDefaultTakeOffType(Takeoff)
|
||||
self:T(self.lid.."SetDefaultTakeOffType")
|
||||
self.defaulttakeofftype = Takeoff or "hot"
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set default CAP Speed in knots
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #number Speed Speed defaults to 300
|
||||
@@ -588,9 +609,8 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
||||
if #self.ManagedREC > 0 then
|
||||
CAP_Wing:SetNumberRecon(1)
|
||||
end
|
||||
--local PatrolCoordinateKutaisi = ZONE:New(CapZoneName):GetCoordinate()
|
||||
--CAP_Wing:AddPatrolPointCAP(PatrolCoordinateKutaisi,self.capalt,UTILS.KnotsToAltKIAS(self.capspeed,self.capalt),self.capdir,self.capleg)
|
||||
CAP_Wing:SetTakeoffHot()
|
||||
|
||||
CAP_Wing:SetTakeoffType(self.defaulttakeofftype)
|
||||
CAP_Wing:SetLowFuelThreshold(0.3)
|
||||
CAP_Wing.RandomAssetScore = math.random(50,100)
|
||||
CAP_Wing:Start()
|
||||
@@ -598,6 +618,9 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
||||
local Intel = self.Intel
|
||||
|
||||
local TankerInvisible = self.TankerInvisible
|
||||
local engagerange = self.engagerange
|
||||
local GoZoneSet = self.GoZoneSet
|
||||
local NoGoZoneSet = self.NoGoZoneSet
|
||||
|
||||
function CAP_Wing:onbeforeFlightOnMission(From, Event, To, Flightgroup, Mission)
|
||||
local flightgroup = Flightgroup -- Ops.FlightGroup#FLIGHTGROUP
|
||||
@@ -611,7 +634,7 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias)
|
||||
flightgroup:GetGroup():SetOptionRadarUsingForContinousSearch()
|
||||
if Mission.type ~= AUFTRAG.Type.TANKER and Mission.type ~= AUFTRAG.Type.AWACS and Mission.type ~= AUFTRAG.Type.RECON then
|
||||
flightgroup:SetDetection(true)
|
||||
flightgroup:SetEngageDetectedOn(self.engagerange,{"Air"},self.GoZoneSet,self.NoGoZoneSet)
|
||||
flightgroup:SetEngageDetectedOn(engagerange,{"Air"},GoZoneSet,NoGoZoneSet)
|
||||
flightgroup:SetOutOfAAMRTB()
|
||||
if CapFormation then
|
||||
flightgroup:GetGroup():SetOption(AI.Option.Air.id.FORMATION,CapFormation)
|
||||
@@ -1113,7 +1136,7 @@ end
|
||||
-- @param Core.Zone#ZONE_BASE Zone
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:AddAcceptZone(Zone)
|
||||
self:T(self.lid.."AddAcceptZone0")
|
||||
self:T(self.lid.."AddAcceptZone")
|
||||
self.GoZoneSet:AddZone(Zone)
|
||||
return self
|
||||
end
|
||||
@@ -1128,6 +1151,18 @@ function EASYGCICAP:AddRejectZone(Zone)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Add a zone to the conflict zones set.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param Core.Zone#ZONE_BASE Zone
|
||||
-- @return #EASYGCICAP self
|
||||
function EASYGCICAP:AddConflictZone(Zone)
|
||||
self:T(self.lid.."AddConflictZone")
|
||||
self.ConflictZoneSet:AddZone(Zone)
|
||||
self.GoZoneSet:AddZone(Zone)
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
--- (Internal) Try to assign the intercept to a FlightGroup already in air and ready.
|
||||
-- @param #EASYGCICAP self
|
||||
-- @param #table ReadyFlightGroups ReadyFlightGroups
|
||||
@@ -1193,6 +1228,7 @@ function EASYGCICAP:_AssignIntercept(Cluster)
|
||||
local ctlpts = self.ManagedCP
|
||||
local MaxAliveMissions = self.MaxAliveMissions --* self.capgrouping
|
||||
local nogozoneset = self.NoGoZoneSet
|
||||
local conflictzoneset = self.ConflictZoneSet
|
||||
local ReadyFlightGroups = self.ReadyFlightGroups
|
||||
|
||||
-- Aircraft?
|
||||
@@ -1271,18 +1307,22 @@ function EASYGCICAP:_AssignIntercept(Cluster)
|
||||
|
||||
if nogozoneset:Count() > 0 then
|
||||
InterceptAuftrag:AddConditionSuccess(
|
||||
function(group,zoneset)
|
||||
function(group,zoneset,conflictset)
|
||||
local success = false
|
||||
if group and group:IsAlive() then
|
||||
local coord = group:GetCoordinate()
|
||||
if coord and zoneset:IsCoordinateInZone(coord) then
|
||||
if coord and zoneset:Count() > 0 and zoneset:IsCoordinateInZone(coord) then
|
||||
success = true
|
||||
end
|
||||
if coord and conflictset:Count() > 0 and conflictset:IsCoordinateInZone(coord) then
|
||||
success = false
|
||||
end
|
||||
end
|
||||
return success
|
||||
end,
|
||||
contact.group,
|
||||
nogozoneset
|
||||
nogozoneset,
|
||||
conflictzoneset
|
||||
)
|
||||
end
|
||||
|
||||
@@ -1316,6 +1356,7 @@ function EASYGCICAP:_StartIntel()
|
||||
BlueIntel:SetForgetTime(300)
|
||||
BlueIntel:SetAcceptZones(self.GoZoneSet)
|
||||
BlueIntel:SetRejectZones(self.NoGoZoneSet)
|
||||
BlueIntel:SetConflictZones(self.ConflictZoneSet)
|
||||
BlueIntel:SetVerbosity(0)
|
||||
BlueIntel:Start()
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ function FLIGHTGROUP:New(group)
|
||||
local self=BASE:Inherit(self, OPSGROUP:New(group)) -- #FLIGHTGROUP
|
||||
|
||||
-- Set some string id for output to DCS.log file.
|
||||
self.lid=string.format("FLIGHTGROUP %s | ", self.groupname)
|
||||
self.lid=string.format("FLIGHTGROUP %s | ", self.groupname or "N/A")
|
||||
|
||||
-- Defaults
|
||||
self:SetDefaultROE()
|
||||
|
||||
@@ -2324,7 +2324,7 @@ INTEL_DLINK = {
|
||||
verbose = 0,
|
||||
lid = nil,
|
||||
alias = nil,
|
||||
cachetime = 300,
|
||||
cachetime = 120,
|
||||
interval = 20,
|
||||
contacts = {},
|
||||
clusters = {},
|
||||
@@ -2333,7 +2333,7 @@ INTEL_DLINK = {
|
||||
|
||||
--- Version string
|
||||
-- @field #string version
|
||||
INTEL_DLINK.version = "0.0.1"
|
||||
INTEL_DLINK.version = "0.0.2"
|
||||
|
||||
--- Function to instantiate a new object
|
||||
-- @param #INTEL_DLINK self
|
||||
@@ -2384,15 +2384,15 @@ function INTEL_DLINK:New(Intels, Alias, Interval, Cachetime)
|
||||
self.alias="SPECTRE"
|
||||
end
|
||||
|
||||
-- Cache time
|
||||
self.cachetime = Cachetime or 300
|
||||
|
||||
-- Interval
|
||||
self.interval = Interval or 20
|
||||
|
||||
-- Set some string id for output to DCS.log file.
|
||||
self.lid=string.format("INTEL_DLINK %s | ", self.alias)
|
||||
|
||||
-- Cache time
|
||||
self:SetDLinkCacheTime(Cachetime or 120)
|
||||
|
||||
-- Start State.
|
||||
self:SetStartState("Stopped")
|
||||
|
||||
@@ -2477,6 +2477,16 @@ function INTEL_DLINK:onafterStart(From, Event, To)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Function to set how long INTEL DLINK remembers contacts.
|
||||
-- @param #INTEL_DLINK self
|
||||
-- @param #number seconds Remember this many seconds. Defaults to 180.
|
||||
-- @return #INTEL_DLINK self
|
||||
function INTEL_DLINK:SetDLinkCacheTime(seconds)
|
||||
self.cachetime = math.abs(seconds or 120)
|
||||
self:I(self.lid.."Caching for "..self.cachetime.." seconds.")
|
||||
return self
|
||||
end
|
||||
|
||||
--- Function to collect data from the various #INTEL
|
||||
-- @param #INTEL_DLINK self
|
||||
-- @param #string From The From state
|
||||
|
||||
@@ -9045,7 +9045,7 @@ function OPSGROUP:AddWeightCargo(UnitName, Weight)
|
||||
self:T(self.lid..string.format("%s: Adding %.1f kg cargo weight. New cargo weight=%.1f kg", UnitName, Weight, element.weightCargo))
|
||||
|
||||
-- For airborne units, we set the weight in game.
|
||||
if self.isFlightgroup then
|
||||
if self.isFlightgroup and element.unit and element.unit:IsAlive() then -- #2272 trying to deduct cargo weight from possibly dead units
|
||||
trigger.action.setUnitInternalCargo(element.name, element.weightCargo) --https://wiki.hoggitworld.com/view/DCS_func_setUnitInternalCargo
|
||||
end
|
||||
|
||||
|
||||
@@ -53,7 +53,8 @@
|
||||
-- @field #number threatlevelCapture Threat level necessary to capture a zone.
|
||||
-- @field Core.Set#SET_UNIT ScanUnitSet Set of scanned units.
|
||||
-- @field Core.Set#SET_GROUP ScanGroupSet Set of scanned groups.
|
||||
-- @extends Core.Fsm#FSM
|
||||
-- @field #number UpdateSeconds Run status every this many seconds.
|
||||
-- @extends Core.Fsm#FSM
|
||||
|
||||
--- *Gentlemen, when the enemy is committed to a mistake we must not interrupt him too soon.* --- Horation Nelson
|
||||
--
|
||||
@@ -77,6 +78,7 @@ OPSZONE = {
|
||||
Tnut = 0,
|
||||
chiefs = {},
|
||||
Missions = {},
|
||||
UpdateSeconds = 120,
|
||||
}
|
||||
|
||||
--- OPSZONE.MISSION
|
||||
@@ -97,7 +99,7 @@ OPSZONE.ZoneType={
|
||||
|
||||
--- OPSZONE class version.
|
||||
-- @field #string version
|
||||
OPSZONE.version="0.6.1"
|
||||
OPSZONE.version="0.6.2"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ToDo list
|
||||
@@ -733,7 +735,8 @@ function OPSZONE:onafterStart(From, Event, To)
|
||||
self.timerStatus=self.timerStatus or TIMER:New(OPSZONE.Status, self)
|
||||
|
||||
-- Status update.
|
||||
self.timerStatus:Start(1, 120)
|
||||
local EveryUpdateIn = self.UpdateSeconds or 120
|
||||
self.timerStatus:Start(1, EveryUpdateIn)
|
||||
|
||||
-- Handle base captured event.
|
||||
if self.airbase then
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
-- ===
|
||||
-- @module Ops.PlayerTask
|
||||
-- @image OPS_PlayerTask.jpg
|
||||
-- @date Last Update Jan 2025
|
||||
-- @date Last Update April 2025
|
||||
|
||||
|
||||
do
|
||||
@@ -98,7 +98,7 @@ PLAYERTASK = {
|
||||
|
||||
--- PLAYERTASK class version.
|
||||
-- @field #string version
|
||||
PLAYERTASK.version="0.1.25"
|
||||
PLAYERTASK.version="0.1.26"
|
||||
|
||||
--- Generic task condition.
|
||||
-- @type PLAYERTASK.Condition
|
||||
@@ -556,6 +556,7 @@ end
|
||||
-- @param #PLAYERTASK self
|
||||
-- @param #SET_BASE CaptureSquadGroupNamePrefix The prefix of the group name that needs to capture the zone.
|
||||
-- @param #number Coalition The coalition that needs to capture the zone.
|
||||
-- @param #boolean CheckClientInZone If true, a CLIENT assigned to this task also needs to be in the zone for the task to be successful.
|
||||
-- @return #PLAYERTASK self
|
||||
-- @usage
|
||||
-- -- We can use either STATIC, SET_STATIC, SCENERY or SET_SCENERY as target objects.
|
||||
@@ -570,20 +571,20 @@ end
|
||||
--
|
||||
-- -- We set CaptureSquadGroupNamePrefix the group name prefix as set in the ME or the spawn of the group that need to be present at the OpsZone like a capture squad,
|
||||
-- -- and set the capturing Coalition in order to trigger a successful task.
|
||||
-- mytask:AddOpsZoneCaptureSuccessCondition("capture-squad", coalition.side.BLUE)
|
||||
-- mytask:AddOpsZoneCaptureSuccessCondition("capture-squad", coalition.side.BLUE, false)
|
||||
--
|
||||
-- playerTaskManager:AddPlayerTaskToQueue(mytask)
|
||||
function PLAYERTASK:AddOpsZoneCaptureSuccessCondition(CaptureSquadGroupNamePrefix, Coalition)
|
||||
function PLAYERTASK:AddOpsZoneCaptureSuccessCondition(CaptureSquadGroupNamePrefix, Coalition, CheckClientInZone)
|
||||
local task = self
|
||||
task:AddConditionSuccess(
|
||||
function(target)
|
||||
if target:IsInstanceOf("OPSZONE") then
|
||||
return task:_CheckCaptureOpsZoneSuccess(target, CaptureSquadGroupNamePrefix, Coalition, true)
|
||||
return task:_CheckCaptureOpsZoneSuccess(target, CaptureSquadGroupNamePrefix, Coalition, CheckClientInZone or true)
|
||||
elseif target:IsInstanceOf("SET_OPSZONE") then
|
||||
local successes = 0
|
||||
local isClientInZone = false
|
||||
target:ForEachZone(function(opszone)
|
||||
if task:_CheckCaptureOpsZoneSuccess(opszone, CaptureSquadGroupNamePrefix, Coalition) then
|
||||
if task:_CheckCaptureOpsZoneSuccess(opszone, CaptureSquadGroupNamePrefix, Coalition, CheckClientInZone or true) then
|
||||
successes = successes + 1
|
||||
end
|
||||
|
||||
@@ -979,6 +980,12 @@ function PLAYERTASK:onafterStatus(From, Event, To)
|
||||
|
||||
if status == "Stopped" then return self end
|
||||
|
||||
-- update marker in case target is moving
|
||||
if self.TargetMarker then
|
||||
local coordinate = self.Target:GetCoordinate()
|
||||
self.TargetMarker:UpdateCoordinate(coordinate,0.5)
|
||||
end
|
||||
|
||||
-- Check Target status
|
||||
local targetdead = false
|
||||
|
||||
@@ -1902,7 +1909,7 @@ PLAYERTASKCONTROLLER.Messages = {
|
||||
|
||||
--- PLAYERTASK class version.
|
||||
-- @field #string version
|
||||
PLAYERTASKCONTROLLER.version="0.1.69"
|
||||
PLAYERTASKCONTROLLER.version="0.1.70"
|
||||
|
||||
--- Create and run a new TASKCONTROLLER instance.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
@@ -2415,7 +2422,7 @@ function PLAYERTASKCONTROLLER:EnablePrecisionBombing(FlightGroup,LaserCode,Holdi
|
||||
end
|
||||
)
|
||||
else
|
||||
self:E(self.lid.."No FLIGHTGROUP object passed or FLIGHTGROUP is not alive!")
|
||||
self:E(self.lid.."No OPSGROUP/SET_OPSGROUP object passed or object is not alive!")
|
||||
end
|
||||
else
|
||||
self.autolase = nil
|
||||
@@ -3703,6 +3710,7 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Task, Group, Client)
|
||||
else
|
||||
CoordText = Coordinate:ToStringA2A(Client,nil,self.ShowMagnetic)
|
||||
end
|
||||
--self:I("CoordText = "..CoordText)
|
||||
-- Threat Level
|
||||
local ThreatLevel = task.Target:GetThreatLevelMax()
|
||||
--local ThreatLevelText = "high"
|
||||
@@ -3837,7 +3845,8 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Task, Group, Client)
|
||||
Text = string.gsub(Text,"9","niner")
|
||||
CoordText = "MGRS;"..Text
|
||||
if self.PathToGoogleKey then
|
||||
CoordText = string.format("<say-as interpret-as='characters'>%s</say-as>",CoordText)
|
||||
--CoordText = string.format("<say-as interpret-as=\'characters\'>%s</say-as>",CoordText)
|
||||
--doesn't seem to work any longer
|
||||
end
|
||||
--self:I(self.lid.." | ".. CoordText)
|
||||
end
|
||||
@@ -3855,10 +3864,12 @@ function PLAYERTASKCONTROLLER:_ActiveTaskInfo(Task, Group, Client)
|
||||
CoordText = string.gsub(ttstext," BR, "," Bee, Arr, ")
|
||||
end
|
||||
elseif task:HasFreetext() then
|
||||
|
||||
-- add tts freetext
|
||||
local brieftxt = self.gettext:GetEntry("BRIEFING",self.locale)
|
||||
ttstext = ttstext .. string.format("; %s: ",brieftxt)..task:GetFreetextTTS()
|
||||
end
|
||||
--self:I("**** TTS Text ****\n"..ttstext.."\n*****")
|
||||
self.SRSQueue:NewTransmission(ttstext,nil,self.SRS,nil,2)
|
||||
end
|
||||
else
|
||||
@@ -4357,7 +4368,7 @@ function PLAYERTASKCONTROLLER:SwitchDetectStatics(OnOff)
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Add accept zone to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
--- [User] Add an accept zone to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Core.Zone#ZONE AcceptZone Add a zone to the accept zone set.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
@@ -4371,7 +4382,7 @@ function PLAYERTASKCONTROLLER:AddAcceptZone(AcceptZone)
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Add accept SET_ZONE to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
--- [User] Add an accept SET_ZONE to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Core.Set#SET_ZONE AcceptZoneSet Add a SET_ZONE to the accept zone set.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
@@ -4385,7 +4396,7 @@ function PLAYERTASKCONTROLLER:AddAcceptZoneSet(AcceptZoneSet)
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Add reject zone to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
--- [User] Add a reject zone to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Core.Zone#ZONE RejectZone Add a zone to the reject zone set.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
@@ -4399,7 +4410,7 @@ function PLAYERTASKCONTROLLER:AddRejectZone(RejectZone)
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Add reject SET_ZONE to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
--- [User] Add a reject SET_ZONE to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Core.Set#SET_ZONE RejectZoneSet Add a zone to the reject zone set.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
@@ -4413,9 +4424,37 @@ function PLAYERTASKCONTROLLER:AddRejectZoneSet(RejectZoneSet)
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Remove accept zone from INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
--- [User] Add a conflict zone to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Core.Zone#ZONE AcceptZone Add a zone to the accept zone set.
|
||||
-- @param Core.Zone#ZONE ConflictZone Add a zone to the conflict zone set.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:AddConflictZone(ConflictZone)
|
||||
self:T(self.lid.."AddConflictZone")
|
||||
if self.Intel then
|
||||
self.Intel:AddConflictZone(ConflictZone)
|
||||
else
|
||||
self:E(self.lid.."*****NO detection has been set up (yet)!")
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Add a conflict SET_ZONE to INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Core.Set#SET_ZONE ConflictZoneSet Add a zone to the conflict zone set.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:AddConflictZoneSet(ConflictZoneSet)
|
||||
self:T(self.lid.."AddConflictZoneSet")
|
||||
if self.Intel then
|
||||
self.Intel.conflictzoneset:AddSet(ConflictZoneSet)
|
||||
else
|
||||
self:E(self.lid.."*****NO detection has been set up (yet)!")
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Remove an accept zone from INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Core.Zone#ZONE AcceptZone Remove this zone from the accept zone set.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:RemoveAcceptZone(AcceptZone)
|
||||
self:T(self.lid.."RemoveAcceptZone")
|
||||
@@ -4427,11 +4466,11 @@ function PLAYERTASKCONTROLLER:RemoveAcceptZone(AcceptZone)
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Remove reject zone from INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
--- [User] Remove a reject zone from INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Core.Zone#ZONE RejectZone Add a zone to the reject zone set.
|
||||
-- @param Core.Zone#ZONE RejectZone Remove this zone from the reject zone set.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:RemoveRejectZoneSet(RejectZone)
|
||||
function PLAYERTASKCONTROLLER:RemoveRejectZone(RejectZone)
|
||||
self:T(self.lid.."RemoveRejectZone")
|
||||
if self.Intel then
|
||||
self.Intel:RemoveRejectZone(RejectZone)
|
||||
@@ -4441,6 +4480,20 @@ function PLAYERTASKCONTROLLER:RemoveRejectZoneSet(RejectZone)
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Remove a conflict zone from INTEL detection. You need to set up detection with @{#PLAYERTASKCONTROLLER.SetupIntel}() **before** using this.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param Core.Zone#ZONE ConflictZone Remove this zone from the conflict zone set.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:RemoveConflictZone(ConflictZone)
|
||||
self:T(self.lid.."RemoveConflictZone")
|
||||
if self.Intel then
|
||||
self.Intel:RemoveConflictZone(ConflictZone)
|
||||
else
|
||||
self:E(self.lid.."*****NO detection has been set up (yet)!")
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Set the top menu name to a custom string.
|
||||
-- @param #PLAYERTASKCONTROLLER self
|
||||
-- @param #string Name The name to use as the top menu designation.
|
||||
|
||||
@@ -1715,6 +1715,26 @@ function TARGET:GetAverageCoordinate()
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Get coordinates of all targets. (e.g. for a SET_STATIC)
|
||||
-- @param #TARGET self
|
||||
-- @return #table Table with coordinates of all targets.
|
||||
function TARGET:GetCoordinates()
|
||||
local coordinates={}
|
||||
|
||||
for _,_target in pairs(self.targets) do
|
||||
local target=_target --#TARGET.Object
|
||||
|
||||
local coordinate=self:GetTargetCoordinate(target)
|
||||
if coordinate then
|
||||
table.insert(coordinates, coordinate)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return coordinates
|
||||
end
|
||||
|
||||
--- Get heading of target.
|
||||
-- @param #TARGET self
|
||||
-- @return #number Heading of the target in degrees.
|
||||
@@ -1968,6 +1988,21 @@ function TARGET:GetObject(RefCoordinate, Coalitions)
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Get all target objects.
|
||||
-- @param #TARGET self
|
||||
-- @return #table List of target objects.
|
||||
function TARGET:GetObjects()
|
||||
local objects={}
|
||||
|
||||
for _,_target in pairs(self.targets) do
|
||||
local target=_target --#TARGET.Object
|
||||
|
||||
table.insert(objects, target.Object)
|
||||
end
|
||||
|
||||
return objects
|
||||
end
|
||||
|
||||
--- Count alive objects.
|
||||
-- @param #TARGET self
|
||||
-- @param #TARGET.Object Target Target objective.
|
||||
|
||||
@@ -380,7 +380,8 @@ function RADIOQUEUE:Broadcast(transmission)
|
||||
self:T(self.lid..string.format("Broadcasting from aircraft %s", sender:GetName()))
|
||||
|
||||
|
||||
if not self.senderinit then
|
||||
--if not self.senderinit then
|
||||
-- TODO Seems to be a DCS bug - if I explode ANY unit in a group the BC assignment gets lost
|
||||
|
||||
-- Command to set the Frequency for the transmission.
|
||||
local commandFrequency={
|
||||
@@ -394,7 +395,7 @@ function RADIOQUEUE:Broadcast(transmission)
|
||||
sender:SetCommand(commandFrequency)
|
||||
|
||||
self.senderinit=true
|
||||
end
|
||||
--end
|
||||
|
||||
-- Set subtitle only if duration>0 sec.
|
||||
local subtitle=nil
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
|
||||
--- Governs multiple missions, the tasking and the reporting.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Command centers govern missions, communicates the task assignments between human players of the coalition, and manages the menu flow.
|
||||
-- It can assign a random task to a player when requested.
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
-- The @{#DETECTION_MANAGER} class defines the core functions to report detected objects to groups.
|
||||
-- Reportings can be done in several manners, and it is up to the derived classes if DETECTION_MANAGER to model the reporting behaviour.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 1.1) DETECTION_MANAGER constructor:
|
||||
-- -----------------------------------
|
||||
-- * @{#DETECTION_MANAGER.New}(): Create a new DETECTION_MANAGER instance.
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
--- Models goals to be achieved and can contain multiple tasks to be executed to achieve the goals.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- A mission contains multiple tasks and can be of different task types.
|
||||
-- These tasks need to be assigned to human players to be executed.
|
||||
--
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- # 1) Tasking from a player perspective.
|
||||
--
|
||||
-- Tasking can be controlled by using the "other" menu in the radio menu of the player group.
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
---
|
||||
-- # TASKINFO class, extends @{Core.Base#BASE}
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- ## The TASKINFO class implements the methods to contain information and display information of a task.
|
||||
--
|
||||
-- # Developer Note
|
||||
|
||||
@@ -20,6 +20,9 @@ do -- TASK_A2A
|
||||
|
||||
--- Defines Air To Air tasks for a @{Core.Set} of Target Units,
|
||||
-- based on the tasking capabilities defined in @{Tasking.Task#TASK}.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The TASK_A2A is implemented using a @{Core.Fsm#FSM_TASK}, and has the following statuses:
|
||||
--
|
||||
-- * **None**: Start of the process
|
||||
|
||||
@@ -30,6 +30,8 @@ do -- TASK_A2A_DISPATCHER
|
||||
-- @extends Tasking.DetectionManager#DETECTION_MANAGER
|
||||
|
||||
--- Orchestrates the dynamic dispatching of tasks upon groups of detected units determined a @{Core.Set} of EWR installation groups.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 
|
||||
--
|
||||
|
||||
@@ -20,6 +20,9 @@ do -- TASK_A2G
|
||||
|
||||
--- The TASK_A2G class defines Air To Ground tasks for a @{Core.Set} of Target Units,
|
||||
-- based on the tasking capabilities defined in @{Tasking.Task#TASK}.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The TASK_A2G is implemented using a @{Core.Fsm#FSM_TASK}, and has the following statuses:
|
||||
--
|
||||
-- * **None**: Start of the process
|
||||
|
||||
@@ -33,6 +33,8 @@ do -- TASK_A2G_DISPATCHER
|
||||
-- @extends Tasking.DetectionManager#DETECTION_MANAGER
|
||||
|
||||
--- Orchestrates dynamic **A2G Task Dispatching** based on the detection results of a linked @{Functional.Detection} object.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- It uses the Tasking System within the MOOSE framework, which is a multi-player Tasking Orchestration system.
|
||||
-- It provides a truly dynamic battle environment for pilots and ground commanders to engage upon,
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- ## Test Missions:
|
||||
--
|
||||
-- Test missions can be located on the main GITHUB site.
|
||||
@@ -1176,7 +1178,7 @@ do -- TASK_CARGO
|
||||
end
|
||||
|
||||
|
||||
---@param Color Might be SMOKECOLOR.Blue, SMOKECOLOR.Red SMOKECOLOR.Orange, SMOKECOLOR.White or SMOKECOLOR.Green
|
||||
--@param Color Might be SMOKECOLOR.Blue, SMOKECOLOR.Red SMOKECOLOR.Orange, SMOKECOLOR.White or SMOKECOLOR.Green
|
||||
function TASK_CARGO:SetSmokeColor(SmokeColor)
|
||||
-- Makes sure Coloe is set
|
||||
if SmokeColor == nil then
|
||||
|
||||
@@ -76,6 +76,8 @@ do -- TASK_CAPTURE_DISPATCHER
|
||||
|
||||
--- Implements the dynamic dispatching of capture zone tasks.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The **TASK_CAPTURE_DISPATCHER** allows you to setup various tasks for let human
|
||||
-- players capture zones in a co-operation effort.
|
||||
--
|
||||
|
||||
@@ -20,6 +20,8 @@ do -- TASK_ZONE_GOAL
|
||||
|
||||
--- # TASK_ZONE_GOAL class, extends @{Tasking.Task#TASK}
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The TASK_ZONE_GOAL class defines the task to protect or capture a protection zone.
|
||||
-- The TASK_ZONE_GOAL is implemented using a @{Core.Fsm#FSM_TASK}, and has the following statuses:
|
||||
--
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- Please read through the @{Tasking.Task_CARGO} process to understand the mechanisms of tasking and cargo tasking and handling.
|
||||
--
|
||||
-- The cargo will be a downed pilot, which is located somwhere on the battlefield. Use the menus system and facilities to
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
--
|
||||
-- The **TASK_CARGO_DISPATCHER** allows you to setup various tasks for let human
|
||||
-- players transport cargo as part of a task.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- The cargo dispatcher will implement for you mechanisms to create cargo transportation tasks:
|
||||
--
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--- **Tasking** - Models tasks for players to transport cargo.
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- **Specific features:**
|
||||
--
|
||||
-- * Creates a task to transport #Cargo.Cargo to and between deployment zones.
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- 
|
||||
--
|
||||
-- 1) @{Tasking.Task_Manager#TASK_MANAGER} class, extends @{Core.Fsm#FSM}
|
||||
-- ===
|
||||
-- The @{Tasking.Task_Manager#TASK_MANAGER} class defines the core functions to report tasks to groups.
|
||||
|
||||
@@ -1331,6 +1331,12 @@ ENUMS.Storage.weapons.OH58.Smk_Grenade_Yellow = {4,5,9,491}
|
||||
-- Apache
|
||||
ENUMS.Storage.weapons.AH64D.AN_APG78 = {4,15,44,2114}
|
||||
ENUMS.Storage.weapons.AH64D.Internal_Aux_FuelTank = {1,3,43,1700}
|
||||
-- Other - but cannot set or track those. Harrier stuff?
|
||||
ENUMS.Storage.weapons.droptanks.FuelTank_610gal = {1,3,43,10}
|
||||
ENUMS.Storage.weapons.droptanks.FuelTank_370gal = {1,3,43,11}
|
||||
ENUMS.Storage.weapons.containers.AV8BNA_GAU_12_AP_M79 = {4,15,46,824}
|
||||
ENUMS.Storage.weapons.containers.AV8BNA_GAU_12_HE_M792 = {4,15,46,825}
|
||||
ENUMS.Storage.weapons.containers.AV8BNA_GAU_12_SAPHEI_T = {4,15,46,300}
|
||||
|
||||
---
|
||||
-- @type ENUMS.FARPType
|
||||
|
||||
@@ -12,27 +12,35 @@
|
||||
-- @module Utilities.Utils
|
||||
-- @image MOOSE.JPG
|
||||
|
||||
---
|
||||
--- Smoke color enum `trigger.smokeColor`.
|
||||
-- @type SMOKECOLOR
|
||||
-- @field Green
|
||||
-- @field Red
|
||||
-- @field White
|
||||
-- @field Orange
|
||||
-- @field Blue
|
||||
-- @field #number Green Green smoke (0)
|
||||
-- @field #number Red Red smoke (1)
|
||||
-- @field #number White White smoke (2)
|
||||
-- @field #number Orange Orange smoke (3)
|
||||
-- @field #number Blue Blue smoke (4)
|
||||
|
||||
SMOKECOLOR = trigger.smokeColor -- #SMOKECOLOR
|
||||
|
||||
---
|
||||
--- Flare colur enum `trigger.flareColor`.
|
||||
-- @type FLARECOLOR
|
||||
-- @field Green
|
||||
-- @field Red
|
||||
-- @field White
|
||||
-- @field Yellow
|
||||
-- @field #number Green (0)
|
||||
-- @field #number Red Red flare (1)
|
||||
-- @field #number White White flare (2)
|
||||
-- @field #number Yellow Yellow flare (3)
|
||||
|
||||
FLARECOLOR = trigger.flareColor -- #FLARECOLOR
|
||||
|
||||
--- Big smoke preset enum.
|
||||
-- @type BIGSMOKEPRESET
|
||||
-- @field #number SmallSmokeAndFire Small moke and fire (1)
|
||||
-- @field #number MediumSmokeAndFire Medium smoke and fire (2)
|
||||
-- @field #number LargeSmokeAndFire Large smoke and fire (3)
|
||||
-- @field #number HugeSmokeAndFire Huge smoke and fire (4)
|
||||
-- @field #number SmallSmoke Small smoke (5)
|
||||
-- @field #number MediumSmoke Medium smoke (6)
|
||||
-- @field #number LargeSmoke Large smoke (7)
|
||||
-- @field #number HugeSmoke Huge smoke (8)
|
||||
BIGSMOKEPRESET = {
|
||||
SmallSmokeAndFire=1,
|
||||
MediumSmokeAndFire=2,
|
||||
@@ -58,6 +66,7 @@ BIGSMOKEPRESET = {
|
||||
-- @field #string Kola Kola map.
|
||||
-- @field #string Afghanistan Afghanistan map
|
||||
-- @field #string Iraq Iraq map
|
||||
-- @field #string GermanyCW Germany Cold War map
|
||||
DCSMAP = {
|
||||
Caucasus="Caucasus",
|
||||
NTTR="Nevada",
|
||||
@@ -70,7 +79,8 @@ DCSMAP = {
|
||||
Sinai="SinaiMap",
|
||||
Kola="Kola",
|
||||
Afghanistan="Afghanistan",
|
||||
Iraq="Iraq"
|
||||
Iraq="Iraq",
|
||||
GermanyCW="GermanyCW",
|
||||
}
|
||||
|
||||
|
||||
@@ -349,7 +359,7 @@ end
|
||||
-- @return #string Table as a string.
|
||||
UTILS.OneLineSerialize = function( tbl ) -- serialization of a table all on a single line, no comments, made to replace old get_table_string function
|
||||
|
||||
lookup_table = {}
|
||||
local lookup_table = {}
|
||||
|
||||
local function _Serialize( tbl )
|
||||
|
||||
@@ -488,7 +498,7 @@ end
|
||||
|
||||
--- Counts the number of elements in a table.
|
||||
-- @param #table T Table to count
|
||||
-- @return #int Number of elements in the table
|
||||
-- @return #number Number of elements in the table
|
||||
function UTILS.TableLength(T)
|
||||
local count = 0
|
||||
for _ in pairs(T or {}) do count = count + 1 end
|
||||
@@ -1759,7 +1769,9 @@ end
|
||||
-- * Sinai +4.8 (East)
|
||||
-- * Kola +15 (East) - note there is a lot of deviation across the map (-1° to +24°), as we are close to the North pole
|
||||
-- * Afghanistan +3 (East) - actually +3.6 (NW) to +2.3 (SE)
|
||||
-- @param #string map (Optional) Map for which the declination is returned. Default is from env.mission.theatre
|
||||
-- * Iraq +4.4 (East)
|
||||
-- * Germany Cold War +0.1 (East) - near Fulda
|
||||
-- @param #string map (Optional) Map for which the declination is returned. Default is from `env.mission.theatre`.
|
||||
-- @return #number Declination in degrees.
|
||||
function UTILS.GetMagneticDeclination(map)
|
||||
|
||||
@@ -1791,6 +1803,8 @@ function UTILS.GetMagneticDeclination(map)
|
||||
declination=3
|
||||
elseif map==DCSMAP.Iraq then
|
||||
declination=4.4
|
||||
elseif map==DCSMAP.GermanyCW then
|
||||
declination=0.1
|
||||
else
|
||||
declination=0
|
||||
end
|
||||
@@ -2024,6 +2038,10 @@ function UTILS.GMTToLocalTimeDifference()
|
||||
return 3 -- Currently map is +2 but should be +3 (DCS bug?)
|
||||
elseif theatre==DCSMAP.Afghanistan then
|
||||
return 4.5 -- UTC +4:30
|
||||
elseif theatre==DCSMAP.Iraq then
|
||||
return 3.0 -- UTC +3
|
||||
elseif theatre==DCSMAP.GermanyCW then
|
||||
return 1.0 -- UTC +1 Central European Time (not summer time)
|
||||
else
|
||||
BASE:E(string.format("ERROR: Unknown Map %s in UTILS.GMTToLocal function. Returning 0", tostring(theatre)))
|
||||
return 0
|
||||
@@ -2127,9 +2145,9 @@ function UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, Rising, Tlocal)
|
||||
local cosH = (cos(zenith) - (sinDec * sin(latitude))) / (cosDec * cos(latitude))
|
||||
|
||||
if rising and cosH > 1 then
|
||||
return "N/S" -- The sun never rises on this location on the specified date
|
||||
return "N/R" -- The sun never rises on this location on the specified date
|
||||
elseif cosH < -1 then
|
||||
return "N/R" -- The sun never sets on this location on the specified date
|
||||
return "N/S" -- The sun never sets on this location on the specified date
|
||||
end
|
||||
|
||||
-- Finish calculating H and convert into hours
|
||||
@@ -2329,8 +2347,12 @@ function UTILS.IsLoadingDoorOpen( unit_name )
|
||||
BASE:T(unit_name .. " rear cargo door is open")
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
|
||||
-- ground
|
||||
local UnitDescriptor = unit:getDesc()
|
||||
local IsGroundResult = (UnitDescriptor.category == Unit.Category.GROUND_UNIT)
|
||||
|
||||
return IsGroundResult
|
||||
|
||||
end -- nil
|
||||
|
||||
|
||||
@@ -513,6 +513,7 @@ AIRBASE.TheChannel = {
|
||||
-- * AIRBASE.Syria.Hatzor
|
||||
-- * AIRBASE.Syria.Palmashim
|
||||
-- * AIRBASE.Syria.Tel_Nof
|
||||
-- * AIRBASE.Syria.Marka
|
||||
--
|
||||
--@field Syria
|
||||
AIRBASE.Syria={
|
||||
@@ -586,6 +587,7 @@ AIRBASE.Syria={
|
||||
["Hatzor"] = "Hatzor",
|
||||
["Palmashim"] = "Palmashim",
|
||||
["Tel_Nof"] = "Tel Nof",
|
||||
["Marka"] = "Marka",
|
||||
}
|
||||
|
||||
--- Airbases of the Mariana Islands map:
|
||||
@@ -790,9 +792,14 @@ AIRBASE.Sinai = {
|
||||
-- * AIRBASE.Kola.Vidsel
|
||||
-- * AIRBASE.Kola.Vuojarvi
|
||||
-- * AIRBASE.Kola.Andoya
|
||||
-- * AIRBASE.Kola.Alakourtti
|
||||
-- * AIRBASE.Kola.Alakurtti
|
||||
-- * AIRBASE.Kola.Kittila
|
||||
-- * AIRBASE.Kola.Bardufoss
|
||||
-- * AIRBASE.Kola.Alta
|
||||
-- * AIRBASE.Kola.Sodankyla
|
||||
-- * AIRBASE.Kola.Enontekio
|
||||
-- * AIRBASE.Kola.Evenes
|
||||
-- * AIRBASE.Kola.Hosio
|
||||
--
|
||||
-- @field Kola
|
||||
AIRBASE.Kola = {
|
||||
@@ -815,9 +822,14 @@ AIRBASE.Kola = {
|
||||
["Vidsel"] = "Vidsel",
|
||||
["Vuojarvi"] = "Vuojarvi",
|
||||
["Andoya"] = "Andoya",
|
||||
["Alakourtti"] = "Alakourtti",
|
||||
["Alakurtti"] = "Alakurtti",
|
||||
["Kittila"] = "Kittila",
|
||||
["Bardufoss"] = "Bardufoss",
|
||||
["Alta"] = "Alta",
|
||||
["Sodankyla"] = "Sodankyla",
|
||||
["Enontekio"] = "Enontekio",
|
||||
["Evenes"] = "Evenes",
|
||||
["Hosio"] = "Hosio",
|
||||
}
|
||||
|
||||
--- Airbases of the Afghanistan map
|
||||
@@ -909,6 +921,416 @@ AIRBASE.Iraq = {
|
||||
["K1_Base"] = "K1 Base",
|
||||
}
|
||||
|
||||
--- Airbases of the Germany Cold War map
|
||||
-- * AIRBASE.GermanyCW.Airracing_Frankfurt
|
||||
-- * AIRBASE.GermanyCW.Airracing_Frankfurt
|
||||
-- * AIRBASE.GermanyCW.Airracing_Koblenz
|
||||
-- * AIRBASE.GermanyCW.Airracing_Luebeck
|
||||
-- * AIRBASE.GermanyCW.Allstedt
|
||||
-- * AIRBASE.GermanyCW.Altes_Lager
|
||||
-- * AIRBASE.GermanyCW.Bad_Duerkheim
|
||||
-- * AIRBASE.GermanyCW.Barth
|
||||
-- * AIRBASE.GermanyCW.Bienenfarm
|
||||
-- * AIRBASE.GermanyCW.Bindersleben
|
||||
-- * AIRBASE.GermanyCW.Bitburg
|
||||
-- * AIRBASE.GermanyCW.Braunschweig
|
||||
-- * AIRBASE.GermanyCW.Bremen
|
||||
-- * AIRBASE.GermanyCW.Briest
|
||||
-- * AIRBASE.GermanyCW.Buechel
|
||||
-- * AIRBASE.GermanyCW.Bueckeburg
|
||||
-- * AIRBASE.GermanyCW.Celle
|
||||
-- * AIRBASE.GermanyCW.Cochstedt
|
||||
-- * AIRBASE.GermanyCW.Damgarten
|
||||
-- * AIRBASE.GermanyCW.Dedelow
|
||||
-- * AIRBASE.GermanyCW.Dessau
|
||||
-- * AIRBASE.GermanyCW.Fassberg
|
||||
-- * AIRBASE.GermanyCW.Finow
|
||||
-- * AIRBASE.GermanyCW.Frankfurt
|
||||
-- * AIRBASE.GermanyCW.Fritzlar
|
||||
-- * AIRBASE.GermanyCW.Fulda
|
||||
-- * AIRBASE.GermanyCW.Gardelegen
|
||||
-- * AIRBASE.GermanyCW.Garz
|
||||
-- * AIRBASE.GermanyCW.Gatow
|
||||
-- * AIRBASE.GermanyCW.Gelnhausen
|
||||
-- * AIRBASE.GermanyCW.Giebelstadt
|
||||
-- * AIRBASE.GermanyCW.Glindbruchkippe
|
||||
-- * AIRBASE.GermanyCW.Gross_Mohrdorf
|
||||
-- * AIRBASE.GermanyCW.Grosse_Wiese
|
||||
-- * AIRBASE.GermanyCW.Guetersloh
|
||||
-- * AIRBASE.GermanyCW.H_FRG_01
|
||||
-- * AIRBASE.GermanyCW.H_FRG_02
|
||||
-- * AIRBASE.GermanyCW.H_FRG_03
|
||||
-- * AIRBASE.GermanyCW.H_FRG_04
|
||||
-- * AIRBASE.GermanyCW.H_FRG_05
|
||||
-- * AIRBASE.GermanyCW.H_FRG_06
|
||||
-- * AIRBASE.GermanyCW.H_FRG_07
|
||||
-- * AIRBASE.GermanyCW.H_FRG_08
|
||||
-- * AIRBASE.GermanyCW.H_FRG_09
|
||||
-- * AIRBASE.GermanyCW.H_FRG_10
|
||||
-- * AIRBASE.GermanyCW.H_FRG_11
|
||||
-- * AIRBASE.GermanyCW.H_FRG_12
|
||||
-- * AIRBASE.GermanyCW.H_FRG_13
|
||||
-- * AIRBASE.GermanyCW.H_FRG_14
|
||||
-- * AIRBASE.GermanyCW.H_FRG_15
|
||||
-- * AIRBASE.GermanyCW.H_FRG_16
|
||||
-- * AIRBASE.GermanyCW.H_FRG_17
|
||||
-- * AIRBASE.GermanyCW.H_FRG_18
|
||||
-- * AIRBASE.GermanyCW.H_FRG_19
|
||||
-- * AIRBASE.GermanyCW.H_FRG_20
|
||||
-- * AIRBASE.GermanyCW.H_FRG_21
|
||||
-- * AIRBASE.GermanyCW.H_FRG_23
|
||||
-- * AIRBASE.GermanyCW.H_FRG_25
|
||||
-- * AIRBASE.GermanyCW.H_FRG_27
|
||||
-- * AIRBASE.GermanyCW.H_FRG_30
|
||||
-- * AIRBASE.GermanyCW.H_FRG_31
|
||||
-- * AIRBASE.GermanyCW.H_FRG_32
|
||||
-- * AIRBASE.GermanyCW.H_FRG_34
|
||||
-- * AIRBASE.GermanyCW.H_FRG_38
|
||||
-- * AIRBASE.GermanyCW.H_FRG_39
|
||||
-- * AIRBASE.GermanyCW.H_FRG_40
|
||||
-- * AIRBASE.GermanyCW.H_FRG_41
|
||||
-- * AIRBASE.GermanyCW.H_FRG_42
|
||||
-- * AIRBASE.GermanyCW.H_FRG_43
|
||||
-- * AIRBASE.GermanyCW.H_FRG_44
|
||||
-- * AIRBASE.GermanyCW.H_FRG_45
|
||||
-- * AIRBASE.GermanyCW.H_FRG_46
|
||||
-- * AIRBASE.GermanyCW.H_FRG_47
|
||||
-- * AIRBASE.GermanyCW.H_FRG_48
|
||||
-- * AIRBASE.GermanyCW.H_FRG_49
|
||||
-- * AIRBASE.GermanyCW.H_FRG_50
|
||||
-- * AIRBASE.GermanyCW.H_FRG_51
|
||||
-- * AIRBASE.GermanyCW.H_GDR_01
|
||||
-- * AIRBASE.GermanyCW.H_GDR_02
|
||||
-- * AIRBASE.GermanyCW.H_GDR_03
|
||||
-- * AIRBASE.GermanyCW.H_GDR_04
|
||||
-- * AIRBASE.GermanyCW.H_GDR_05
|
||||
-- * AIRBASE.GermanyCW.H_GDR_06
|
||||
-- * AIRBASE.GermanyCW.H_GDR_07
|
||||
-- * AIRBASE.GermanyCW.H_GDR_08
|
||||
-- * AIRBASE.GermanyCW.H_GDR_09
|
||||
-- * AIRBASE.GermanyCW.H_GDR_10
|
||||
-- * AIRBASE.GermanyCW.H_GDR_11
|
||||
-- * AIRBASE.GermanyCW.H_GDR_12
|
||||
-- * AIRBASE.GermanyCW.H_GDR_13
|
||||
-- * AIRBASE.GermanyCW.H_GDR_14
|
||||
-- * AIRBASE.GermanyCW.H_GDR_15
|
||||
-- * AIRBASE.GermanyCW.H_GDR_16
|
||||
-- * AIRBASE.GermanyCW.H_GDR_17
|
||||
-- * AIRBASE.GermanyCW.H_GDR_18
|
||||
-- * AIRBASE.GermanyCW.H_GDR_19
|
||||
-- * AIRBASE.GermanyCW.H_GDR_21
|
||||
-- * AIRBASE.GermanyCW.H_GDR_22
|
||||
-- * AIRBASE.GermanyCW.H_GDR_24
|
||||
-- * AIRBASE.GermanyCW.H_GDR_25
|
||||
-- * AIRBASE.GermanyCW.H_GDR_26
|
||||
-- * AIRBASE.GermanyCW.H_GDR_30
|
||||
-- * AIRBASE.GermanyCW.H_GDR_31
|
||||
-- * AIRBASE.GermanyCW.H_GDR_32
|
||||
-- * AIRBASE.GermanyCW.H_GDR_33
|
||||
-- * AIRBASE.GermanyCW.H_GDR_34
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_01
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_02
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_04
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_06
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_11
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_12
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_13
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_14
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_15
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_16
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_17
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_21
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_24
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_26
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_27
|
||||
-- * AIRBASE.GermanyCW.H_Med_FRG_29
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_01
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_02
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_03
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_08
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_09
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_10
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_11
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_12
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_13
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_14
|
||||
-- * AIRBASE.GermanyCW.H_Med_GDR_16
|
||||
-- * AIRBASE.GermanyCW.H_Radar_FRG_02
|
||||
-- * AIRBASE.GermanyCW.H_Radar_GDR_01
|
||||
-- * AIRBASE.GermanyCW.H_Radar_GDR_02
|
||||
-- * AIRBASE.GermanyCW.H_Radar_GDR_03
|
||||
-- * AIRBASE.GermanyCW.H_Radar_GDR_04
|
||||
-- * AIRBASE.GermanyCW.H_Radar_GDR_05
|
||||
-- * AIRBASE.GermanyCW.H_Radar_GDR_06
|
||||
-- * AIRBASE.GermanyCW.H_Radar_GDR_07
|
||||
-- * AIRBASE.GermanyCW.H_Radar_GDR_08
|
||||
-- * AIRBASE.GermanyCW.H_Radar_GDR_09
|
||||
-- * AIRBASE.GermanyCW.Hahn
|
||||
-- * AIRBASE.GermanyCW.Haina
|
||||
-- * AIRBASE.GermanyCW.Hamburg
|
||||
-- * AIRBASE.GermanyCW.Hamburg_Finkenwerder
|
||||
-- * AIRBASE.GermanyCW.Hannover
|
||||
-- * AIRBASE.GermanyCW.Hasselfelde
|
||||
-- * AIRBASE.GermanyCW.Herrenteich
|
||||
-- * AIRBASE.GermanyCW.Hildesheim
|
||||
-- * AIRBASE.GermanyCW.Hockenheim
|
||||
-- * AIRBASE.GermanyCW.Holzdorf
|
||||
-- * AIRBASE.GermanyCW.Kammermark
|
||||
-- * AIRBASE.GermanyCW.Koethen
|
||||
-- * AIRBASE.GermanyCW.Laage
|
||||
-- * AIRBASE.GermanyCW.Langenselbold
|
||||
-- * AIRBASE.GermanyCW.Laerz
|
||||
-- * AIRBASE.GermanyCW.Leipzig_Halle
|
||||
-- * AIRBASE.GermanyCW.Leipzig_Mockau
|
||||
-- * AIRBASE.GermanyCW.Luebeck
|
||||
-- * AIRBASE.GermanyCW.Lueneburg
|
||||
-- * AIRBASE.GermanyCW.Mahlwinkel
|
||||
-- * AIRBASE.GermanyCW.Mendig
|
||||
-- * AIRBASE.GermanyCW.Merseburg
|
||||
-- * AIRBASE.GermanyCW.Neubrandenburg
|
||||
-- * AIRBASE.GermanyCW.Neuruppin
|
||||
-- * AIRBASE.GermanyCW.Northeim
|
||||
-- * AIRBASE.GermanyCW.Ober_Moerlen
|
||||
-- * AIRBASE.GermanyCW.Obermehler_Schlotheim
|
||||
-- * AIRBASE.GermanyCW.Parchim
|
||||
-- * AIRBASE.GermanyCW.Peenemuende
|
||||
-- * AIRBASE.GermanyCW.Pferdsfeld
|
||||
-- * AIRBASE.GermanyCW.Pinnow
|
||||
-- * AIRBASE.GermanyCW.Pottschutthoehe
|
||||
-- * AIRBASE.GermanyCW.Ramstein
|
||||
-- * AIRBASE.GermanyCW.Rinteln
|
||||
-- * AIRBASE.GermanyCW.Schoenefeld
|
||||
-- * AIRBASE.GermanyCW.Schweinfurt
|
||||
-- * AIRBASE.GermanyCW.Sembach
|
||||
-- * AIRBASE.GermanyCW.Spangdahlem
|
||||
-- * AIRBASE.GermanyCW.Sperenberg
|
||||
-- * AIRBASE.GermanyCW.Stendal
|
||||
-- * AIRBASE.GermanyCW.Tegel
|
||||
-- * AIRBASE.GermanyCW.Tempelhof
|
||||
-- * AIRBASE.GermanyCW.Templin
|
||||
-- * AIRBASE.GermanyCW.Tutow
|
||||
-- * AIRBASE.GermanyCW.Uelzen
|
||||
-- * AIRBASE.GermanyCW.Uetersen
|
||||
-- * AIRBASE.GermanyCW.Ummern
|
||||
-- * AIRBASE.GermanyCW.Verden_Scharnhorst
|
||||
-- * AIRBASE.GermanyCW.Walldorf
|
||||
-- * AIRBASE.GermanyCW.Waren_Vielist
|
||||
-- * AIRBASE.GermanyCW.Werneuchen
|
||||
-- * AIRBASE.GermanyCW.Weser_Wuemme
|
||||
-- * AIRBASE.GermanyCW.Wiesbaden
|
||||
-- * AIRBASE.GermanyCW.Wismar
|
||||
-- * AIRBASE.GermanyCW.Wittstock
|
||||
-- * AIRBASE.GermanyCW.Worms
|
||||
-- * AIRBASE.GermanyCW.Wunstorf
|
||||
-- * AIRBASE.GermanyCW.Zerbst
|
||||
-- * AIRBASE.GermanyCW.Zweibruecken
|
||||
--
|
||||
-- @field GermanyCW
|
||||
AIRBASE.GermanyCW = {
|
||||
["Airracing_Frankfurt"] = "Airracing Frankfurt",
|
||||
["Airracing_Koblenz"] = "Airracing Koblenz",
|
||||
["Airracing_Luebeck"] = "Airracing Lubeck",
|
||||
["Allstedt"] = "Allstedt",
|
||||
["Altes_Lager"] = "Altes Lager",
|
||||
["Bad_Duerkheim"] = "Bad Durkheim",
|
||||
["Barth"] = "Barth",
|
||||
["Bienenfarm"] = "Bienenfarm",
|
||||
["Bindersleben"] = "Bindersleben",
|
||||
["Bitburg"] = "Bitburg",
|
||||
["Braunschweig"] = "Braunschweig",
|
||||
["Bremen"] = "Bremen",
|
||||
["Briest"] = "Briest",
|
||||
["Buechel"] = "Buchel",
|
||||
["Bueckeburg"] = "Buckeburg",
|
||||
["Celle"] = "Celle",
|
||||
["Cochstedt"] = "Cochstedt",
|
||||
["Damgarten"] = "Damgarten",
|
||||
["Dedelow"] = "Dedelow",
|
||||
["Dessau"] = "Dessau",
|
||||
["Fassberg"] = "Fassberg",
|
||||
["Finow"] = "Finow",
|
||||
["Frankfurt"] = "Frankfurt",
|
||||
["Fritzlar"] = "Fritzlar",
|
||||
["Fulda"] = "Fulda",
|
||||
["Gardelegen"] = "Gardelegen",
|
||||
["Garz"] = "Garz",
|
||||
["Gatow"] = "Gatow",
|
||||
["Gelnhausen"] = "Gelnhausen",
|
||||
["Giebelstadt"] = "Giebelstadt",
|
||||
["Glindbruchkippe"] = "Glindbruchkippe ",
|
||||
["Gross_Mohrdorf"] = "Gross Mohrdorf",
|
||||
["Grosse_Wiese"] = "Grosse Wiese",
|
||||
["Guetersloh"] = "Gutersloh",
|
||||
["H_FRG_01"] = "H FRG 01",
|
||||
["H_FRG_02"] = "H FRG 02",
|
||||
["H_FRG_03"] = "H FRG 03",
|
||||
["H_FRG_04"] = "H FRG 04",
|
||||
["H_FRG_05"] = "H FRG 05",
|
||||
["H_FRG_06"] = "H FRG 06",
|
||||
["H_FRG_07"] = "H FRG 07",
|
||||
["H_FRG_08"] = "H FRG 08",
|
||||
["H_FRG_09"] = "H FRG 09",
|
||||
["H_FRG_10"] = "H FRG 10",
|
||||
["H_FRG_11"] = "H FRG 11",
|
||||
["H_FRG_12"] = "H FRG 12",
|
||||
["H_FRG_13"] = "H FRG 13",
|
||||
["H_FRG_14"] = "H FRG 14",
|
||||
["H_FRG_15"] = "H FRG 15",
|
||||
["H_FRG_16"] = "H FRG 16",
|
||||
["H_FRG_17"] = "H FRG 17",
|
||||
["H_FRG_18"] = "H FRG 18",
|
||||
["H_FRG_19"] = "H FRG 19",
|
||||
["H_FRG_20"] = "H FRG 20",
|
||||
["H_FRG_21"] = "H FRG 21",
|
||||
["H_FRG_23"] = "H FRG 23",
|
||||
["H_FRG_25"] = "H FRG 25",
|
||||
["H_FRG_27"] = "H FRG 27",
|
||||
["H_FRG_30"] = "H FRG 30",
|
||||
["H_FRG_31"] = "H FRG 31",
|
||||
["H_FRG_32"] = "H FRG 32",
|
||||
["H_FRG_34"] = "H FRG 34",
|
||||
["H_FRG_38"] = "H FRG 38",
|
||||
["H_FRG_39"] = "H FRG 39",
|
||||
["H_FRG_40"] = "H FRG 40",
|
||||
["H_FRG_41"] = "H FRG 41",
|
||||
["H_FRG_42"] = "H FRG 42",
|
||||
["H_FRG_43"] = "H FRG 43",
|
||||
["H_FRG_44"] = "H FRG 44",
|
||||
["H_FRG_45"] = "H FRG 45",
|
||||
["H_FRG_46"] = "H FRG 46",
|
||||
["H_FRG_47"] = "H FRG 47",
|
||||
["H_FRG_48"] = "H FRG 48",
|
||||
["H_FRG_49"] = "H FRG 49",
|
||||
["H_FRG_50"] = "H FRG 50",
|
||||
["H_FRG_51"] = "H FRG 51",
|
||||
["H_GDR_01"] = "H GDR 01",
|
||||
["H_GDR_02"] = "H GDR 02",
|
||||
["H_GDR_03"] = "H GDR 03",
|
||||
["H_GDR_04"] = "H GDR 04",
|
||||
["H_GDR_05"] = "H GDR 05",
|
||||
["H_GDR_06"] = "H GDR 06",
|
||||
["H_GDR_07"] = "H GDR 07",
|
||||
["H_GDR_08"] = "H GDR 08",
|
||||
["H_GDR_09"] = "H GDR 09",
|
||||
["H_GDR_10"] = "H GDR 10",
|
||||
["H_GDR_11"] = "H GDR 11",
|
||||
["H_GDR_12"] = "H GDR 12",
|
||||
["H_GDR_13"] = "H GDR 13",
|
||||
["H_GDR_14"] = "H GDR 14",
|
||||
["H_GDR_15"] = "H GDR 15",
|
||||
["H_GDR_16"] = "H GDR 16",
|
||||
["H_GDR_17"] = "H GDR 17",
|
||||
["H_GDR_18"] = "H GDR 18",
|
||||
["H_GDR_19"] = "H GDR 19",
|
||||
["H_GDR_21"] = "H GDR 21",
|
||||
["H_GDR_22"] = "H GDR 22",
|
||||
["H_GDR_24"] = "H GDR 24",
|
||||
["H_GDR_25"] = "H GDR 25",
|
||||
["H_GDR_26"] = "H GDR 26",
|
||||
["H_GDR_30"] = "H GDR 30",
|
||||
["H_GDR_31"] = "H GDR 31",
|
||||
["H_GDR_32"] = "H GDR 32",
|
||||
["H_GDR_33"] = "H GDR 33",
|
||||
["H_GDR_34"] = "H GDR 34",
|
||||
["H_Med_FRG_01"] = "H Med FRG 01",
|
||||
["H_Med_FRG_02"] = "H Med FRG 02",
|
||||
["H_Med_FRG_04"] = "H Med FRG 04",
|
||||
["H_Med_FRG_06"] = "H Med FRG 06",
|
||||
["H_Med_FRG_11"] = "H Med FRG 11",
|
||||
["H_Med_FRG_12"] = "H Med FRG 12",
|
||||
["H_Med_FRG_13"] = "H Med FRG 13",
|
||||
["H_Med_FRG_14"] = "H Med FRG 14",
|
||||
["H_Med_FRG_15"] = "H Med FRG 15",
|
||||
["H_Med_FRG_16"] = "H Med FRG 16",
|
||||
["H_Med_FRG_17"] = "H Med FRG 17",
|
||||
["H_Med_FRG_21"] = "H Med FRG 21",
|
||||
["H_Med_FRG_24"] = "H Med FRG 24",
|
||||
["H_Med_FRG_26"] = "H Med FRG 26",
|
||||
["H_Med_FRG_27"] = "H Med FRG 27",
|
||||
["H_Med_FRG_29"] = "H Med FRG 29",
|
||||
["H_Med_GDR_01"] = "H Med GDR 01",
|
||||
["H_Med_GDR_02"] = "H Med GDR 02",
|
||||
["H_Med_GDR_03"] = "H Med GDR 03",
|
||||
["H_Med_GDR_08"] = "H Med GDR 08",
|
||||
["H_Med_GDR_09"] = "H Med GDR 09",
|
||||
["H_Med_GDR_10"] = "H Med GDR 10",
|
||||
["H_Med_GDR_11"] = "H Med GDR 11",
|
||||
["H_Med_GDR_12"] = "H Med GDR 12",
|
||||
["H_Med_GDR_13"] = "H Med GDR 13",
|
||||
["H_Med_GDR_14"] = "H Med GDR 14",
|
||||
["H_Med_GDR_16"] = "H Med GDR 16",
|
||||
["H_Radar_FRG_02"] = "H Radar FRG 02",
|
||||
["H_Radar_GDR_01"] = "H Radar GDR 01",
|
||||
["H_Radar_GDR_02"] = "H Radar GDR 02",
|
||||
["H_Radar_GDR_03"] = "H Radar GDR 03",
|
||||
["H_Radar_GDR_04"] = "H Radar GDR 04",
|
||||
["H_Radar_GDR_05"] = "H Radar GDR 05",
|
||||
["H_Radar_GDR_06"] = "H Radar GDR 06",
|
||||
["H_Radar_GDR_07"] = "H Radar GDR 07",
|
||||
["H_Radar_GDR_08"] = "H Radar GDR 08",
|
||||
["H_Radar_GDR_09"] = "H Radar GDR 09",
|
||||
["Hahn"] = "Hahn",
|
||||
["Haina"] = "Haina",
|
||||
["Hamburg"] = "Hamburg",
|
||||
["Hamburg_Finkenwerder"] = "Hamburg Finkenwerder",
|
||||
["Hannover"] = "Hannover",
|
||||
["Hasselfelde"] = "Hasselfelde",
|
||||
["Herrenteich"] = "Herrenteich",
|
||||
["Hildesheim"] = "Hildesheim",
|
||||
["Hockenheim"] = "Hockenheim",
|
||||
["Holzdorf"] = "Holzdorf",
|
||||
["Kammermark"] = "Kammermark",
|
||||
["Koethen"] = "Kothen",
|
||||
["Laage"] = "Laage",
|
||||
["Langenselbold"] = "Langenselbold",
|
||||
["Laerz"] = "Larz",
|
||||
["Leipzig_Halle"] = "Leipzig Halle",
|
||||
["Leipzig_Mockau"] = "Leipzig Mockau",
|
||||
["Luebeck"] = "Lubeck",
|
||||
["Lueneburg"] = "Luneburg",
|
||||
["Mahlwinkel"] = "Mahlwinkel",
|
||||
["Mendig"] = "Mendig",
|
||||
["Merseburg"] = "Merseburg",
|
||||
["Neubrandenburg"] = "Neubrandenburg",
|
||||
["Neuruppin"] = "Neuruppin",
|
||||
["Northeim"] = "Northeim",
|
||||
["Ober_Moerlen"] = "Ober-Morlen",
|
||||
["Obermehler_Schlotheim"] = "Obermehler Schlotheim",
|
||||
["Parchim"] = "Parchim",
|
||||
["Peenemuende"] = "Peenemunde",
|
||||
["Pferdsfeld"] = "Pferdsfeld",
|
||||
["Pinnow"] = "Pinnow",
|
||||
["Pottschutthoehe"] = "Pottschutthohe",
|
||||
["Ramstein"] = "Ramstein",
|
||||
["Rinteln"] = "Rinteln",
|
||||
["Schoenefeld"] = "Schonefeld",
|
||||
["Schweinfurt"] = "Schweinfurt",
|
||||
["Sembach"] = "Sembach",
|
||||
["Spangdahlem"] = "Spangdahlem",
|
||||
["Sperenberg"] = "Sperenberg",
|
||||
["Stendal"] = "Stendal",
|
||||
["Tegel"] = "Tegel",
|
||||
["Tempelhof"] = "Tempelhof",
|
||||
["Templin"] = "Templin",
|
||||
["Tutow"] = "Tutow",
|
||||
["Uelzen"] = "Uelzen",
|
||||
["Uetersen"] = "Uetersen",
|
||||
["Ummern"] = "Ummern",
|
||||
["Verden_Scharnhorst"] = "Verden-Scharnhorst",
|
||||
["Walldorf"] = "Walldorf",
|
||||
["Waren_Vielist"] = "Waren Vielist",
|
||||
["Werneuchen"] = "Werneuchen",
|
||||
["Weser_Wuemme"] = "Weser Wumme",
|
||||
["Wiesbaden"] = "Wiesbaden",
|
||||
["Wismar"] = "Wismar",
|
||||
["Wittstock"] = "Wittstock",
|
||||
["Worms"] = "Worms",
|
||||
["Wunstorf"] = "Wunstorf",
|
||||
["Zerbst"] = "Zerbst",
|
||||
["Zweibruecken"] = "Zweibrucken",
|
||||
}
|
||||
|
||||
|
||||
--- AIRBASE.ParkingSpot ".Coordinate, ".TerminalID", ".TerminalType", ".TOAC", ".Free", ".TerminalID0", ".DistToRwy".
|
||||
-- @type AIRBASE.ParkingSpot
|
||||
-- @field Core.Point#COORDINATE Coordinate Coordinate of the parking spot.
|
||||
@@ -2131,7 +2553,7 @@ function AIRBASE:GetRunwayByName(Name)
|
||||
|
||||
-- Name including L or R, e.g. "31L".
|
||||
local name=self:GetRunwayName(runway)
|
||||
|
||||
self:T("Check Runway Name: "..name)
|
||||
if name==Name:upper() then
|
||||
return runway
|
||||
end
|
||||
@@ -2158,7 +2580,7 @@ function AIRBASE:_InitRunways(IncludeInverse)
|
||||
|
||||
--- Function to create a runway data table.
|
||||
local function _createRunway(name, course, width, length, center)
|
||||
|
||||
self:T("Create Runway: name = "..name)
|
||||
-- Bearing in rad.
|
||||
local bearing=-1*course
|
||||
|
||||
@@ -2174,6 +2596,7 @@ function AIRBASE:_InitRunways(IncludeInverse)
|
||||
runway.name=string.format("%02d", tonumber(namefromheading))
|
||||
else
|
||||
runway.name=string.format("%02d", tonumber(name))
|
||||
--self:I("RunwayName: "..runway.name)
|
||||
end
|
||||
|
||||
--runway.name=string.format("%02d", tonumber(name))
|
||||
@@ -2495,7 +2918,7 @@ function AIRBASE:GetRunwayData(magvar, mark)
|
||||
runway.endpoint=c2
|
||||
|
||||
-- Debug info.
|
||||
--self:I(string.format("Airbase %s: Adding runway id=%s, heading=%03d, length=%d m i=%d j=%d", self:GetName(), runway.idx, runway.heading, runway.length, i, j))
|
||||
self:T(string.format("Airbase %s: Adding runway id=%s, heading=%03d, length=%d m i=%d j=%d", self:GetName(), runway.idx, runway.heading, runway.length, i, j))
|
||||
|
||||
-- Debug mark
|
||||
if mark then
|
||||
@@ -2622,8 +3045,8 @@ function AIRBASE:GetRunwayIntoWind(PreferLeft)
|
||||
|
||||
-- Loop over runways.
|
||||
local dotmin=nil
|
||||
for i,_runway in pairs(runways) do
|
||||
local runway=_runway --#AIRBASE.Runway
|
||||
for i ,_runway in pairs(runways) do
|
||||
local runway=_runway --#AIRBASE.Runway
|
||||
|
||||
if PreferLeft==nil or PreferLeft==runway.isLeft then
|
||||
|
||||
|
||||
@@ -994,6 +994,65 @@ function CONTROLLABLE:CommandSetFrequencyForUnit(Frequency,Modulation,Power,Unit
|
||||
return self
|
||||
end
|
||||
|
||||
--- [AIR] Set smoke on or off. See [DCS command smoke on off](https://wiki.hoggitworld.com/view/DCS_command_smoke_on_off)
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #boolean OnOff Set to true for on and false for off. Defaults to true.
|
||||
-- @param #number Delay (Optional) Delay the command by this many seconds.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:CommandSmokeOnOff(OnOff, Delay)
|
||||
local switch = (OnOff == nil) and true or OnOff
|
||||
local command = {
|
||||
id = 'SMOKE_ON_OFF',
|
||||
params = {
|
||||
value = switch
|
||||
}
|
||||
}
|
||||
if Delay and Delay>0 then
|
||||
SCHEDULER:New(nil,self.CommandSmokeOnOff,{self,switch},Delay)
|
||||
else
|
||||
self:SetCommand(command)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [AIR] Set smoke on. See [DCS command smoke on off](https://wiki.hoggitworld.com/view/DCS_command_smoke_on_off)
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number Delay (Optional) Delay the command by this many seconds.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:CommandSmokeON(Delay)
|
||||
local command = {
|
||||
id = 'SMOKE_ON_OFF',
|
||||
params = {
|
||||
value = true
|
||||
}
|
||||
}
|
||||
if Delay and Delay>0 then
|
||||
SCHEDULER:New(nil,self.CommandSmokeON,{self},Delay)
|
||||
else
|
||||
self:SetCommand(command)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- [AIR] Set smoke off. See [DCS command smoke on off](https://wiki.hoggitworld.com/view/DCS_command_smoke_on_off)
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number Delay (Optional) Delay the command by this many seconds.
|
||||
-- @return #CONTROLLABLE self
|
||||
function CONTROLLABLE:CommandSmokeOFF(Delay)
|
||||
local command = {
|
||||
id = 'SMOKE_ON_OFF',
|
||||
params = {
|
||||
value = false
|
||||
}
|
||||
}
|
||||
if Delay and Delay>0 then
|
||||
SCHEDULER:New(nil,self.CommandSmokeOFF,{self},Delay)
|
||||
else
|
||||
self:SetCommand(command)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Set EPLRS data link on/off.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #boolean SwitchOnOff If true (or nil) switch EPLRS on. If false switch off.
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
--
|
||||
-- ## Main Features:
|
||||
--
|
||||
-- * Convenient access to DCS API functions
|
||||
-- * Convenient access to Ground Crew created cargo items.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ## Example Missions:
|
||||
--
|
||||
-- Demo missions can be found on [github](https://github.com/FlightControl-Master/MOOSE_Demos/tree/master/Wrapper/Storage).
|
||||
-- Demo missions can be found on [github](https://github.com/FlightControl-Master/MOOSE_Demos/tree/master/).
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Author: **Applevangelist**
|
||||
-- ### Author: **Applevangelist**; additional checks **Chesster**
|
||||
--
|
||||
-- ===
|
||||
-- @module Wrapper.DynamicCargo
|
||||
@@ -124,7 +124,7 @@ DYNAMICCARGO.AircraftDimensions = {
|
||||
|
||||
--- DYNAMICCARGO class version.
|
||||
-- @field #string version
|
||||
DYNAMICCARGO.version="0.0.5"
|
||||
DYNAMICCARGO.version="0.0.7"
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- TODO list
|
||||
@@ -183,7 +183,7 @@ end
|
||||
-- @param #DYNAMICCARGO self
|
||||
-- @return DCS static object
|
||||
function DYNAMICCARGO:GetDCSObject()
|
||||
local DCSStatic = Unit.getByName( self.StaticName )
|
||||
local DCSStatic = StaticObject.getByName( self.StaticName ) or Unit.getByName( self.StaticName )
|
||||
if DCSStatic then
|
||||
return DCSStatic
|
||||
end
|
||||
@@ -227,7 +227,7 @@ end
|
||||
-- @param #DYNAMICCARGO self
|
||||
-- @return #boolean Outcome
|
||||
function DYNAMICCARGO:IsUnloaded()
|
||||
if self.CargoState and self.CargoState == DYNAMICCARGO.State.REMOVED then
|
||||
if self.CargoState and self.CargoState == DYNAMICCARGO.State.UNLOADED then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
@@ -238,7 +238,7 @@ end
|
||||
-- @param #DYNAMICCARGO self
|
||||
-- @return #boolean Outcome
|
||||
function DYNAMICCARGO:IsRemoved()
|
||||
if self.CargoState and self.CargoState == DYNAMICCARGO.State.UNLOADED then
|
||||
if self.CargoState and self.CargoState == DYNAMICCARGO.State.REMOVED then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
@@ -376,6 +376,33 @@ end
|
||||
-- Private Functions
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--- [Internal] _Get helo hovering intel
|
||||
-- @param #DYNAMICCARGO self
|
||||
-- @param Wrapper.Unit#UNIT Unit The Unit to test
|
||||
-- @param #number ropelength Ropelength to test
|
||||
-- @return #boolean Outcome
|
||||
function DYNAMICCARGO:_HeloHovering(Unit,ropelength)
|
||||
local DCSUnit = Unit:GetDCSObject() --DCS#Unit
|
||||
local hovering = false
|
||||
local Height = 0
|
||||
if DCSUnit then
|
||||
local UnitInAir = DCSUnit:inAir()
|
||||
local UnitCategory = DCSUnit:getDesc().category
|
||||
if UnitInAir == true and UnitCategory == 1 then
|
||||
local VelocityVec3 = DCSUnit:getVelocity()
|
||||
local Velocity = UTILS.VecNorm(VelocityVec3)
|
||||
local Coordinate = DCSUnit:getPoint()
|
||||
local LandHeight = land.getHeight({ x = Coordinate.x, y = Coordinate.z })
|
||||
Height = Coordinate.y - LandHeight
|
||||
if Velocity < 1 and Height <= ropelength and Height > 6 then -- hover lower than ropelength but higher than the normal FARP height.
|
||||
hovering = true
|
||||
end
|
||||
end
|
||||
return hovering, Height
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--- [Internal] _Get Possible Player Helo Nearby
|
||||
-- @param #DYNAMICCARGO self
|
||||
-- @param Core.Point#COORDINATE pos
|
||||
@@ -393,30 +420,37 @@ function DYNAMICCARGO:_GetPossibleHeloNearby(pos,loading)
|
||||
local name = helo:GetPlayerName() or _DATABASE:_FindPlayerNameByUnitName(helo:GetName()) or "None"
|
||||
self:T(self.lid.." Checking: "..name)
|
||||
local hpos = helo:GetCoordinate()
|
||||
-- TODO Unloading via sling load?
|
||||
--local inair = hpos.y-hpos:GetLandHeight() > 4.5 and true or false -- Standard FARP is 4.5m
|
||||
local inair = helo:InAir()
|
||||
self:T(self.lid.." InAir: AGL/InAir: "..hpos.y-hpos:GetLandHeight().."/"..tostring(inair))
|
||||
-- TODO Check unloading via sling load?
|
||||
local typename = helo:GetTypeName()
|
||||
if hpos and typename and inair == false then
|
||||
local dimensions = DYNAMICCARGO.AircraftDimensions[typename]
|
||||
if dimensions then
|
||||
local delta2D = hpos:Get2DDistance(pos)
|
||||
local delta3D = hpos:Get3DDistance(pos)
|
||||
if self.testing then
|
||||
self:T(string.format("Cargo relative position: 2D %dm | 3D %dm",delta2D,delta3D))
|
||||
self:T(string.format("Helo dimension: length %dm | width %dm | rope %dm",dimensions.length,dimensions.width,dimensions.ropelength))
|
||||
end
|
||||
if loading~=true and delta2D > dimensions.length or delta2D > dimensions.width or delta3D > dimensions.ropelength then
|
||||
success = true
|
||||
Helo = helo
|
||||
Playername = name
|
||||
end
|
||||
if loading == true and delta2D < dimensions.length or delta2D < dimensions.width or delta3D < dimensions.ropelength then
|
||||
success = true
|
||||
Helo = helo
|
||||
Playername = name
|
||||
end
|
||||
local dimensions = DYNAMICCARGO.AircraftDimensions[typename]
|
||||
local hovering, height = self:_HeloHovering(helo,dimensions.ropelength)
|
||||
local helolanded = not helo:InAir()
|
||||
self:T(self.lid.." InAir: AGL/Hovering: "..hpos.y-hpos:GetLandHeight().."/"..tostring(hovering))
|
||||
if hpos and typename and dimensions then
|
||||
local delta2D = hpos:Get2DDistance(pos)
|
||||
local delta3D = hpos:Get3DDistance(pos)
|
||||
if self.testing then
|
||||
self:T(string.format("Cargo relative position: 2D %dm | 3D %dm",delta2D,delta3D))
|
||||
self:T(string.format("Helo dimension: length %dm | width %dm | rope %dm",dimensions.length,dimensions.width,dimensions.ropelength))
|
||||
self:T(string.format("Helo hovering: %s at %dm",tostring(hovering),height))
|
||||
end
|
||||
-- unloading from ground
|
||||
if loading~=true and (delta2D > dimensions.length or delta2D > dimensions.width) and helolanded then -- Theoretically the cargo could still be attached to the sling if landed next to the cargo. But once moved again it would go back into loaded state once lifted again.
|
||||
success = true
|
||||
Helo = helo
|
||||
Playername = name
|
||||
end
|
||||
-- unloading from hover/rope
|
||||
if loading~=true and delta3D > dimensions.ropelength then
|
||||
success = true
|
||||
Helo = helo
|
||||
Playername = name
|
||||
end
|
||||
-- loading
|
||||
if loading == true and ((delta2D < dimensions.length and delta2D < dimensions.width and helolanded) or (delta3D == dimensions.ropelength and helo:InAir())) then -- Loaded via ground or sling
|
||||
success = true
|
||||
Helo = helo
|
||||
Playername = name
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -434,20 +468,22 @@ function DYNAMICCARGO:_UpdatePosition()
|
||||
self:T(string.format("Cargo position: x=%d, y=%d, z=%d",pos.x,pos.y,pos.z))
|
||||
self:T(string.format("Last position: x=%d, y=%d, z=%d",self.LastPosition.x,self.LastPosition.y,self.LastPosition.z))
|
||||
end
|
||||
if UTILS.Round(UTILS.VecDist3D(pos,self.LastPosition),2) > 0.5 then
|
||||
if UTILS.Round(UTILS.VecDist3D(pos,self.LastPosition),2) > 0.5 then -- This checks if the cargo has moved more than 0.5m since last check. If so then the cargo is loaded
|
||||
---------------
|
||||
-- LOAD Cargo
|
||||
---------------
|
||||
if self.CargoState == DYNAMICCARGO.State.NEW then
|
||||
local isloaded, client, playername = self:_GetPossibleHeloNearby(pos,true)
|
||||
if self.CargoState == DYNAMICCARGO.State.NEW or self.CargoState == DYNAMICCARGO.State.UNLOADED then
|
||||
local isloaded, client, playername = self:_GetPossibleHeloNearby(pos,true)
|
||||
self:T(self.lid.." moved! NEW -> LOADED by "..tostring(playername))
|
||||
self.CargoState = DYNAMICCARGO.State.LOADED
|
||||
self.Owner = playername
|
||||
_DATABASE:CreateEventDynamicCargoLoaded(self)
|
||||
_DATABASE:CreateEventDynamicCargoLoaded(self)
|
||||
end
|
||||
---------------
|
||||
-- UNLOAD Cargo
|
||||
---------------
|
||||
elseif self.CargoState == DYNAMICCARGO.State.LOADED then
|
||||
---------------
|
||||
-- If the cargo is stationary then we need to end this condition here to check whether it is unloaded or still onboard or still hooked if anyone can hover that precisly
|
||||
elseif self.CargoState == DYNAMICCARGO.State.LOADED then
|
||||
-- TODO add checker if we are in flight somehow
|
||||
-- ensure not just the helo is moving
|
||||
local count = _DYNAMICCARGO_HELOS:CountAlive()
|
||||
@@ -459,26 +495,19 @@ function DYNAMICCARGO:_UpdatePosition()
|
||||
local isunloaded = true
|
||||
local client
|
||||
local playername = self.Owner
|
||||
if count > 0 and (agl > 0 or self.testing) then
|
||||
self:T(self.lid.." Possible alive helos: "..count or -1)
|
||||
if agl ~= 0 or self.testing then
|
||||
isunloaded, client, playername = self:_GetPossibleHeloNearby(pos,false)
|
||||
end
|
||||
if count > 0 then
|
||||
self:T(self.lid.." Possible alive helos: "..count or -1)
|
||||
isunloaded, client, playername = self:_GetPossibleHeloNearby(pos,false)
|
||||
if isunloaded then
|
||||
self:T(self.lid.." moved! LOADED -> UNLOADED by "..tostring(playername))
|
||||
self.CargoState = DYNAMICCARGO.State.UNLOADED
|
||||
self.Owner = playername
|
||||
_DATABASE:CreateEventDynamicCargoUnloaded(self)
|
||||
end
|
||||
elseif count > 0 and agl == 0 then
|
||||
self:T(self.lid.." moved! LOADED -> UNLOADED by "..tostring(playername))
|
||||
self.CargoState = DYNAMICCARGO.State.UNLOADED
|
||||
self.Owner = playername
|
||||
_DATABASE:CreateEventDynamicCargoUnloaded(self)
|
||||
end
|
||||
end
|
||||
end
|
||||
self.LastPosition = pos
|
||||
end
|
||||
--end
|
||||
else
|
||||
---------------
|
||||
-- REMOVED Cargo
|
||||
|
||||
@@ -912,15 +912,18 @@ function GROUP:GetVelocityVec3()
|
||||
|
||||
if DCSGroup and DCSGroup:isExist() then
|
||||
local GroupUnits = DCSGroup:getUnits()
|
||||
local GroupCount = #GroupUnits
|
||||
local GroupCount = 0
|
||||
|
||||
local VelocityVec3 = { x = 0, y = 0, z = 0 }
|
||||
|
||||
for _, DCSUnit in pairs( GroupUnits ) do
|
||||
local UnitVelocityVec3 = DCSUnit:getVelocity()
|
||||
VelocityVec3.x = VelocityVec3.x + UnitVelocityVec3.x
|
||||
VelocityVec3.y = VelocityVec3.y + UnitVelocityVec3.y
|
||||
VelocityVec3.z = VelocityVec3.z + UnitVelocityVec3.z
|
||||
if DCSUnit:isExist() and DCSUnit:isActive() then
|
||||
local UnitVelocityVec3 = DCSUnit:getVelocity()
|
||||
VelocityVec3.x = VelocityVec3.x + UnitVelocityVec3.x
|
||||
VelocityVec3.y = VelocityVec3.y + UnitVelocityVec3.y
|
||||
VelocityVec3.z = VelocityVec3.z + UnitVelocityVec3.z
|
||||
GroupCount = GroupCount + 1
|
||||
end
|
||||
end
|
||||
|
||||
VelocityVec3.x = VelocityVec3.x / GroupCount
|
||||
@@ -1179,9 +1182,9 @@ function GROUP:GetAverageVec3()
|
||||
end
|
||||
end
|
||||
|
||||
--- Returns a POINT_VEC2 object indicating the point in 2D of the first UNIT of the GROUP within the mission.
|
||||
--- Returns a COORDINATE object indicating the point in 2D of the first UNIT of the GROUP within the mission.
|
||||
-- @param #GROUP self
|
||||
-- @return Core.Point#POINT_VEC2 The 2D point vector of the first DCS Unit of the GROUP.
|
||||
-- @return Core.Point#COORDINATE The 3D point vector of the first DCS Unit of the GROUP.
|
||||
-- @return #nil The first UNIT is not existing or alive.
|
||||
function GROUP:GetPointVec2()
|
||||
--self:F2(self.GroupName)
|
||||
@@ -1194,7 +1197,7 @@ function GROUP:GetPointVec2()
|
||||
return FirstUnitPointVec2
|
||||
end
|
||||
|
||||
BASE:E( { "Cannot GetPointVec2", Group = self, Alive = self:IsAlive() } )
|
||||
BASE:E( { "Cannot get COORDINATE", Group = self, Alive = self:IsAlive() } )
|
||||
|
||||
return nil
|
||||
end
|
||||
@@ -1754,11 +1757,13 @@ function GROUP:GetMaxVelocity()
|
||||
|
||||
for Index, UnitData in pairs( DCSGroup:getUnits() ) do
|
||||
|
||||
local UnitVelocityVec3 = UnitData:getVelocity()
|
||||
local UnitVelocity = math.abs( UnitVelocityVec3.x ) + math.abs( UnitVelocityVec3.y ) + math.abs( UnitVelocityVec3.z )
|
||||
if UnitData:isExist() and UnitData:isActive() then
|
||||
local UnitVelocityVec3 = UnitData:getVelocity()
|
||||
local UnitVelocity = math.abs( UnitVelocityVec3.x ) + math.abs( UnitVelocityVec3.y ) + math.abs( UnitVelocityVec3.z )
|
||||
|
||||
if UnitVelocity > GroupVelocityMax then
|
||||
GroupVelocityMax = UnitVelocity
|
||||
if UnitVelocity > GroupVelocityMax then
|
||||
GroupVelocityMax = UnitVelocity
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1843,7 +1848,10 @@ end
|
||||
-- @return #table
|
||||
function GROUP:GetTemplateRoutePoints()
|
||||
local GroupName = self:GetName()
|
||||
return UTILS.DeepCopy( _DATABASE:GetGroupTemplate( GroupName ).route.points )
|
||||
local template = _DATABASE:GetGroupTemplate(GroupName)
|
||||
if template and template.route and template.route.points then
|
||||
return UTILS.DeepCopy(template.route.points)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2093,7 +2101,7 @@ function GROUP:Respawn( Template, Reset )
|
||||
GroupUnitVec3 = Zone:GetRandomVec3()
|
||||
else
|
||||
if self.InitRespawnRandomizePositionInner and self.InitRespawnRandomizePositionOuter then
|
||||
GroupUnitVec3 = POINT_VEC3:NewFromVec2( From ):GetRandomPointVec3InRadius( self.InitRespawnRandomizePositionsOuter, self.InitRespawnRandomizePositionsInner )
|
||||
GroupUnitVec3 = COORDINATE:NewFromVec3(From):GetRandomVec3InRadius(self.InitRespawnRandomizePositionsOuter, self.InitRespawnRandomizePositionsInner)
|
||||
else
|
||||
GroupUnitVec3 = Zone:GetVec3()
|
||||
end
|
||||
@@ -2144,7 +2152,7 @@ function GROUP:Respawn( Template, Reset )
|
||||
GroupUnitVec3 = Zone:GetRandomVec3()
|
||||
else
|
||||
if self.InitRespawnRandomizePositionInner and self.InitRespawnRandomizePositionOuter then
|
||||
GroupUnitVec3 = POINT_VEC3:NewFromVec2( From ):GetRandomPointVec3InRadius( self.InitRespawnRandomizePositionsOuter, self.InitRespawnRandomizePositionsInner )
|
||||
GroupUnitVec3 = COORDINATE:NewFromVec2( From ):GetRandomPointVec3InRadius( self.InitRespawnRandomizePositionsOuter, self.InitRespawnRandomizePositionsInner )
|
||||
else
|
||||
GroupUnitVec3 = Zone:GetVec3()
|
||||
end
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
--- @type POSITIONABLE
|
||||
-- @field Core.Point#COORDINATE coordinate Coordinate object.
|
||||
-- @field Core.Point#POINT_VEC3 pointvec3 Point Vec3 object.
|
||||
-- @field Core.Point#COORDINATE pointvec3 Point Vec3 object.
|
||||
-- @extends Wrapper.Identifiable#IDENTIFIABLE
|
||||
|
||||
|
||||
@@ -284,9 +284,9 @@ function POSITIONABLE:GetVec2()
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission.
|
||||
--- Returns a COORDINATE object indicating the point in 2D of the POSITIONABLE within the mission.
|
||||
-- @param #POSITIONABLE self
|
||||
-- @return Core.Point#POINT_VEC2 The 2D point vector of the POSITIONABLE.
|
||||
-- @return Core.Point#COORDINATE The 3D point vector of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetPointVec2()
|
||||
self:F2( self.PositionableName )
|
||||
@@ -296,20 +296,20 @@ function POSITIONABLE:GetPointVec2()
|
||||
if DCSPositionable then
|
||||
local PositionableVec3 = DCSPositionable:getPosition().p
|
||||
|
||||
local PositionablePointVec2 = POINT_VEC2:NewFromVec3( PositionableVec3 )
|
||||
local PositionablePointVec2 = COORDINATE:NewFromVec3( PositionableVec3 )
|
||||
|
||||
-- self:F( PositionablePointVec2 )
|
||||
return PositionablePointVec2
|
||||
end
|
||||
|
||||
self:E( { "Cannot GetPointVec2", Positionable = self, Alive = self:IsAlive() } )
|
||||
self:E( { "Cannot Coordinate", Positionable = self, Alive = self:IsAlive() } )
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns a POINT_VEC3 object indicating the point in 3D of the POSITIONABLE within the mission.
|
||||
--- Returns a COORDINATE object indicating the point in 3D of the POSITIONABLE within the mission.
|
||||
-- @param #POSITIONABLE self
|
||||
-- @return Core.Point#POINT_VEC3 The 3D point vector of the POSITIONABLE.
|
||||
-- @return Core.Point#COORDINATE The 3D point vector of the POSITIONABLE.
|
||||
-- @return #nil The POSITIONABLE is not existing or alive.
|
||||
function POSITIONABLE:GetPointVec3()
|
||||
|
||||
@@ -329,8 +329,8 @@ function POSITIONABLE:GetPointVec3()
|
||||
|
||||
else
|
||||
|
||||
-- Create a new POINT_VEC3 object.
|
||||
self.pointvec3 = POINT_VEC3:NewFromVec3( PositionableVec3 )
|
||||
-- Create a new COORDINATE object.
|
||||
self.pointvec3 = COORDINATE:NewFromVec3( PositionableVec3 )
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -897,7 +897,7 @@ function UNIT:GetAmmunition()
|
||||
nAPshells = nAPshells + Nammo
|
||||
end
|
||||
|
||||
if ammotable[w].desc.typeName and string.find(ammotable[w].desc.typeName, "_HE", 1, true) then
|
||||
if ammotable[w].desc.typeName and (string.find(ammotable[w].desc.typeName, "_HE", 1, true) or string.find(ammotable[w].desc.typeName, "HESH", 1, true)) then
|
||||
nHEshells = nHEshells + Nammo
|
||||
end
|
||||
|
||||
@@ -1107,7 +1107,6 @@ function UNIT:GetUnits()
|
||||
|
||||
if DCSUnit then
|
||||
Units[1] = UNIT:Find(DCSUnit)
|
||||
- self:T3(Units)
|
||||
return Units
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# import required module
|
||||
from pathlib import Path
|
||||
import os
|
||||
import codecs
|
||||
|
||||
# assign directory
|
||||
directory = '.'
|
||||
@@ -15,8 +16,9 @@ with open( os.path.dirname(__file__) + '/docs-header.html', 'r') as file:
|
||||
# that directory
|
||||
files = Path(directory).glob('*.html')
|
||||
for file in files:
|
||||
# print(file)
|
||||
with open(file, 'r') as fileread:
|
||||
#print(file)
|
||||
#with open(file, 'r') as fileread:
|
||||
with codecs.open(file, 'r', encoding='utf-8', errors='ignore') as fileread:
|
||||
filedata = fileread.read()
|
||||
# Replace the target string
|
||||
filedata = filedata.replace( '<head>', newhead )
|
||||
|
||||
@@ -169,10 +169,6 @@ Defines an extensive API to manage 3D points in the DCS World 3D simulation spac
|
||||
**Features:**
|
||||
|
||||
* Provides a COORDINATE class, which allows to manage points in 3D space and perform various operations on it.
|
||||
* Provides a POINT_VEC2 class, which is derived from COORDINATE, and allows to manage points in 3D space, but from a
|
||||
Lat/Lon and Altitude perspective.
|
||||
* Provides a POINT_VEC3 class, which is derived from COORDINATE, and allows to manage points in 3D space, but from a
|
||||
X, Z and Y vector perspective.
|
||||
|
||||
**The coordinate system classes are essential to understand. Learn this!**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user