|
|
|
@@ -57,7 +57,6 @@ POSITIONABLE.__ = {}
|
|
|
|
|
--- @field #POSITIONABLE.__.Cargo
|
|
|
|
|
POSITIONABLE.__.Cargo = {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- A DCSPositionable
|
|
|
|
|
-- @type DCSPositionable
|
|
|
|
|
-- @field id_ The ID of the controllable in DCS
|
|
|
|
@@ -75,16 +74,19 @@ end
|
|
|
|
|
|
|
|
|
|
--- Destroys the POSITIONABLE.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #boolean GenerateEvent (Optional) true if you want to generate a crash or dead event for the unit.
|
|
|
|
|
-- @param #boolean GenerateEvent (Optional) If true, generates a crash or dead event for the unit. If false, no event generated. If nil, a remove event is generated.
|
|
|
|
|
-- @return #nil The DCS Unit is not existing or alive.
|
|
|
|
|
-- @usage
|
|
|
|
|
-- -- Air unit example: destroy the Helicopter and generate a S_EVENT_CRASH for each unit in the Helicopter group.
|
|
|
|
|
--
|
|
|
|
|
-- Air unit example: destroy the Helicopter and generate a S_EVENT_CRASH for each unit in the Helicopter group.
|
|
|
|
|
-- Helicopter = UNIT:FindByName( "Helicopter" )
|
|
|
|
|
-- Helicopter:Destroy( true )
|
|
|
|
|
--
|
|
|
|
|
-- @usage
|
|
|
|
|
-- -- Ground unit example: destroy the Tanks and generate a S_EVENT_DEAD for each unit in the Tanks group.
|
|
|
|
|
-- Tanks = UNIT:FindByName( "Tanks" )
|
|
|
|
|
-- Tanks:Destroy( true )
|
|
|
|
|
--
|
|
|
|
|
-- @usage
|
|
|
|
|
-- -- Ship unit example: destroy the Ship silently.
|
|
|
|
|
-- Ship = STATIC:FindByName( "Ship" )
|
|
|
|
@@ -147,7 +149,7 @@ function POSITIONABLE:GetPosition()
|
|
|
|
|
return PositionablePosition
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
BASE:E( { "Cannot GetPositionVec3", Positionable = self, Alive = self:IsAlive() } )
|
|
|
|
|
BASE:E( { "Cannot GetPosition", Positionable = self, Alive = self:IsAlive() } )
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -157,6 +159,7 @@ end
|
|
|
|
|
-- @return DCS#Vec3 X orientation, i.e. parallel to the direction of movement.
|
|
|
|
|
-- @return DCS#Vec3 Y orientation, i.e. vertical.
|
|
|
|
|
-- @return DCS#Vec3 Z orientation, i.e. perpendicular to the direction of movement.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetOrientation()
|
|
|
|
|
local position = self:GetPosition()
|
|
|
|
|
if position then
|
|
|
|
@@ -170,6 +173,7 @@ end
|
|
|
|
|
--- Returns a {@DCS#Vec3} table of the objects current X orientation in 3D space, i.e. along the direction of movement.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return DCS#Vec3 X orientation, i.e. parallel to the direction of movement.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetOrientationX()
|
|
|
|
|
local position = self:GetPosition()
|
|
|
|
|
if position then
|
|
|
|
@@ -183,6 +187,7 @@ end
|
|
|
|
|
--- Returns a {@DCS#Vec3} table of the objects current Y orientation in 3D space, i.e. vertical orientation.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return DCS#Vec3 Y orientation, i.e. vertical.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetOrientationY()
|
|
|
|
|
local position = self:GetPosition()
|
|
|
|
|
if position then
|
|
|
|
@@ -196,6 +201,7 @@ end
|
|
|
|
|
--- Returns a {@DCS#Vec3} table of the objects current Z orientation in 3D space, i.e. perpendicular to direction of movement.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return DCS#Vec3 Z orientation, i.e. perpendicular to movement.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetOrientationZ()
|
|
|
|
|
local position = self:GetPosition()
|
|
|
|
|
if position then
|
|
|
|
@@ -228,7 +234,8 @@ end
|
|
|
|
|
|
|
|
|
|
--- Returns the @{DCS#Vec3} vector indicating the 3D vector of the POSITIONABLE within the mission.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return DCS#Vec3 The 3D point vector of the POSITIONABLE or `nil` if it is not existing or alive.
|
|
|
|
|
-- @return DCS#Vec3 The 3D point vector of the POSITIONABLE.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetVec3()
|
|
|
|
|
|
|
|
|
|
local DCSPositionable = self:GetDCSObject()
|
|
|
|
@@ -251,7 +258,8 @@ end
|
|
|
|
|
|
|
|
|
|
--- Returns the @{DCS#Vec2} vector indicating the point in 2D of the POSITIONABLE within the mission.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return DCS#Vec2 The 2D point vector of the POSITIONABLE or #nil if it is not existing or alive.
|
|
|
|
|
-- @return DCS#Vec2 The 2D point vector of the POSITIONABLE.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetVec2()
|
|
|
|
|
|
|
|
|
|
local DCSPositionable = self:GetDCSObject()
|
|
|
|
@@ -327,8 +335,10 @@ function POSITIONABLE:GetPointVec3()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--- Returns a COORDINATE object indicating the point in 3D of the POSITIONABLE within the mission.
|
|
|
|
|
-- If the POSITIONABLE has a COORDINATE OBJECT set, it updates it. If not, it creates a new COORDINATE object.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return Core.Point#COORDINATE The COORDINATE of the POSITIONABLE.
|
|
|
|
|
-- TODO: Seems to have been introduced with Airboss. Should it be renamed to better reflect the difference to "GetCoordinate" (it is currently ambiguous)? Or perhaps just be a switch in the the GetCoordinate function; forceCoordinateUpate?
|
|
|
|
|
function POSITIONABLE:GetCoord()
|
|
|
|
|
|
|
|
|
|
-- Get DCS object.
|
|
|
|
@@ -337,20 +347,14 @@ function POSITIONABLE:GetCoord()
|
|
|
|
|
if DCSPositionable then
|
|
|
|
|
|
|
|
|
|
-- Get the current position.
|
|
|
|
|
local Vec3 = self:GetVec3()
|
|
|
|
|
local PositionableVec3 = self:GetVec3()
|
|
|
|
|
|
|
|
|
|
if self.coordinate then
|
|
|
|
|
|
|
|
|
|
-- Update vector.
|
|
|
|
|
self.coordinate.x=Vec3.x
|
|
|
|
|
self.coordinate.y=Vec3.y
|
|
|
|
|
self.coordinate.z=Vec3.z
|
|
|
|
|
|
|
|
|
|
-- Update COORDINATE from 3D vector.
|
|
|
|
|
self.coordinate:UpdateFromVec3( PositionableVec3 )
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
-- New COORDINATE.
|
|
|
|
|
self.coordinate=COORDINATE:NewFromVec3(Vec3)
|
|
|
|
|
|
|
|
|
|
self.coordinate = COORDINATE:NewFromVec3( PositionableVec3 )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return self.coordinate
|
|
|
|
@@ -377,7 +381,7 @@ function POSITIONABLE:GetCoordinate()
|
|
|
|
|
|
|
|
|
|
local coord = COORDINATE:NewFromVec3( PositionableVec3 )
|
|
|
|
|
|
|
|
|
|
-- Return a new coordiante object.
|
|
|
|
|
-- Return a new coordinate object.
|
|
|
|
|
return coord
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
@@ -463,12 +467,11 @@ function POSITIONABLE:GetRandomVec3( Radius )
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Get the bounding box of the underlying POSITIONABLE DCS Object.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return DCS#Box3 The bounding box of the POSITIONABLE.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetBoundingBox() --R2.1
|
|
|
|
|
function POSITIONABLE:GetBoundingBox()
|
|
|
|
|
self:F2()
|
|
|
|
|
|
|
|
|
|
local DCSPositionable = self:GetDCSObject()
|
|
|
|
@@ -486,7 +489,6 @@ function POSITIONABLE:GetBoundingBox() --R2.1
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Get the object size.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return DCS#Distance Max size of object in x, z or 0 if bounding box could not be obtained.
|
|
|
|
@@ -511,7 +513,8 @@ end
|
|
|
|
|
--- Get the bounding radius of the underlying POSITIONABLE DCS Object.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #number mindist (Optional) If bounding box is smaller than this value, mindist is returned.
|
|
|
|
|
-- @return DCS#Distance The bounding radius of the POSITIONABLE or #nil if the POSITIONABLE is not existing or alive.
|
|
|
|
|
-- @return DCS#Distance The bounding radius of the POSITIONABLE
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetBoundingRadius( mindist )
|
|
|
|
|
self:F2()
|
|
|
|
|
|
|
|
|
@@ -574,7 +577,6 @@ function POSITIONABLE:IsAboveRunway()
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function POSITIONABLE:GetSize()
|
|
|
|
|
|
|
|
|
|
local DCSObject = self:GetDCSObject()
|
|
|
|
@@ -586,11 +588,10 @@ function POSITIONABLE:GetSize()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Returns the POSITIONABLE heading in degrees.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return #number The POSITIONABLE heading in degrees or `nil` if not existing or alive.
|
|
|
|
|
-- @return #number The POSITIONABLE heading in degrees.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetHeading()
|
|
|
|
|
|
|
|
|
|
local DCSPositionable = self:GetDCSObject()
|
|
|
|
@@ -613,7 +614,6 @@ function POSITIONABLE:GetHeading()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:E( { "Cannot GetHeading", Positionable = self, Alive = self:IsAlive() } )
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -623,6 +623,7 @@ end
|
|
|
|
|
-- If the unit is a helicopter or a plane, then this method will return true, otherwise false.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return #boolean Air category evaluation result.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:IsAir()
|
|
|
|
|
self:F2()
|
|
|
|
|
|
|
|
|
@@ -638,6 +639,7 @@ function POSITIONABLE:IsAir()
|
|
|
|
|
return IsAirResult
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:E( { "Cannot check IsAir", Positionable = self, Alive = self:IsAlive() } )
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -645,6 +647,7 @@ end
|
|
|
|
|
-- If the unit is a ground vehicle or infantry, this method will return true, otherwise false.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return #boolean Ground category evaluation result.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:IsGround()
|
|
|
|
|
self:F2()
|
|
|
|
|
|
|
|
|
@@ -660,13 +663,14 @@ function POSITIONABLE:IsGround()
|
|
|
|
|
return IsGroundResult
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:E( { "Cannot check IsGround", Positionable = self, Alive = self:IsAlive() } )
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Returns if the unit is of ship category.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return #boolean Ship category evaluation result.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:IsShip()
|
|
|
|
|
self:F2()
|
|
|
|
|
|
|
|
|
@@ -674,16 +678,18 @@ function POSITIONABLE:IsShip()
|
|
|
|
|
|
|
|
|
|
if DCSUnit then
|
|
|
|
|
local UnitDescriptor = DCSUnit:getDesc()
|
|
|
|
|
self:T3( { UnitDescriptor.category, Unit.Category.SHIP } )
|
|
|
|
|
|
|
|
|
|
local IsShip = ( UnitDescriptor.category == Unit.Category.SHIP )
|
|
|
|
|
local IsShipResult = (UnitDescriptor.category == Unit.Category.SHIP)
|
|
|
|
|
|
|
|
|
|
return IsShip
|
|
|
|
|
self:T3( IsShipResult )
|
|
|
|
|
return IsShipResult
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:E( { "Cannot check IsShip", Positionable = self, Alive = self:IsAlive() } )
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Returns if the unit is a submarine.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return #boolean Submarines attributes result.
|
|
|
|
@@ -701,10 +707,10 @@ function POSITIONABLE:IsSubmarine()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
self:E( { "Cannot check IsSubmarine", Positionable = self, Alive = self:IsAlive() } )
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Returns true if the POSITIONABLE is in the air.
|
|
|
|
|
-- Polymorphic, is overridden in GROUP and UNIT.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
@@ -716,8 +722,7 @@ function POSITIONABLE:InAir()
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Returns the a @{Velocity} object from the positionable.
|
|
|
|
|
--- Returns the a @{Velocity} object from the POSITIONABLE.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return Core.Velocity#VELOCITY Velocity The Velocity object.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
@@ -736,8 +741,6 @@ function POSITIONABLE:GetVelocity()
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Returns the POSITIONABLE velocity Vec3 vector.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return DCS#Vec3 The velocity Vec3 vector
|
|
|
|
@@ -760,7 +763,7 @@ end
|
|
|
|
|
|
|
|
|
|
--- Get relative velocity with respect to another POSITIONABLE.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #POSITIONABLE positionable Other positionable.
|
|
|
|
|
-- @param #POSITIONABLE positionable Other POSITIONABLE.
|
|
|
|
|
-- @return #number Relative velocity in m/s.
|
|
|
|
|
function POSITIONABLE:GetRelativeVelocity( positionable )
|
|
|
|
|
self:F2( self.PositionableName )
|
|
|
|
@@ -773,17 +776,16 @@ function POSITIONABLE:GetRelativeVelocity(positionable)
|
|
|
|
|
return UTILS.VecNorm( vtot )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Returns the POSITIONABLE height in meters.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return DCS#Vec3 The height of the positionable.
|
|
|
|
|
-- @return DCS#Vec3 The height of the POSITIONABLE in meters.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetHeight() --R2.1
|
|
|
|
|
function POSITIONABLE:GetHeight()
|
|
|
|
|
self:F2( self.PositionableName )
|
|
|
|
|
|
|
|
|
|
local DCSPositionable = self:GetDCSObject()
|
|
|
|
|
|
|
|
|
|
if DCSPositionable then
|
|
|
|
|
if DCSPositionable and DCSPositionable:isExist() then
|
|
|
|
|
local PositionablePosition = DCSPositionable:getPosition()
|
|
|
|
|
if PositionablePosition then
|
|
|
|
|
local PositionableHeight = PositionablePosition.p.y
|
|
|
|
@@ -795,10 +797,9 @@ function POSITIONABLE:GetHeight() --R2.1
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Returns the POSITIONABLE velocity in km/h.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return #number The velocity in km/h
|
|
|
|
|
-- @return #number The velocity in km/h.
|
|
|
|
|
function POSITIONABLE:GetVelocityKMH()
|
|
|
|
|
self:F2( self.PositionableName )
|
|
|
|
|
|
|
|
|
@@ -841,9 +842,10 @@ function POSITIONABLE:GetVelocityKNOTS()
|
|
|
|
|
return UTILS.MpsToKnots( self:GetVelocityMPS() )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--- Returns the Angle of Attack of a positionable.
|
|
|
|
|
--- Returns the Angle of Attack of a POSITIONABLE.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return #number Angle of attack in degrees.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetAoA()
|
|
|
|
|
|
|
|
|
|
-- Get position of the unit.
|
|
|
|
@@ -889,9 +891,10 @@ function POSITIONABLE:GetAoA()
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--- Returns the unit's climb or descent angle.
|
|
|
|
|
--- Returns the climb or descent angle of the POSITIONABLE.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return #number Climb or descent angle in degrees. Or 0 if velocity vector norm is zero (or nil). Or nil, if the position of the POSITIONABLE returns nil.
|
|
|
|
|
-- @return #number Climb or descent angle in degrees. Or 0 if velocity vector norm is zero.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetClimbAngle()
|
|
|
|
|
|
|
|
|
|
-- Get position of the unit.
|
|
|
|
@@ -912,14 +915,16 @@ function POSITIONABLE:GetClimbAngle()
|
|
|
|
|
else
|
|
|
|
|
return 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--- Returns the pitch angle of a unit.
|
|
|
|
|
--- Returns the pitch angle of a POSITIONABLE.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return #number Pitch ange in degrees.
|
|
|
|
|
-- @return #number Pitch angle in degrees.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetPitch()
|
|
|
|
|
|
|
|
|
|
-- Get position of the unit.
|
|
|
|
@@ -934,7 +939,8 @@ end
|
|
|
|
|
|
|
|
|
|
--- Returns the roll angle of a unit.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return #number Pitch ange in degrees.
|
|
|
|
|
-- @return #number Pitch angle in degrees.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetRoll()
|
|
|
|
|
|
|
|
|
|
-- Get position of the unit.
|
|
|
|
@@ -942,34 +948,40 @@ function POSITIONABLE:GetRoll()
|
|
|
|
|
|
|
|
|
|
if unitpos then
|
|
|
|
|
|
|
|
|
|
--first, make a vector that is perpendicular to y and unitpos.x with cross product
|
|
|
|
|
-- First, make a vector that is perpendicular to y and unitpos.x with cross product
|
|
|
|
|
local cp = UTILS.VecCross( unitpos.x, { x = 0, y = 1, z = 0 } )
|
|
|
|
|
|
|
|
|
|
--now, get dot product of of this cross product with unitpos.z
|
|
|
|
|
-- Now, get dot product of of this cross product with unitpos.z
|
|
|
|
|
local dp = UTILS.VecDot( cp, unitpos.z )
|
|
|
|
|
|
|
|
|
|
--now get the magnitude of the roll (magnitude of the angle between two vectors is acos(vec1.vec2/|vec1||vec2|)
|
|
|
|
|
-- Now get the magnitude of the roll (magnitude of the angle between two vectors is acos(vec1.vec2/|vec1||vec2|)
|
|
|
|
|
local Roll = math.acos( dp / (UTILS.VecNorm( cp ) * UTILS.VecNorm( unitpos.z )) )
|
|
|
|
|
|
|
|
|
|
--now, have to get sign of roll.
|
|
|
|
|
-- by convention, making right roll positive
|
|
|
|
|
-- to get sign of roll, use the y component of unitpos.z. For right roll, y component is negative.
|
|
|
|
|
-- Now, have to get sign of roll. By convention, making right roll positive
|
|
|
|
|
-- To get sign of roll, use the y component of unitpos.z. For right roll, y component is negative.
|
|
|
|
|
|
|
|
|
|
if unitpos.z.y > 0 then -- left roll, flip the sign of the roll
|
|
|
|
|
Roll = -Roll
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return math.deg( Roll )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--- Returns the yaw angle of a unit.
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--- Returns the yaw angle of a POSITIONABLE.
|
|
|
|
|
-- @param Wrapper.Positionable#POSITIONABLE self
|
|
|
|
|
-- @return #number Yaw ange in degrees.
|
|
|
|
|
-- @return #number Yaw angle in degrees.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetYaw()
|
|
|
|
|
|
|
|
|
|
-- Get position of the unit.
|
|
|
|
|
local unitpos = self:GetPosition()
|
|
|
|
|
|
|
|
|
|
if unitpos then
|
|
|
|
|
|
|
|
|
|
-- get unit velocity
|
|
|
|
|
local unitvel = self:GetVelocityVec3()
|
|
|
|
|
|
|
|
|
@@ -991,38 +1003,43 @@ function POSITIONABLE:GetYaw()
|
|
|
|
|
end
|
|
|
|
|
return Yaw
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Returns the message text with the callsign embedded (if there is one).
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @return #string The message text
|
|
|
|
|
function POSITIONABLE:GetMessageText( Message, Name )
|
|
|
|
|
|
|
|
|
|
local DCSObject = self:GetDCSObject()
|
|
|
|
|
if DCSObject then
|
|
|
|
|
local Callsign = string.format( "%s", ( ( Name ~= "" and Name ) or self:GetCallsign() ~= "" and self:GetCallsign() ) or self:GetName() )
|
|
|
|
|
local MessageText = string.format("%s - %s", Callsign, Message )
|
|
|
|
|
return MessageText
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--- Returns the message text with the callsign embedded (if there is one).
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #string Message The message text.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
-- @return #string The message text.
|
|
|
|
|
-- @return #nil The POSITIONABLE is not existing or alive.
|
|
|
|
|
function POSITIONABLE:GetMessageText( Message, Name )
|
|
|
|
|
|
|
|
|
|
local DCSObject = self:GetDCSObject()
|
|
|
|
|
|
|
|
|
|
if DCSObject then
|
|
|
|
|
|
|
|
|
|
local Callsign = string.format( "%s", ((Name ~= "" and Name) or self:GetCallsign() ~= "" and self:GetCallsign()) or self:GetName() )
|
|
|
|
|
local MessageText = string.format( "%s - %s", Callsign, Message )
|
|
|
|
|
return MessageText
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--- Returns a message with the callsign embedded (if there is one).
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param DCS#Duration Duration The duration of the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
-- @return Core.Message#MESSAGE
|
|
|
|
|
function POSITIONABLE:GetMessage( Message, Duration, Name ) --R2.1 changed callsign and name and using GetMessageText
|
|
|
|
|
function POSITIONABLE:GetMessage( Message, Duration, Name )
|
|
|
|
|
|
|
|
|
|
local DCSObject = self:GetDCSObject()
|
|
|
|
|
|
|
|
|
|
if DCSObject then
|
|
|
|
|
local MessageText = self:GetMessageText( Message, Name )
|
|
|
|
|
return MESSAGE:New( MessageText, Duration )
|
|
|
|
@@ -1035,7 +1052,7 @@ end
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param Core.Message#MESSAGE MessageType MessageType The message type.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
-- @return Core.Message#MESSAGE
|
|
|
|
|
function POSITIONABLE:GetMessageType( Message, MessageType, Name ) -- R2.2 changed callsign and name and using GetMessageText
|
|
|
|
|
|
|
|
|
@@ -1053,7 +1070,7 @@ end
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param DCS#Duration Duration The duration of the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:MessageToAll( Message, Duration, Name )
|
|
|
|
|
self:F2( { Message, Duration } )
|
|
|
|
|
|
|
|
|
@@ -1071,7 +1088,7 @@ end
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param DCS#Duration Duration The duration of the message.
|
|
|
|
|
-- @param DCS#coalition MessageCoalition The Coalition receiving the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:MessageToCoalition( Message, Duration, MessageCoalition, Name )
|
|
|
|
|
self:F2( { Message, Duration } )
|
|
|
|
|
|
|
|
|
@@ -1085,14 +1102,13 @@ function POSITIONABLE:MessageToCoalition( Message, Duration, MessageCoalition, N
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Send a message to a coalition.
|
|
|
|
|
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param Core.Message#MESSAGE.Type MessageType The message type that determines the duration.
|
|
|
|
|
-- @param DCS#coalition MessageCoalition The Coalition receiving the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:MessageTypeToCoalition( Message, MessageType, MessageCoalition, Name )
|
|
|
|
|
self:F2( { Message, MessageType } )
|
|
|
|
|
|
|
|
|
@@ -1106,13 +1122,12 @@ function POSITIONABLE:MessageTypeToCoalition( Message, MessageType, MessageCoali
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Send a message to the red coalition.
|
|
|
|
|
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param DCS#Duration Duration The duration of the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:MessageToRed( Message, Duration, Name )
|
|
|
|
|
self:F2( { Message, Duration } )
|
|
|
|
|
|
|
|
|
@@ -1129,7 +1144,7 @@ end
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param DCS#Duration Duration The duration of the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:MessageToBlue( Message, Duration, Name )
|
|
|
|
|
self:F2( { Message, Duration } )
|
|
|
|
|
|
|
|
|
@@ -1147,7 +1162,7 @@ end
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param DCS#Duration Duration The duration of the message.
|
|
|
|
|
-- @param Wrapper.Client#CLIENT Client The client object receiving the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:MessageToClient( Message, Duration, Client, Name )
|
|
|
|
|
self:F2( { Message, Duration } )
|
|
|
|
|
|
|
|
|
@@ -1165,7 +1180,7 @@ end
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param DCS#Duration Duration The duration of the message.
|
|
|
|
|
-- @param Wrapper.Group#GROUP MessageGroup The GROUP object receiving the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup, Name )
|
|
|
|
|
self:F2( { Message, Duration } )
|
|
|
|
|
|
|
|
|
@@ -1178,11 +1193,15 @@ function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup, Name )
|
|
|
|
|
BASE:E( { "Message not sent to Group; Group is not alive...", Message = Message, MessageGroup = MessageGroup } )
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
BASE:E( { "Message not sent to Group; Positionable is not alive ...", Message = Message, Positionable = self, MessageGroup = MessageGroup } )
|
|
|
|
|
BASE:E( {
|
|
|
|
|
"Message not sent to Group; Positionable is not alive ...",
|
|
|
|
|
Message = Message,
|
|
|
|
|
Positionable = self,
|
|
|
|
|
MessageGroup = MessageGroup
|
|
|
|
|
} )
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -1192,7 +1211,7 @@ end
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param Core.Message#MESSAGE.Type MessageType The message type that determines the duration.
|
|
|
|
|
-- @param Wrapper.Group#GROUP MessageGroup The GROUP object receiving the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, the Name is the type of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:MessageTypeToGroup( Message, MessageType, MessageGroup, Name )
|
|
|
|
|
self:F2( { Message, MessageType } )
|
|
|
|
|
|
|
|
|
@@ -1212,18 +1231,16 @@ end
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param DCS#Duration Duration The duration of the message.
|
|
|
|
|
-- @param Core.Set#SET_GROUP MessageSetGroup The SET_GROUP collection receiving the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
function POSITIONABLE:MessageToSetGroup( Message, Duration, MessageSetGroup, Name ) --R2.1
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:MessageToSetGroup( Message, Duration, MessageSetGroup, Name )
|
|
|
|
|
self:F2( { Message, Duration } )
|
|
|
|
|
|
|
|
|
|
local DCSObject = self:GetDCSObject()
|
|
|
|
|
if DCSObject then
|
|
|
|
|
if DCSObject:isExist() then
|
|
|
|
|
MessageSetGroup:ForEachGroupAlive(
|
|
|
|
|
function( MessageGroup )
|
|
|
|
|
MessageSetGroup:ForEachGroupAlive( function( MessageGroup )
|
|
|
|
|
self:GetMessage( Message, Duration, Name ):ToGroup( MessageGroup )
|
|
|
|
|
end
|
|
|
|
|
)
|
|
|
|
|
end )
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@@ -1235,7 +1252,7 @@ end
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param #string Message The message text
|
|
|
|
|
-- @param DCS#Duration Duration The duration of the message.
|
|
|
|
|
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
|
|
|
|
|
-- @param #string Name (Optional) The Name of the sender. If not provided, Name is set to the type of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:Message( Message, Duration, Name )
|
|
|
|
|
self:F2( { Message, Duration } )
|
|
|
|
|
|
|
|
|
@@ -1251,7 +1268,7 @@ end
|
|
|
|
|
-- Set parameters with the methods provided, then use RADIO:Broadcast() to actually broadcast the message
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return Core.Radio#RADIO Radio
|
|
|
|
|
function POSITIONABLE:GetRadio() --R2.1
|
|
|
|
|
function POSITIONABLE:GetRadio()
|
|
|
|
|
self:F2( self )
|
|
|
|
|
return RADIO:New( self )
|
|
|
|
|
end
|
|
|
|
@@ -1259,7 +1276,7 @@ end
|
|
|
|
|
--- Create a @{Core.Radio#BEACON}, to allow this POSITIONABLE to broadcast beacon signals
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return Core.Radio#RADIO Radio
|
|
|
|
|
function POSITIONABLE:GetBeacon() --R2.1
|
|
|
|
|
function POSITIONABLE:GetBeacon()
|
|
|
|
|
self:F2( self )
|
|
|
|
|
return BEACON:New( self )
|
|
|
|
|
end
|
|
|
|
@@ -1270,7 +1287,7 @@ end
|
|
|
|
|
-- @param #number LaserCode Laser code or random number in [1000, 9999].
|
|
|
|
|
-- @param #number Duration Duration of lasing in seconds.
|
|
|
|
|
-- @return Core.Spot#SPOT
|
|
|
|
|
function POSITIONABLE:LaseUnit( Target, LaserCode, Duration ) --R2.1
|
|
|
|
|
function POSITIONABLE:LaseUnit( Target, LaserCode, Duration )
|
|
|
|
|
self:F2()
|
|
|
|
|
|
|
|
|
|
LaserCode = LaserCode or math.random( 1000, 9999 )
|
|
|
|
@@ -1278,7 +1295,7 @@ function POSITIONABLE:LaseUnit( Target, LaserCode, Duration ) --R2.1
|
|
|
|
|
local RecceDcsUnit = self:GetDCSObject()
|
|
|
|
|
local TargetVec3 = Target:GetVec3()
|
|
|
|
|
|
|
|
|
|
self:F("bulding spot")
|
|
|
|
|
self:F( "building spot" )
|
|
|
|
|
self.Spot = SPOT:New( self ) -- Core.Spot#SPOT
|
|
|
|
|
self.Spot:LaseOn( Target, LaserCode, Duration )
|
|
|
|
|
self.LaserCode = LaserCode
|
|
|
|
@@ -1289,7 +1306,7 @@ end
|
|
|
|
|
|
|
|
|
|
--- Start Lasing a COORDINATE.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param Core.Point#COORDIUNATE Coordinate The coordinate where the lase is pointing at.
|
|
|
|
|
-- @param Core.Point#COORDINATE Coordinate The coordinate where the lase is pointing at.
|
|
|
|
|
-- @param #number LaserCode Laser code or random number in [1000, 9999].
|
|
|
|
|
-- @param #number Duration Duration of lasing in seconds.
|
|
|
|
|
-- @return Core.Spot#SPOT
|
|
|
|
@@ -1308,7 +1325,7 @@ end
|
|
|
|
|
--- Stop Lasing a POSITIONABLE
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return #POSITIONABLE
|
|
|
|
|
function POSITIONABLE:LaseOff() --R2.1
|
|
|
|
|
function POSITIONABLE:LaseOff()
|
|
|
|
|
self:F2()
|
|
|
|
|
|
|
|
|
|
if self.Spot then
|
|
|
|
@@ -1322,7 +1339,7 @@ end
|
|
|
|
|
--- Check if the POSITIONABLE is lasing a target
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return #boolean true if it is lasing a target
|
|
|
|
|
function POSITIONABLE:IsLasing() --R2.1
|
|
|
|
|
function POSITIONABLE:IsLasing()
|
|
|
|
|
self:F2()
|
|
|
|
|
|
|
|
|
|
local Lasing = false
|
|
|
|
@@ -1337,7 +1354,7 @@ end
|
|
|
|
|
--- Get the Spot
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return Core.Spot#SPOT The Spot
|
|
|
|
|
function POSITIONABLE:GetSpot() --R2.1
|
|
|
|
|
function POSITIONABLE:GetSpot()
|
|
|
|
|
|
|
|
|
|
return self.Spot
|
|
|
|
|
end
|
|
|
|
@@ -1345,7 +1362,7 @@ end
|
|
|
|
|
--- Get the last assigned laser code
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @return #number The laser code
|
|
|
|
|
function POSITIONABLE:GetLaserCode() --R2.1
|
|
|
|
|
function POSITIONABLE:GetLaserCode()
|
|
|
|
|
|
|
|
|
|
return self.LaserCode
|
|
|
|
|
end
|
|
|
|
@@ -1368,8 +1385,6 @@ do -- Cargo
|
|
|
|
|
return self.__.Cargo
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Remove cargo.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param Core.Cargo#CARGO Cargo
|
|
|
|
@@ -1468,8 +1483,8 @@ do -- Cargo
|
|
|
|
|
self:F( { Desc = Desc } )
|
|
|
|
|
|
|
|
|
|
local Weights = {
|
|
|
|
|
["C-17A"] = 35000, --77519 cannot be used, because it loads way too much apcs and infantry.,
|
|
|
|
|
["C-130"] = 22000 --The real value cannot be used, because it loads way too much apcs and infantry.,
|
|
|
|
|
["C-17A"] = 35000, -- 77519 cannot be used, because it loads way too many APCs and infantry.
|
|
|
|
|
["C-130"] = 22000 -- The real value cannot be used, because it loads way too many APCs and infantry.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
self.__.CargoBayWeightLimit = Weights[Desc.typeName] or (Desc.massMax - (Desc.massEmpty + Desc.fuelMassMax))
|
|
|
|
@@ -1485,7 +1500,7 @@ do -- Cargo
|
|
|
|
|
["Dry-cargo ship-2"] = 70000,
|
|
|
|
|
["Higgins_boat"] = 3700, -- Higgins Boat can load 3700 kg of general cargo or 36 men (source wikipedia).
|
|
|
|
|
["USS_Samuel_Chase"] = 25000, -- Let's say 25 tons for now. Wiki says 33 Higgins boats, which would be 264 tons (can't be right!) and/or 578 troops.
|
|
|
|
|
["LST_Mk2"] =2100000, -- Can carry 2100 tons according to wiki source!
|
|
|
|
|
["LST_Mk2"] = 2100000 -- Can carry 2100 tons according to wiki source!
|
|
|
|
|
}
|
|
|
|
|
self.__.CargoBayWeightLimit = (Weights[Desc.typeName] or 50000)
|
|
|
|
|
|
|
|
|
@@ -1534,7 +1549,7 @@ do -- Cargo
|
|
|
|
|
["Ural-4320 APA-5D"] = 10,
|
|
|
|
|
["Ural-4320T"] = 14,
|
|
|
|
|
["ZBD04A"] = 7, -- new by kappa
|
|
|
|
|
["VAB_Mephisto"] = 8, -- new by Apple
|
|
|
|
|
["VAB_Mephisto"] = 8 -- new by Apple
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local CargoBayWeightLimit = (Weights[Desc.typeName] or 0) * 95
|
|
|
|
@@ -1586,9 +1601,9 @@ end
|
|
|
|
|
|
|
|
|
|
--- Smoke the POSITIONABLE.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param Utilities.Utils#SMOKECOLOR SmokeColor The color to smoke to positionable.
|
|
|
|
|
-- @param #number Range The range in meters to randomize the smoking around the positionable.
|
|
|
|
|
-- @param #number AddHeight The height in meters to add to the altitude of the positionable.
|
|
|
|
|
-- @param Utilities.Utils#SMOKECOLOR SmokeColor The smoke color.
|
|
|
|
|
-- @param #number Range The range in meters to randomize the smoking around the POSITIONABLE.
|
|
|
|
|
-- @param #number AddHeight The height in meters to add to the altitude of the POSITIONABLE.
|
|
|
|
|
function POSITIONABLE:Smoke( SmokeColor, Range, AddHeight )
|
|
|
|
|
self:F2()
|
|
|
|
|
if Range then
|
|
|
|
@@ -1638,7 +1653,6 @@ function POSITIONABLE:SmokeBlue()
|
|
|
|
|
trigger.action.smoke( self:GetVec3(), trigger.smokeColor.Blue )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--- Returns true if the unit is within a @{Zone}.
|
|
|
|
|
-- @param #POSITIONABLE self
|
|
|
|
|
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
|
|
|
|
|