Fixing AI_CARGO_HELICOPTER to interprete the real height correctly and also allow for pickup when the helo is still speeding more than 7 km/h.

This commit is contained in:
FlightControl_Master 2018-05-28 06:12:48 +02:00
parent 4c5d5a32dc
commit 0553e4b14e
4 changed files with 5 additions and 15 deletions

View File

@ -13,11 +13,7 @@
-- @extends Core.Fsm#FSM
--- # AI\_CARGO\_DISPATCHER class, extends @{Core.Fsm#FSM}
--
-- ===
--
-- AI\_CARGO\_DISPATCHER brings a dynamic cargo handling capability for AI groups.
--- A dynamic cargo handling capability for AI groups.
--
-- Carrier equipment can be mobilized to intelligently transport infantry and other cargo within the simulation.
-- The AI\_CARGO\_DISPATCHER module uses the @{Cargo} capabilities within the MOOSE framework, to enable Carrier GROUP objects

View File

@ -15,13 +15,7 @@
-- @extends AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
--- # AI\_CARGO\_DISPATCHER\_HELICOPTER class, extends @{AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER}
--
-- ![Banner Image](..\Presentations\AI_CARGO_DISPATCHER_HELICOPTER\Dia1.JPG)
--
-- ===
--
-- AI\_CARGO\_DISPATCHER\_HELICOPTER brings a dynamic cargo handling capability for AI helicopter groups.
--- A dynamic cargo handling capability for AI helicopter groups.
--
-- Helicopters can be mobilized to intelligently transport infantry and other cargo within the simulation.
-- The AI\_CARGO\_DISPATCHER\_HELICOPTER module uses the @{Cargo} capabilities within the MOOSE framework.

View File

@ -219,7 +219,7 @@ function AI_CARGO_HELICOPTER:onafterLanded( Helicopter, From, Event, To )
self:F( { Helicopter:GetName(), Height = Helicopter:GetHeight( true ), Velocity = Helicopter:GetVelocityKMH() } )
if self.RoutePickup == true then
if Helicopter:GetHeight( true ) <= 2 and Helicopter:GetVelocityKMH() < 5 then
if Helicopter:GetHeight( true ) <= 5 and Helicopter:GetVelocityKMH() < 7 then
self:Load( Helicopter:GetPointVec2() )
self.RoutePickup = false
self.Relocating = true
@ -227,7 +227,7 @@ function AI_CARGO_HELICOPTER:onafterLanded( Helicopter, From, Event, To )
end
if self.RouteDeploy == true then
if Helicopter:GetHeight( true ) <= 2 and Helicopter:GetVelocityKMH() < 5 then
if Helicopter:GetHeight( true ) <= 5 and Helicopter:GetVelocityKMH() < 7 then
self:Unload( true )
self.RouteDeploy = false
self.Transporting = false

View File

@ -543,7 +543,7 @@ function GROUP:GetHeight( FromGround )
local GroupPosition = DCSUnit:getPosition()
if FromGround == true then
local LandHeight = land.getHeight( { GroupPosition.p.x, GroupPosition.p.z } )
local LandHeight = land.getHeight( { x = GroupPosition.p.x, y = GroupPosition.p.z } )
GroupHeight = GroupHeight + ( GroupPosition.p.y - LandHeight )
else
GroupHeight = GroupHeight + GroupPosition.p.y