mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
OPS - Some changes to ARMORATTACK to update route if target is moving
This commit is contained in:
parent
e113817293
commit
f8a577749a
@ -269,6 +269,10 @@
|
|||||||
--
|
--
|
||||||
-- A troop transport mission can be created with the @{#AUFTRAG.NewTROOPTRANSPORT}() function.
|
-- A troop transport mission can be created with the @{#AUFTRAG.NewTROOPTRANSPORT}() function.
|
||||||
--
|
--
|
||||||
|
-- ## HOVER
|
||||||
|
--
|
||||||
|
-- A mission for a helicoptre or VSTOL plane to Hover at a point for a certain amount of time can be created with the @{#AUFTRAG.NewHOVER}() function.
|
||||||
|
--
|
||||||
-- # Ground Missions
|
-- # Ground Missions
|
||||||
--
|
--
|
||||||
-- ## ARTY
|
-- ## ARTY
|
||||||
@ -281,7 +285,7 @@
|
|||||||
--
|
--
|
||||||
-- # Options and Parameters
|
-- # Options and Parameters
|
||||||
--
|
--
|
||||||
--
|
-- TODO
|
||||||
--
|
--
|
||||||
-- # Assigning Missions
|
-- # Assigning Missions
|
||||||
--
|
--
|
||||||
@ -385,6 +389,7 @@ _AUFTRAGSNR=0
|
|||||||
-- @field #string BARRAGE Barrage.
|
-- @field #string BARRAGE Barrage.
|
||||||
-- @field #string ARMORATTACK Armor attack.
|
-- @field #string ARMORATTACK Armor attack.
|
||||||
-- @field #string CASENHANCED Enhanced CAS.
|
-- @field #string CASENHANCED Enhanced CAS.
|
||||||
|
-- @field #string HOVER Hover at a point.
|
||||||
AUFTRAG.Type={
|
AUFTRAG.Type={
|
||||||
ANTISHIP="Anti Ship",
|
ANTISHIP="Anti Ship",
|
||||||
AWACS="AWACS",
|
AWACS="AWACS",
|
||||||
@ -431,6 +436,7 @@ AUFTRAG.Type={
|
|||||||
-- @field #string ONGUARD On guard.
|
-- @field #string ONGUARD On guard.
|
||||||
-- @field #string ARMOREDGUARD On guard with armor.
|
-- @field #string ARMOREDGUARD On guard with armor.
|
||||||
-- @field #string BARRAGE Barrage.
|
-- @field #string BARRAGE Barrage.
|
||||||
|
-- @field #string HOVER Hover.
|
||||||
AUFTRAG.SpecialTask={
|
AUFTRAG.SpecialTask={
|
||||||
PATROLZONE="PatrolZone",
|
PATROLZONE="PatrolZone",
|
||||||
RECON="ReconMission",
|
RECON="ReconMission",
|
||||||
@ -1765,7 +1771,7 @@ end
|
|||||||
|
|
||||||
--- **[GROUND]** Create a ARMORATTACK mission. Armoured ground group(s) will go to the zone and attack.
|
--- **[GROUND]** Create a ARMORATTACK mission. Armoured ground group(s) will go to the zone and attack.
|
||||||
-- @param #AUFTRAG self
|
-- @param #AUFTRAG self
|
||||||
-- @param Wrapper.Positionable#POSITIONABLE Target The target to attack. Can be a GROUP, UNIT or STATIC object.
|
-- @param Ops.Target#TARGET Target The target to attack. Can be a GROUP, UNIT or STATIC object.
|
||||||
-- @param #number Speed Speed in knots.
|
-- @param #number Speed Speed in knots.
|
||||||
-- @param #string Formation The attack formation, e.g. "Wedge", "Vee" etc.
|
-- @param #string Formation The attack formation, e.g. "Wedge", "Vee" etc.
|
||||||
-- @return #AUFTRAG self
|
-- @return #AUFTRAG self
|
||||||
@ -1779,7 +1785,7 @@ function AUFTRAG:NewARMORATTACK(Target, Speed, Formation)
|
|||||||
|
|
||||||
mission.optionROE=ENUMS.ROE.OpenFire
|
mission.optionROE=ENUMS.ROE.OpenFire
|
||||||
mission.optionAlarm=ENUMS.AlarmState.Auto
|
mission.optionAlarm=ENUMS.AlarmState.Auto
|
||||||
mission.optionFormation="Off Road"
|
mission.optionFormation="On Road"
|
||||||
mission.optionAttackFormation=Formation or "Wedge"
|
mission.optionAttackFormation=Formation or "Wedge"
|
||||||
|
|
||||||
mission.missionFraction=1.0
|
mission.missionFraction=1.0
|
||||||
@ -5091,6 +5097,8 @@ function AUFTRAG:GetDCSMissionTask(TaskControllable)
|
|||||||
-- We create a "fake" DCS task and pass the parameters to the ARMYGROUP.
|
-- We create a "fake" DCS task and pass the parameters to the ARMYGROUP.
|
||||||
local param={}
|
local param={}
|
||||||
param.zone=self:GetObjective()
|
param.zone=self:GetObjective()
|
||||||
|
param.tVec2=param.zone:GetVec2()
|
||||||
|
param.tzone=ZONE_RADIUS:New("ARMORATTACK-Zone-"..self.auftragsnummer,param.tVec2,1000)
|
||||||
param.action="Wedge"
|
param.action="Wedge"
|
||||||
param.speed=self.missionSpeed
|
param.speed=self.missionSpeed
|
||||||
|
|
||||||
|
|||||||
@ -4642,11 +4642,15 @@ function OPSGROUP:RouteToMission(mission, delay)
|
|||||||
local armorwaypointcoord = nil
|
local armorwaypointcoord = nil
|
||||||
if mission.type==AUFTRAG.Type.ARMORATTACK then
|
if mission.type==AUFTRAG.Type.ARMORATTACK then
|
||||||
local target=mission.engageTarget:GetObject() -- Wrapper.Positionable#POSITIONABLE
|
local target=mission.engageTarget:GetObject() -- Wrapper.Positionable#POSITIONABLE
|
||||||
local zone = ZONE_RADIUS:New("AttackZone",target:GetVec2(),1000)
|
--BASE:I({mission.DCStask})
|
||||||
|
--BASE:I({mission.DCStask.params})
|
||||||
|
--local zone = ZONE_RADIUS:New("AttackZone",target:GetVec2(),1000)
|
||||||
|
local zone = mission.DCStask.params.tzone -- Core.Zone#ZONE_RADIUS
|
||||||
-- final WP
|
-- final WP
|
||||||
waypointcoord=zone:GetRandomCoordinate(0, 100, surfacetypes) -- Core.Point#COORDINATE
|
waypointcoord=zone:GetRandomCoordinate(0, 100, surfacetypes) -- Core.Point#COORDINATE
|
||||||
-- Ingress - add formation to this one
|
-- Ingress - add formation to this one
|
||||||
armorwaypointcoord = zone:GetRandomCoordinate(1000, 500, surfacetypes) -- Core.Point#COORDINATE
|
armorwaypointcoord = zone:GetRandomCoordinate(1000, 500, surfacetypes) -- Core.Point#COORDINATE
|
||||||
|
self:__EngageTarget(2,target)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add enroute tasks.
|
-- Add enroute tasks.
|
||||||
|
|||||||
@ -990,8 +990,12 @@ function TARGET:GetTargetVec3(Target)
|
|||||||
|
|
||||||
if object and object:IsAlive() then
|
if object and object:IsAlive() then
|
||||||
local vec3=object:GetVec3()
|
local vec3=object:GetVec3()
|
||||||
return vec3
|
|
||||||
|
|
||||||
|
if vec3 then
|
||||||
|
return vec3
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
else
|
else
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user