#CONTROLLABLE

- Added OptionAllowFormationSideSwap()
- Added OptionAIRunwayLineup()
This commit is contained in:
Applevangelist
2026-02-06 16:26:56 +01:00
parent 1781f5e7d6
commit 1830b4c752
3 changed files with 43 additions and 1 deletions
+3
View File
@@ -1672,6 +1672,9 @@ do -- AI
-- @field OPTION_RADIO_USAGE_KILL
-- @field JETT_TANKS_IF_EMPTY
-- @field FORCED_ATTACK
-- @field PREFER_VERTICAL
-- @field ALLOW_FORMATION_SIDE_SWAP
-- @field AI_RUNWAY_LINE_UP
---
-- @type AI.Option.Air.val
-1
View File
@@ -5053,7 +5053,6 @@ end
--- (Internal) Housekeeping - Cleanup crates when build
-- @param #CTLD self
--
-- @param #table Crates Table of #CTLD_CARGO objects near the unit.
-- @param #CTLD.Buildable Build Table build object.
-- @param #number Number Number of objects in Crates (found) to limit search.
@@ -3658,6 +3658,46 @@ function CONTROLLABLE:OptionPreferVerticalLanding()
return nil
end
--- Air - Allow formation side swap
-- @param #CONTROLLABLE self
-- @return #CONTROLLABLE self
function CONTROLLABLE:OptionAllowFormationSideSwap()
self:F2( { self.ControllableName } )
local DCSControllable = self:GetDCSObject()
if DCSControllable then
local Controller = self:_GetController()
if self:IsAir() then
Controller:setOption( AI.Option.Air.id.ALLOW_FORMATION_SIDE_SWAP, true )
end
return self
end
return nil
end
--- Air - Allow formation takeoff, if enough space
-- @param #CONTROLLABLE self
-- @return #CONTROLLABLE self
function CONTROLLABLE:OptionAIRunwayLineUp()
self:F2( { self.ControllableName } )
local DCSControllable = self:GetDCSObject()
if DCSControllable then
local Controller = self:_GetController()
if self:IsAir() then
Controller:setOption( 37, true )
end
return self
end
return nil
end
--- Can the CONTROLLABLE evade on enemy fire?
-- @param #CONTROLLABLE self
-- @return #boolean