mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Helicopter AI_CARGO_DISPATCHER working (almost).
Queueing at deploy locations working.
This commit is contained in:
parent
ac7ae68ee8
commit
25a6cbcf6d
@ -108,6 +108,7 @@ function AI_CARGO_APC:New( CargoCarrier, CargoSet, CombatRadius )
|
|||||||
self:AddTransition( "*", "Monitor", "*" )
|
self:AddTransition( "*", "Monitor", "*" )
|
||||||
self:AddTransition( "*", "Follow", "Following" )
|
self:AddTransition( "*", "Follow", "Following" )
|
||||||
self:AddTransition( "*", "Guard", "Unloaded" )
|
self:AddTransition( "*", "Guard", "Unloaded" )
|
||||||
|
self:AddTransition( "*", "Home", "*" )
|
||||||
|
|
||||||
self:AddTransition( "*", "Destroyed", "Destroyed" )
|
self:AddTransition( "*", "Destroyed", "Destroyed" )
|
||||||
|
|
||||||
@ -600,14 +601,14 @@ end
|
|||||||
-- @param Core.Point#COORDINATE Coordinate
|
-- @param Core.Point#COORDINATE Coordinate
|
||||||
-- @param #number Speed
|
-- @param #number Speed
|
||||||
-- @param #string EndPointFormation The formation at the end point of the action.
|
-- @param #string EndPointFormation The formation at the end point of the action.
|
||||||
function AI_CARGO_APC:onafterPickup( APC, From, Event, To, Coordinate, Speed, EndPointFormation )
|
function AI_CARGO_APC:onafterPickup( APC, From, Event, To, Coordinate )
|
||||||
|
|
||||||
if APC and APC:IsAlive() then
|
if APC and APC:IsAlive() then
|
||||||
|
|
||||||
if Coordinate then
|
if Coordinate then
|
||||||
self.RoutePickup = true
|
self.RoutePickup = true
|
||||||
|
|
||||||
local Waypoints = APC:TaskGroundOnRoad( Coordinate, Speed, EndPointFormation )
|
local Waypoints = APC:TaskGroundOnRoad( Coordinate, 150, "Line abreast" )
|
||||||
|
|
||||||
local TaskFunction = APC:TaskFunction( "AI_CARGO_APC._Pickup", self )
|
local TaskFunction = APC:TaskFunction( "AI_CARGO_APC._Pickup", self )
|
||||||
|
|
||||||
@ -634,13 +635,13 @@ end
|
|||||||
-- @param Core.Point#COORDINATE Coordinate
|
-- @param Core.Point#COORDINATE Coordinate
|
||||||
-- @param #number Speed
|
-- @param #number Speed
|
||||||
-- @param #string EndPointFormation The formation at the end point of the action.
|
-- @param #string EndPointFormation The formation at the end point of the action.
|
||||||
function AI_CARGO_APC:onafterDeploy( APC, From, Event, To, Coordinate, Speed, EndPointFormation )
|
function AI_CARGO_APC:onafterDeploy( APC, From, Event, To, Coordinate )
|
||||||
|
|
||||||
if APC and APC:IsAlive() then
|
if APC and APC:IsAlive() then
|
||||||
|
|
||||||
self.RouteDeploy = true
|
self.RouteDeploy = true
|
||||||
|
|
||||||
local Waypoints = APC:TaskGroundOnRoad( Coordinate, Speed, EndPointFormation )
|
local Waypoints = APC:TaskGroundOnRoad( Coordinate, 150, "Line abreast" )
|
||||||
|
|
||||||
local TaskFunction = APC:TaskFunction( "AI_CARGO_APC._Deploy", self )
|
local TaskFunction = APC:TaskFunction( "AI_CARGO_APC._Deploy", self )
|
||||||
|
|
||||||
@ -653,3 +654,27 @@ function AI_CARGO_APC:onafterDeploy( APC, From, Event, To, Coordinate, Speed, En
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- @param #AI_CARGO_HELICOPTER self
|
||||||
|
-- @param Wrapper.Group#GROUP APC
|
||||||
|
-- @param From
|
||||||
|
-- @param Event
|
||||||
|
-- @param To
|
||||||
|
-- @param Core.Point#COORDINATE Coordinate
|
||||||
|
-- @param #number Speed
|
||||||
|
function AI_CARGO_APC:onafterHome( APC, From, Event, To, Coordinate )
|
||||||
|
|
||||||
|
if APC and APC:IsAlive() ~= nil then
|
||||||
|
|
||||||
|
self.RouteHome = true
|
||||||
|
|
||||||
|
local Waypoints = APC:TaskGroundOnRoad( Coordinate, 120, "Line abreast" )
|
||||||
|
|
||||||
|
self:F({Waypoints = Waypoints})
|
||||||
|
local Waypoint = Waypoints[#Waypoints]
|
||||||
|
|
||||||
|
APC:Route( Waypoints, 1 ) -- Move after a random seconds to the Route. See the Route method for details.
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|||||||
@ -37,11 +37,13 @@ AI_CARGO_DISPATCHER = {
|
|||||||
-- @map <Wrapper.Group#GROUP, AI.AI_Cargo_APC#AI_CARGO_APC>
|
-- @map <Wrapper.Group#GROUP, AI.AI_Cargo_APC#AI_CARGO_APC>
|
||||||
|
|
||||||
--- @field #AI_CARGO_DISPATCHER.AI_CARGO_APC
|
--- @field #AI_CARGO_DISPATCHER.AI_CARGO_APC
|
||||||
AI_CARGO_DISPATCHER.AICargoAPC = {}
|
AI_CARGO_DISPATCHER.AI_Cargo = {}
|
||||||
|
|
||||||
--- @field #AI_CARGO_DISPATCHER.PickupCargo
|
--- @field #AI_CARGO_DISPATCHER.PickupCargo
|
||||||
AI_CARGO_DISPATCHER.PickupCargo = {}
|
AI_CARGO_DISPATCHER.PickupCargo = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Creates a new AI_CARGO_DISPATCHER object.
|
--- Creates a new AI_CARGO_DISPATCHER object.
|
||||||
-- @param #AI_CARGO_DISPATCHER self
|
-- @param #AI_CARGO_DISPATCHER self
|
||||||
-- @param Core.Set#SET_GROUP SetAPC
|
-- @param Core.Set#SET_GROUP SetAPC
|
||||||
@ -54,7 +56,7 @@ AI_CARGO_DISPATCHER.PickupCargo = {}
|
|||||||
-- SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart()
|
-- SetAPC = SET_GROUP:New():FilterPrefixes( "APC" ):FilterStart()
|
||||||
-- SetCargo = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
|
-- SetCargo = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
|
||||||
-- SetDeployZone = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart()
|
-- SetDeployZone = SET_ZONE:New():FilterPrefixes( "Deploy" ):FilterStart()
|
||||||
-- AICargoDispatcher = AI_CARGO_DISPATCHER:New( SetAPC, SetCargo )
|
-- AICargoDispatcher = AI_CARGO_DISPATCHER:New( SetAPC, SetCargo, SetDeployZone )
|
||||||
--
|
--
|
||||||
function AI_CARGO_DISPATCHER:New( SetAPC, SetCargo, SetDeployZones )
|
function AI_CARGO_DISPATCHER:New( SetAPC, SetCargo, SetDeployZones )
|
||||||
|
|
||||||
@ -76,14 +78,42 @@ function AI_CARGO_DISPATCHER:New( SetAPC, SetCargo, SetDeployZones )
|
|||||||
self:AddTransition( "*", "Unloading", "*" )
|
self:AddTransition( "*", "Unloading", "*" )
|
||||||
self:AddTransition( "*", "Unloaded", "*" )
|
self:AddTransition( "*", "Unloaded", "*" )
|
||||||
|
|
||||||
|
self:AddTransition( "*", "Home", "*" )
|
||||||
|
|
||||||
self.MonitorTimeInterval = 30
|
self.MonitorTimeInterval = 30
|
||||||
self.DeployRadiusInner = 200
|
self.DeployRadiusInner = 200
|
||||||
self.DeployRadiusOuter = 500
|
self.DeployRadiusOuter = 500
|
||||||
|
|
||||||
|
self.CarrierHome = {}
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Set the home zone.
|
||||||
|
-- When there is nothing anymore to pickup, the carriers will go to a random coordinate in this zone.
|
||||||
|
-- They will await here new orders.
|
||||||
|
-- @param #AI_CARGO_DISPATCHER self
|
||||||
|
-- @param Core.Zone#ZONE_BASE HomeZone
|
||||||
|
-- @return #AI_CARGO_DISPATCHER
|
||||||
|
-- @usage
|
||||||
|
--
|
||||||
|
-- -- Create a new cargo dispatcher
|
||||||
|
-- AICargoDispatcher = AI_CARGO_DISPATCHER:New( SetAPC, SetCargo, SetDeployZone )
|
||||||
|
--
|
||||||
|
-- -- Set the home coordinate
|
||||||
|
-- local HomeZone = ZONE:New( "Home" )
|
||||||
|
-- AICargoDispatcher:SetHomeZone( HomeZone )
|
||||||
|
--
|
||||||
|
function AI_CARGO_DISPATCHER:SetHomeZone( HomeZone )
|
||||||
|
|
||||||
|
self.HomeZone = HomeZone
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- The Start trigger event, which actually takes action at the specified time interval.
|
--- The Start trigger event, which actually takes action at the specified time interval.
|
||||||
-- @param #AI_CARGO_DISPATCHER self
|
-- @param #AI_CARGO_DISPATCHER self
|
||||||
-- @param Wrapper.Group#GROUP APC
|
-- @param Wrapper.Group#GROUP APC
|
||||||
@ -92,60 +122,78 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
|
|||||||
|
|
||||||
for APCGroupName, Carrier in pairs( self.SetAPC:GetSet() ) do
|
for APCGroupName, Carrier in pairs( self.SetAPC:GetSet() ) do
|
||||||
local Carrier = Carrier -- Wrapper.Group#GROUP
|
local Carrier = Carrier -- Wrapper.Group#GROUP
|
||||||
local AICargoAPC = self.AICargoAPC[Carrier]
|
local AI_Cargo = self.AI_Cargo[Carrier]
|
||||||
if not AICargoAPC then
|
if not AI_Cargo then
|
||||||
|
|
||||||
-- ok, so this APC does not have yet an AI_CARGO_APC object...
|
-- ok, so this APC does not have yet an AI_CARGO_APC object...
|
||||||
-- let's create one and also declare the Loaded and UnLoaded handlers.
|
-- let's create one and also declare the Loaded and UnLoaded handlers.
|
||||||
self.AICargoAPC[Carrier] = self:AICargo( Carrier, self.SetCargo, self.CombatRadius )
|
self.AI_Cargo[Carrier] = self:AICargo( Carrier, self.SetCargo, self.CombatRadius )
|
||||||
AICargoAPC = self.AICargoAPC[Carrier]
|
AI_Cargo = self.AI_Cargo[Carrier]
|
||||||
|
|
||||||
function AICargoAPC.OnAfterPickup( AICargoAPC, APC, From, Event, To, Cargo )
|
function AI_Cargo.OnAfterPickup( AI_Cargo, APC, From, Event, To, Cargo )
|
||||||
self:Pickup( APC, Cargo )
|
self:Pickup( APC, Cargo )
|
||||||
end
|
end
|
||||||
|
|
||||||
function AICargoAPC.OnAfterLoad( AICargoAPC, APC )
|
function AI_Cargo.OnAfterLoad( AI_Cargo, APC )
|
||||||
self:Loading( APC )
|
self:Loading( APC )
|
||||||
end
|
end
|
||||||
|
|
||||||
function AICargoAPC.OnAfterLoaded( AICargoAPC, APC, From, Event, To, Cargo )
|
function AI_Cargo.OnAfterLoaded( AI_Cargo, APC, From, Event, To, Cargo )
|
||||||
self:Loaded( APC, Cargo )
|
self:Loaded( APC, Cargo )
|
||||||
end
|
end
|
||||||
|
|
||||||
function AICargoAPC.OnAfterDeploy( AICargoAPC, APC )
|
function AI_Cargo.OnAfterDeploy( AI_Cargo, APC )
|
||||||
self:Deploy( APC )
|
self:Deploy( APC )
|
||||||
end
|
end
|
||||||
|
|
||||||
function AICargoAPC.OnAfterUnload( AICargoAPC, APC )
|
function AI_Cargo.OnAfterUnload( AI_Cargo, APC )
|
||||||
self:Unloading( APC )
|
self:Unloading( APC )
|
||||||
end
|
end
|
||||||
|
|
||||||
function AICargoAPC.OnAfterUnloaded( AICargoAPC, APC )
|
function AI_Cargo.OnAfterUnloaded( AI_Cargo, APC )
|
||||||
self:Unloaded( APC )
|
self:Unloaded( APC )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The Pickup sequence ...
|
-- The Pickup sequence ...
|
||||||
-- Check if this APC need to go and Pickup something...
|
-- Check if this APC need to go and Pickup something...
|
||||||
self:I( { IsTransporting = AICargoAPC:IsTransporting() } )
|
self:I( { IsTransporting = AI_Cargo:IsTransporting() } )
|
||||||
if AICargoAPC:IsTransporting() == false then
|
if AI_Cargo:IsTransporting() == false then
|
||||||
-- ok, so there is a free APC
|
-- ok, so there is a free APC
|
||||||
-- now find the first cargo that is Unloaded
|
-- now find the first cargo that is Unloaded
|
||||||
|
|
||||||
local PickupCargo = nil
|
local PickupCargo = nil
|
||||||
|
|
||||||
for CargoName, Cargo in pairs( self.SetCargo:GetSet() ) do
|
for CargoName, Cargo in pairs( self.SetCargo:GetSet() ) do
|
||||||
|
local Cargo = Cargo -- Cargo.Cargo#CARGO
|
||||||
|
self:F( { Cargo = Cargo:GetName(), UnLoaded = Cargo:IsUnLoaded(), Deployed = Cargo:IsDeployed(), PickupCargo = self.PickupCargo[Cargo] ~= nil } )
|
||||||
if Cargo:IsUnLoaded() and not Cargo:IsDeployed() then
|
if Cargo:IsUnLoaded() and not Cargo:IsDeployed() then
|
||||||
if not self.PickupCargo[Cargo] then
|
local CargoVec2 = { x = Cargo:GetX(), y = Cargo:GetY() }
|
||||||
self.PickupCargo[Cargo] = Carrier
|
local LocationFound = false
|
||||||
|
for APC, Vec2 in pairs( self.PickupCargo ) do
|
||||||
|
if Vec2.x == CargoVec2.x and Vec2.y == CargoVec2.y then
|
||||||
|
LocationFound = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if LocationFound == false then
|
||||||
|
self.PickupCargo[Carrier] = CargoVec2
|
||||||
PickupCargo = Cargo
|
PickupCargo = Cargo
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if PickupCargo then
|
if PickupCargo then
|
||||||
AICargoAPC:Pickup( PickupCargo:GetCoordinate():GetRandomCoordinateInRadius( 25, 50 ), 70 )
|
self.CarrierHome[Carrier] = nil
|
||||||
|
AI_Cargo:Pickup( PickupCargo:GetCoordinate() )
|
||||||
break
|
break
|
||||||
|
else
|
||||||
|
if self.HomeZone then
|
||||||
|
if not self.CarrierHome[Carrier] then
|
||||||
|
self.CarrierHome[Carrier] = true
|
||||||
|
AI_Cargo:Home( self.HomeZone:GetRandomPointVec2() )
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -175,8 +223,9 @@ function AI_CARGO_DISPATCHER:OnAfterLoaded( From, Event, To, APC, Cargo )
|
|||||||
local RandomZone = self.SetDeployZones:GetRandomZone()
|
local RandomZone = self.SetDeployZones:GetRandomZone()
|
||||||
self:I( { RandomZone = RandomZone } )
|
self:I( { RandomZone = RandomZone } )
|
||||||
|
|
||||||
self.AICargoAPC[APC]:Deploy( RandomZone:GetCoordinate():GetRandomCoordinateInRadius( 25, 200 ), 70 )
|
self.AI_Cargo[APC]:Deploy( RandomZone:GetCoordinate(), 70 )
|
||||||
self.PickupCargo[Cargo] = nil
|
|
||||||
|
self.PickupCargo[APC] = nil
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|||||||
@ -22,6 +22,8 @@ AI_CARGO_HELICOPTER = {
|
|||||||
Coordinate = nil -- Core.Point#COORDINATE,
|
Coordinate = nil -- Core.Point#COORDINATE,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AI_CARGO_HELICOPTER_QUEUE = {}
|
||||||
|
|
||||||
--- Creates a new AI_CARGO_HELICOPTER object.
|
--- Creates a new AI_CARGO_HELICOPTER object.
|
||||||
-- @param #AI_CARGO_HELICOPTER self
|
-- @param #AI_CARGO_HELICOPTER self
|
||||||
-- @param Wrapper.Group#GROUP Helicopter
|
-- @param Wrapper.Group#GROUP Helicopter
|
||||||
@ -34,6 +36,8 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet )
|
|||||||
|
|
||||||
self.CargoSet = CargoSet -- Cargo.CargoGroup#CARGO_GROUP
|
self.CargoSet = CargoSet -- Cargo.CargoGroup#CARGO_GROUP
|
||||||
|
|
||||||
|
self.Zone = ZONE_GROUP:New( Helicopter:GetName(), Helicopter, 300 )
|
||||||
|
|
||||||
self:SetStartState( "Unloaded" )
|
self:SetStartState( "Unloaded" )
|
||||||
|
|
||||||
self:AddTransition( "Unloaded", "Pickup", "*" )
|
self:AddTransition( "Unloaded", "Pickup", "*" )
|
||||||
@ -47,6 +51,9 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet )
|
|||||||
self:AddTransition( "Unboarding", "Unloaded", "Unloaded" )
|
self:AddTransition( "Unboarding", "Unloaded", "Unloaded" )
|
||||||
|
|
||||||
self:AddTransition( "*", "Landed", "*" )
|
self:AddTransition( "*", "Landed", "*" )
|
||||||
|
self:AddTransition( "*", "Queue", "*" )
|
||||||
|
self:AddTransition( "*", "Orbit" , "*" )
|
||||||
|
self:AddTransition( "*", "Home" , "*" )
|
||||||
|
|
||||||
self:AddTransition( "*", "Destroyed", "Destroyed" )
|
self:AddTransition( "*", "Destroyed", "Destroyed" )
|
||||||
|
|
||||||
@ -207,8 +214,6 @@ function AI_CARGO_HELICOPTER:onafterLanded( Helicopter, From, Event, To )
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_CARGO_HELICOPTER self
|
--- @param #AI_CARGO_HELICOPTER self
|
||||||
-- @param Wrapper.Group#GROUP Helicopter
|
-- @param Wrapper.Group#GROUP Helicopter
|
||||||
-- @param From
|
-- @param From
|
||||||
@ -216,57 +221,81 @@ end
|
|||||||
-- @param To
|
-- @param To
|
||||||
-- @param Core.Point#COORDINATE Coordinate
|
-- @param Core.Point#COORDINATE Coordinate
|
||||||
-- @param #number Speed
|
-- @param #number Speed
|
||||||
function AI_CARGO_HELICOPTER:onafterPickup( Helicopter, From, Event, To, Coordinate, Speed )
|
function AI_CARGO_HELICOPTER:onafterQueue( Helicopter, From, Event, To, Coordinate )
|
||||||
|
|
||||||
if Helicopter and Helicopter:IsAlive() ~= nil then
|
local HelicopterInZone = false
|
||||||
|
|
||||||
Helicopter:Activate()
|
--- @param Wrapper.Unit#UNIT ZoneUnit
|
||||||
|
local function EvaluateZone( ZoneUnit )
|
||||||
|
|
||||||
self.RoutePickup = true
|
if ZoneUnit:IsAlive() then
|
||||||
|
local ZoneUnitCategory = ZoneUnit:GetDesc().category
|
||||||
|
local ZoneGroup = ZoneUnit:GetGroup()
|
||||||
|
if ZoneUnitCategory == Unit.Category.HELICOPTER then
|
||||||
|
local State = ZoneGroup:GetState( ZoneGroup, "Landing" )
|
||||||
|
self:F({ZoneUnit=ZoneUnit:GetName(), State=State, UnitCategory = Unit.Category.HELICOPTER } )
|
||||||
|
if State == true then
|
||||||
|
HelicopterInZone = true
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local Route = {}
|
return true
|
||||||
|
|
||||||
--- Calculate the target route point.
|
|
||||||
--local CoordinateFrom = Helicopter:GetCoordinate()
|
|
||||||
local CoordinateTo = Coordinate
|
|
||||||
|
|
||||||
--- Create a route point of type air.
|
|
||||||
-- local WaypointFrom = CoordinateFrom:WaypointAir(
|
|
||||||
-- "RADIO",
|
|
||||||
-- POINT_VEC3.RoutePointType.TurningPoint,
|
|
||||||
-- POINT_VEC3.RoutePointAction.TurningPoint,
|
|
||||||
-- Speed,
|
|
||||||
-- true
|
|
||||||
-- )
|
|
||||||
|
|
||||||
--- Create a route point of type air.
|
|
||||||
local WaypointTo = CoordinateTo:WaypointAir(
|
|
||||||
"RADIO",
|
|
||||||
POINT_VEC3.RoutePointType.TurningPoint,
|
|
||||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
|
||||||
Speed,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Route[#Route+1] = WaypointFrom
|
|
||||||
Route[#Route+1] = WaypointTo
|
|
||||||
|
|
||||||
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
|
|
||||||
Helicopter:WayPointInitialize( Route )
|
|
||||||
|
|
||||||
local Tasks = {}
|
|
||||||
|
|
||||||
Tasks[#Tasks+1] = Helicopter:TaskLandAtVec2( CoordinateTo:GetVec2() )
|
|
||||||
Route[#Route].task = Helicopter:TaskCombo( Tasks )
|
|
||||||
|
|
||||||
Route[#Route+1] = WaypointTo
|
|
||||||
|
|
||||||
-- Now route the helicopter
|
|
||||||
Helicopter:Route( Route, 1 )
|
|
||||||
|
|
||||||
self.Transporting = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Helicopter and Helicopter:IsAlive() then
|
||||||
|
|
||||||
|
local Distance = Coordinate:DistanceFromPointVec2( Helicopter:GetCoordinate() )
|
||||||
|
|
||||||
|
if Distance > 300 then
|
||||||
|
self:__Queue( -10, Coordinate )
|
||||||
|
else
|
||||||
|
|
||||||
|
-- This will search the zone and will call the local function "EvaluateZone", which passes a UNIT object.
|
||||||
|
local Zone = ZONE_RADIUS:New( "Deploy", Coordinate:GetVec2(), 300 )
|
||||||
|
Zone:SearchZone( EvaluateZone )
|
||||||
|
|
||||||
|
self:F({HelicopterInZone=HelicopterInZone})
|
||||||
|
|
||||||
|
if HelicopterInZone == false then
|
||||||
|
|
||||||
|
Helicopter:SetState( Helicopter, "Landing", true )
|
||||||
|
|
||||||
|
local Route = {}
|
||||||
|
|
||||||
|
-- local CoordinateFrom = Helicopter:GetCoordinate()
|
||||||
|
-- local WaypointFrom = CoordinateFrom:WaypointAir(
|
||||||
|
-- "RADIO",
|
||||||
|
-- POINT_VEC3.RoutePointType.TurningPoint,
|
||||||
|
-- POINT_VEC3.RoutePointAction.TurningPoint,
|
||||||
|
-- Speed,
|
||||||
|
-- true
|
||||||
|
-- )
|
||||||
|
-- Route[#Route+1] = WaypointFrom
|
||||||
|
local CoordinateTo = Coordinate
|
||||||
|
local WaypointTo = CoordinateTo:WaypointAir(
|
||||||
|
"RADIO",
|
||||||
|
POINT_VEC3.RoutePointType.TurningPoint,
|
||||||
|
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||||
|
50,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
Route[#Route+1] = WaypointTo
|
||||||
|
|
||||||
|
local Tasks = {}
|
||||||
|
Tasks[#Tasks+1] = Helicopter:TaskLandAtVec2( CoordinateTo:GetVec2() )
|
||||||
|
Route[#Route].task = Helicopter:TaskCombo( Tasks )
|
||||||
|
|
||||||
|
Route[#Route+1] = WaypointTo
|
||||||
|
|
||||||
|
-- Now route the helicopter
|
||||||
|
Helicopter:Route( Route, 0 )
|
||||||
|
else
|
||||||
|
self:__Queue( -10, Coordinate )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -277,56 +306,48 @@ end
|
|||||||
-- @param To
|
-- @param To
|
||||||
-- @param Core.Point#COORDINATE Coordinate
|
-- @param Core.Point#COORDINATE Coordinate
|
||||||
-- @param #number Speed
|
-- @param #number Speed
|
||||||
function AI_CARGO_HELICOPTER:onafterDeploy( Helicopter, From, Event, To, Coordinate, Speed )
|
function AI_CARGO_HELICOPTER:onafterOrbit( Helicopter, From, Event, To, Coordinate )
|
||||||
|
|
||||||
if Helicopter and Helicopter:IsAlive() ~= nil then
|
if Helicopter and Helicopter:IsAlive() then
|
||||||
|
|
||||||
self.RouteDeploy = true
|
Helicopter:ClearState( Helicopter, "Landing" )
|
||||||
|
|
||||||
local Route = {}
|
if not self:IsTransporting() then
|
||||||
|
local Route = {}
|
||||||
|
|
||||||
--- Calculate the target route point.
|
-- local CoordinateFrom = Helicopter:GetCoordinate()
|
||||||
-- local CoordinateFrom = Helicopter:GetCoordinate()
|
-- local WaypointFrom = CoordinateFrom:WaypointAir(
|
||||||
local CoordinateTo = Coordinate
|
-- "RADIO",
|
||||||
|
-- POINT_VEC3.RoutePointType.TurningPoint,
|
||||||
|
-- POINT_VEC3.RoutePointAction.TurningPoint,
|
||||||
|
-- Speed,
|
||||||
|
-- true
|
||||||
|
-- )
|
||||||
|
-- Route[#Route+1] = WaypointFrom
|
||||||
|
local CoordinateTo = Coordinate
|
||||||
|
local WaypointTo = CoordinateTo:WaypointAir(
|
||||||
|
"RADIO",
|
||||||
|
POINT_VEC3.RoutePointType.TurningPoint,
|
||||||
|
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||||
|
50,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
Route[#Route+1] = WaypointTo
|
||||||
|
|
||||||
--- Create a route point of type air.
|
local Tasks = {}
|
||||||
-- local WaypointFrom = CoordinateFrom:WaypointAir(
|
Tasks[#Tasks+1] = Helicopter:TaskOrbitCircle( math.random( 30, 80 ), 0, CoordinateTo:GetRandomCoordinateInRadius( 800, 500 ) )
|
||||||
-- "RADIO",
|
Route[#Route].task = Helicopter:TaskCombo( Tasks )
|
||||||
-- POINT_VEC3.RoutePointType.TurningPoint,
|
|
||||||
-- POINT_VEC3.RoutePointAction.TurningPoint,
|
|
||||||
-- Speed,
|
|
||||||
-- true
|
|
||||||
-- )
|
|
||||||
|
|
||||||
--- Create a route point of type air.
|
Route[#Route+1] = WaypointTo
|
||||||
local WaypointTo = CoordinateTo:WaypointAir(
|
|
||||||
"RADIO",
|
|
||||||
POINT_VEC3.RoutePointType.TurningPoint,
|
|
||||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
|
||||||
Speed,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Route[#Route+1] = WaypointFrom
|
-- Now route the helicopter
|
||||||
Route[#Route+1] = WaypointTo
|
Helicopter:Route( Route, 0 )
|
||||||
|
end
|
||||||
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
|
|
||||||
Helicopter:WayPointInitialize( Route )
|
|
||||||
|
|
||||||
local Tasks = {}
|
|
||||||
|
|
||||||
Tasks[#Tasks+1] = Helicopter:TaskLandAtVec2( CoordinateTo:GetVec2() )
|
|
||||||
Route[#Route].task = Helicopter:TaskCombo( Tasks )
|
|
||||||
|
|
||||||
Route[#Route+1] = WaypointTo
|
|
||||||
|
|
||||||
-- Now route the helicopter
|
|
||||||
Helicopter:Route( Route, 1 )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_CARGO_HELICOPTER self
|
--- @param #AI_CARGO_HELICOPTER self
|
||||||
-- @param Wrapper.Group#GROUP Helicopter
|
-- @param Wrapper.Group#GROUP Helicopter
|
||||||
function AI_CARGO_HELICOPTER:onbeforeLoad( Helicopter, From, Event, To, Coordinate )
|
function AI_CARGO_HELICOPTER:onbeforeLoad( Helicopter, From, Event, To, Coordinate )
|
||||||
@ -475,4 +496,203 @@ function AI_CARGO_HELICOPTER:onbeforeUnloaded( Helicopter, From, Event, To, Carg
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @param #AI_CARGO_HELICOPTER self
|
||||||
|
-- @param Wrapper.Group#GROUP Helicopter
|
||||||
|
function AI_CARGO_HELICOPTER:onafterUnloaded( Helicopter, From, Event, To, Cargo, Deployed )
|
||||||
|
|
||||||
|
self:Orbit( Helicopter:GetCoordinate(), 50 )
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--- @param #AI_CARGO_HELICOPTER self
|
||||||
|
-- @param Wrapper.Group#GROUP Helicopter
|
||||||
|
-- @param From
|
||||||
|
-- @param Event
|
||||||
|
-- @param To
|
||||||
|
-- @param Core.Point#COORDINATE Coordinate
|
||||||
|
-- @param #number Speed
|
||||||
|
function AI_CARGO_HELICOPTER:onafterPickup( Helicopter, From, Event, To, Coordinate )
|
||||||
|
|
||||||
|
if Helicopter and Helicopter:IsAlive() ~= nil then
|
||||||
|
|
||||||
|
self:ScheduleOnce( 10, Helicopter.ClearState, Helicopter, Helicopter, "Landing" )
|
||||||
|
Helicopter:Activate()
|
||||||
|
|
||||||
|
self.RoutePickup = true
|
||||||
|
Coordinate.y = math.random( 50, 200 )
|
||||||
|
|
||||||
|
local Route = {}
|
||||||
|
|
||||||
|
--- Calculate the target route point.
|
||||||
|
local CoordinateFrom = Helicopter:GetCoordinate()
|
||||||
|
local CoordinateTo = Coordinate
|
||||||
|
|
||||||
|
--- Create a route point of type air.
|
||||||
|
local WaypointFrom = CoordinateFrom:WaypointAir(
|
||||||
|
"RADIO",
|
||||||
|
POINT_VEC3.RoutePointType.TurningPoint,
|
||||||
|
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||||
|
150,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
|
||||||
|
--- Create a route point of type air.
|
||||||
|
local WaypointTo = CoordinateTo:WaypointAir(
|
||||||
|
"RADIO",
|
||||||
|
POINT_VEC3.RoutePointType.TurningPoint,
|
||||||
|
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||||
|
150,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
|
||||||
|
Route[#Route+1] = WaypointFrom
|
||||||
|
Route[#Route+1] = WaypointTo
|
||||||
|
|
||||||
|
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
|
||||||
|
Helicopter:WayPointInitialize( Route )
|
||||||
|
|
||||||
|
local Tasks = {}
|
||||||
|
|
||||||
|
Tasks[#Tasks+1] = Helicopter:TaskLandAtVec2( CoordinateTo:GetVec2() )
|
||||||
|
Route[#Route].task = Helicopter:TaskCombo( Tasks )
|
||||||
|
|
||||||
|
Route[#Route+1] = WaypointTo
|
||||||
|
|
||||||
|
-- Now route the helicopter
|
||||||
|
Helicopter:Route( Route, 1 )
|
||||||
|
|
||||||
|
self.Transporting = true
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function AI_CARGO_HELICOPTER:_Deploy( AICargoHelicopter, Coordinate )
|
||||||
|
AICargoHelicopter:__Queue( -10, Coordinate, 100 )
|
||||||
|
end
|
||||||
|
|
||||||
|
--- @param #AI_CARGO_HELICOPTER self
|
||||||
|
-- @param Wrapper.Group#GROUP Helicopter
|
||||||
|
-- @param From
|
||||||
|
-- @param Event
|
||||||
|
-- @param To
|
||||||
|
-- @param Core.Point#COORDINATE Coordinate
|
||||||
|
-- @param #number Speed
|
||||||
|
function AI_CARGO_HELICOPTER:onafterDeploy( Helicopter, From, Event, To, Coordinate )
|
||||||
|
|
||||||
|
if Helicopter and Helicopter:IsAlive() ~= nil then
|
||||||
|
|
||||||
|
self.RouteDeploy = true
|
||||||
|
|
||||||
|
|
||||||
|
local Route = {}
|
||||||
|
|
||||||
|
--- Calculate the target route point.
|
||||||
|
|
||||||
|
Coordinate.y = math.random( 50, 200 )
|
||||||
|
|
||||||
|
--- Create a route point of type air.
|
||||||
|
local CoordinateFrom = Helicopter:GetCoordinate()
|
||||||
|
local WaypointFrom = CoordinateFrom:WaypointAir(
|
||||||
|
"RADIO",
|
||||||
|
POINT_VEC3.RoutePointType.TurningPoint,
|
||||||
|
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||||
|
150,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
Route[#Route+1] = WaypointFrom
|
||||||
|
Route[#Route+1] = WaypointFrom
|
||||||
|
|
||||||
|
--- Create a route point of type air.
|
||||||
|
local CoordinateTo = Coordinate
|
||||||
|
local WaypointTo = CoordinateTo:WaypointAir(
|
||||||
|
"RADIO",
|
||||||
|
POINT_VEC3.RoutePointType.TurningPoint,
|
||||||
|
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||||
|
150,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
|
||||||
|
Route[#Route+1] = WaypointTo
|
||||||
|
Route[#Route+1] = WaypointTo
|
||||||
|
|
||||||
|
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
|
||||||
|
Helicopter:WayPointInitialize( Route )
|
||||||
|
|
||||||
|
local Tasks = {}
|
||||||
|
|
||||||
|
Tasks[#Tasks+1] = Helicopter:TaskFunction( "AI_CARGO_HELICOPTER._Deploy", self, Coordinate )
|
||||||
|
Tasks[#Tasks+1] = Helicopter:TaskOrbitCircle( math.random( 30, 100 ), 0, CoordinateTo:GetRandomCoordinateInRadius( 800, 500 ) )
|
||||||
|
|
||||||
|
--Tasks[#Tasks+1] = Helicopter:TaskLandAtVec2( CoordinateTo:GetVec2() )
|
||||||
|
Route[#Route].task = Helicopter:TaskCombo( Tasks )
|
||||||
|
|
||||||
|
Route[#Route+1] = WaypointTo
|
||||||
|
|
||||||
|
-- Now route the helicopter
|
||||||
|
Helicopter:Route( Route, 1 )
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- @param #AI_CARGO_HELICOPTER self
|
||||||
|
-- @param Wrapper.Group#GROUP Helicopter
|
||||||
|
-- @param From
|
||||||
|
-- @param Event
|
||||||
|
-- @param To
|
||||||
|
-- @param Core.Point#COORDINATE Coordinate
|
||||||
|
-- @param #number Speed
|
||||||
|
function AI_CARGO_HELICOPTER:onafterHome( Helicopter, From, Event, To, Coordinate )
|
||||||
|
|
||||||
|
if Helicopter and Helicopter:IsAlive() ~= nil then
|
||||||
|
|
||||||
|
self.RouteHome = true
|
||||||
|
|
||||||
|
local Route = {}
|
||||||
|
|
||||||
|
--- Calculate the target route point.
|
||||||
|
|
||||||
|
Coordinate.y = math.random( 50, 200 )
|
||||||
|
|
||||||
|
--- Create a route point of type air.
|
||||||
|
local CoordinateFrom = Helicopter:GetCoordinate()
|
||||||
|
local WaypointFrom = CoordinateFrom:WaypointAir(
|
||||||
|
"RADIO",
|
||||||
|
POINT_VEC3.RoutePointType.TurningPoint,
|
||||||
|
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||||
|
150,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
Route[#Route+1] = WaypointFrom
|
||||||
|
|
||||||
|
--- Create a route point of type air.
|
||||||
|
local CoordinateTo = Coordinate
|
||||||
|
local WaypointTo = CoordinateTo:WaypointAir(
|
||||||
|
"RADIO",
|
||||||
|
POINT_VEC3.RoutePointType.TurningPoint,
|
||||||
|
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||||
|
150,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
|
||||||
|
Route[#Route+1] = WaypointTo
|
||||||
|
|
||||||
|
--- Now we're going to do something special, we're going to call a function from a waypoint action at the AIControllable...
|
||||||
|
Helicopter:WayPointInitialize( Route )
|
||||||
|
|
||||||
|
local Tasks = {}
|
||||||
|
|
||||||
|
Tasks[#Tasks+1] = Helicopter:TaskLandAtVec2( CoordinateTo:GetVec2() )
|
||||||
|
Route[#Route].task = Helicopter:TaskCombo( Tasks )
|
||||||
|
|
||||||
|
Route[#Route+1] = WaypointTo
|
||||||
|
|
||||||
|
-- Now route the helicopter
|
||||||
|
Helicopter:Route( Route, 1 )
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|||||||
@ -488,6 +488,36 @@ do -- CARGO_GROUP
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Get the x position of the cargo.
|
||||||
|
-- @param #CARGO_GROUP self
|
||||||
|
-- @return #number
|
||||||
|
function CARGO:GetX()
|
||||||
|
|
||||||
|
local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO
|
||||||
|
|
||||||
|
if Cargo then
|
||||||
|
return Cargo:GetCoordinate().x
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Get the y position of the cargo.
|
||||||
|
-- @param #CARGO_GROUP self
|
||||||
|
-- @return #number
|
||||||
|
function CARGO:GetY()
|
||||||
|
|
||||||
|
local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO
|
||||||
|
|
||||||
|
if Cargo then
|
||||||
|
return Cargo:GetCoordinate().z
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Check if the CargoGroup is alive.
|
--- Check if the CargoGroup is alive.
|
||||||
-- @param #CARGO_GROUP self
|
-- @param #CARGO_GROUP self
|
||||||
-- @return #boolean true if the CargoGroup is alive.
|
-- @return #boolean true if the CargoGroup is alive.
|
||||||
|
|||||||
@ -244,6 +244,52 @@ function DATABASE:FindAirbase( AirbaseName )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
do -- Zones
|
||||||
|
|
||||||
|
--- Finds a @{Zone} based on the zone name.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @param #string ZoneName The name of the zone.
|
||||||
|
-- @return Core.Zone#ZONE_BASE The found ZONE.
|
||||||
|
function DATABASE:FindZone( ZoneName )
|
||||||
|
|
||||||
|
local ZoneFound = self.ZONES[ZoneName]
|
||||||
|
return ZoneFound
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Adds a @{Zone} based on the zone name in the DATABASE.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @param #string ZoneName The name of the zone.
|
||||||
|
-- @param Core.Zone#ZONE_BASE Zone The zone.
|
||||||
|
function DATABASE:AddZone( ZoneName, Zone )
|
||||||
|
|
||||||
|
if not self.ZONES[ZoneName] then
|
||||||
|
self.ZONES[ZoneName] = Zone
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Deletes a @{Zone} from the DATABASE based on the zone name.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @param #string ZoneName The name of the zone.
|
||||||
|
function DATABASE:DeleteZone( ZoneName )
|
||||||
|
|
||||||
|
self.ZONES[ZoneName] = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Finds an @{Zone} based on the zone name in the DATABASE.
|
||||||
|
-- @param #DATABASE self
|
||||||
|
-- @param #string ZoneName
|
||||||
|
-- @return Core.Zone#ZONE_BASE The found @{Zone}.
|
||||||
|
function DATABASE:FindZone( ZoneName )
|
||||||
|
|
||||||
|
local ZoneFound = self.ZONES[ZoneName]
|
||||||
|
return ZoneFound
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
do -- cargo
|
do -- cargo
|
||||||
|
|
||||||
@ -1148,7 +1194,7 @@ function DATABASE:_RegisterTemplates()
|
|||||||
for ZoneID, ZoneData in pairs( env.mission.triggers.zones ) do
|
for ZoneID, ZoneData in pairs( env.mission.triggers.zones ) do
|
||||||
local ZoneName = ZoneData.name
|
local ZoneName = ZoneData.name
|
||||||
self.ZONENAMES[ZoneName] = ZoneName
|
self.ZONENAMES[ZoneName] = ZoneName
|
||||||
self.ZONES[ZoneName] = ZONE:New( ZoneName )
|
self:AddZone( ZoneName, ZONE:New( ZoneName ) )
|
||||||
self:I( "Added ZONE " .. ZoneName )
|
self:I( "Added ZONE " .. ZoneName )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -114,6 +114,8 @@ function ZONE_BASE:New( ZoneName )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Returns the name of the zone.
|
--- Returns the name of the zone.
|
||||||
-- @param #ZONE_BASE self
|
-- @param #ZONE_BASE self
|
||||||
-- @return #string The name of the zone.
|
-- @return #string The name of the zone.
|
||||||
@ -962,6 +964,17 @@ function ZONE:New( ZoneName )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Find a zone in the _DATABASE using the name of the zone.
|
||||||
|
-- @param #ZONE_BASE self
|
||||||
|
-- @param #string ZoneName The name of the zone.
|
||||||
|
-- @return #ZONE_BASE self
|
||||||
|
function ZONE:FindByName( ZoneName )
|
||||||
|
|
||||||
|
local ZoneFound = _DATABASE:FindZone( ZoneName )
|
||||||
|
return ZoneFound
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- @type ZONE_UNIT
|
--- @type ZONE_UNIT
|
||||||
-- @field Wrapper.Unit#UNIT ZoneUNIT
|
-- @field Wrapper.Unit#UNIT ZoneUNIT
|
||||||
|
|||||||
@ -798,15 +798,16 @@ end
|
|||||||
-- @param #CONTROLLABLE self
|
-- @param #CONTROLLABLE self
|
||||||
-- @param #number Altitude The altitude to hold the position.
|
-- @param #number Altitude The altitude to hold the position.
|
||||||
-- @param #number Speed The speed flying when holding the position.
|
-- @param #number Speed The speed flying when holding the position.
|
||||||
|
-- @param Core.Point#COORDINATE Coordinate The coordinate where to orbit.
|
||||||
-- @return #CONTROLLABLE self
|
-- @return #CONTROLLABLE self
|
||||||
function CONTROLLABLE:TaskOrbitCircle( Altitude, Speed )
|
function CONTROLLABLE:TaskOrbitCircle( Altitude, Speed, Coordinate )
|
||||||
self:F2( { self.ControllableName, Altitude, Speed } )
|
self:F2( { self.ControllableName, Altitude, Speed } )
|
||||||
|
|
||||||
local DCSControllable = self:GetDCSObject()
|
local DCSControllable = self:GetDCSObject()
|
||||||
|
|
||||||
if DCSControllable then
|
if DCSControllable then
|
||||||
local ControllablePoint = self:GetVec2()
|
local OrbitVec2 = Coordinate and Coordinate:GetVec2() or self:GetVec2()
|
||||||
return self:TaskOrbitCircleAtVec2( ControllablePoint, Altitude, Speed )
|
return self:TaskOrbitCircleAtVec2( OrbitVec2, Altitude, Speed )
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user