This commit is contained in:
Sven Van de Velde 2016-08-04 07:47:36 +02:00
parent 0c5e1db39c
commit 8ca74ee7db
3 changed files with 1052 additions and 809 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
local Mission = MISSION:New( "Pickup Cargo", "High", "Test for Cargo Pickup", coalition.side.RED )
local CargoEngineer = UNIT:FindByName( "Engineer" )
local InfantryCargo = CARGO_UNIT:New( Mission, CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 300 )
local CargoCarrier = UNIT:FindByName( "CargoCarrier" )
InfantryCargo:OnBoard( CargoCarrier )

View File

@ -79,9 +79,30 @@ function POSITIONABLE:GetVec2()
if DCSPositionable then if DCSPositionable then
local PositionablePointVec3 = DCSPositionable:getPosition().p local PositionablePointVec3 = DCSPositionable:getPosition().p
local PositionablePointVec2 = {} local PositionableVec2 = {}
PositionablePointVec2.x = PositionablePointVec3.x PositionableVec2.x = PositionablePointVec3.x
PositionablePointVec2.y = PositionablePointVec3.z PositionableVec2.y = PositionablePointVec3.z
self:T2( PositionableVec2 )
return PositionableVec2
end
return nil
end
--- Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission.
-- @param Positionable#POSITIONABLE self
-- @return Point#POINT_VEC2 The 2D point vector of the POSITIONABLE.
-- @return #nil The DCS Positionable is not existing or alive.
function POSITIONABLE:GetVec2()
self:F2( self.PositionableName )
local DCSPositionable = self:GetDCSObject()
if DCSPositionable then
local PositionablePointVec3 = DCSPositionable:getPosition().p
local PositionablePointVec2 = POINT_VEC2:NewFromVec3( PositionablePointVec3 )
self:T2( PositionablePointVec2 ) self:T2( PositionablePointVec2 )
return PositionablePointVec2 return PositionablePointVec2