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 -- @extends Core.Fsm#FSM
--- # AI\_CARGO\_DISPATCHER class, extends @{Core.Fsm#FSM} --- A dynamic cargo handling capability for AI groups.
--
-- ===
--
-- AI\_CARGO\_DISPATCHER brings a dynamic cargo handling capability for AI groups.
-- --
-- Carrier equipment can be mobilized to intelligently transport infantry and other cargo within the simulation. -- 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 -- 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 -- @extends AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER
--- # AI\_CARGO\_DISPATCHER\_HELICOPTER class, extends @{AI.AI_Cargo_Dispatcher#AI_CARGO_DISPATCHER} --- A dynamic cargo handling capability for AI helicopter groups.
--
-- ![Banner Image](..\Presentations\AI_CARGO_DISPATCHER_HELICOPTER\Dia1.JPG)
--
-- ===
--
-- AI\_CARGO\_DISPATCHER\_HELICOPTER brings a dynamic cargo handling capability for AI helicopter groups.
-- --
-- Helicopters can be mobilized to intelligently transport infantry and other cargo within the simulation. -- 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. -- 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() } ) self:F( { Helicopter:GetName(), Height = Helicopter:GetHeight( true ), Velocity = Helicopter:GetVelocityKMH() } )
if self.RoutePickup == true then 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:Load( Helicopter:GetPointVec2() )
self.RoutePickup = false self.RoutePickup = false
self.Relocating = true self.Relocating = true
@ -227,7 +227,7 @@ function AI_CARGO_HELICOPTER:onafterLanded( Helicopter, From, Event, To )
end end
if self.RouteDeploy == true then 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:Unload( true )
self.RouteDeploy = false self.RouteDeploy = false
self.Transporting = false self.Transporting = false

View File

@ -543,7 +543,7 @@ function GROUP:GetHeight( FromGround )
local GroupPosition = DCSUnit:getPosition() local GroupPosition = DCSUnit:getPosition()
if FromGround == true then 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 ) GroupHeight = GroupHeight + ( GroupPosition.p.y - LandHeight )
else else
GroupHeight = GroupHeight + GroupPosition.p.y GroupHeight = GroupHeight + GroupPosition.p.y