Merge pull request #1104 from FlightControl-Master/FF/Develop

AIRBOSS v0.9.1
This commit is contained in:
Frank 2019-01-23 11:09:11 +01:00 committed by GitHub
commit 0fe18ee5b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 693 additions and 366 deletions

View File

@ -461,13 +461,13 @@ BEACON.Type={
ICLS = 131584, ICLS = 131584,
} }
--- Beacon systems supported by DCS. --- Beacon systems supported by DCS. https://wiki.hoggitworld.com/view/DCS_command_activateBeacon
-- @type BEACON.System -- @type BEACON.System
-- @field #number PAR_10 -- @field #number PAR_10
-- @field #number RSBN_5 -- @field #number RSBN_5
-- @field #number TACAN -- @field #number TACAN
-- @field #number TACAN_TANKER -- @field #number TACAN_TANKER
-- @field #number ILS_LOCALIZER -- @field #number ILS_LOCALIZER (This is the one to be used for AA TACAN Tanker!)
-- @field #number ILS_GLIDESLOPE -- @field #number ILS_GLIDESLOPE
-- @field #number BROADCAST_STATION -- @field #number BROADCAST_STATION
BEACON.System={ BEACON.System={
@ -539,7 +539,7 @@ function BEACON:ActivateTACAN(Channel, Mode, Message, Bearing, Duration)
-- Check if unit is an aircraft and set system accordingly. -- Check if unit is an aircraft and set system accordingly.
local AA=self.Positionable:IsAir() local AA=self.Positionable:IsAir()
if AA then if AA then
System=BEACON.System.TACAN_TANKER System=5 --NOTE: 5 is how you cat the correct tanker behaviour! --BEACON.System.TACAN_TANKER
-- Check if "Y" mode is selected for aircraft. -- Check if "Y" mode is selected for aircraft.
if Mode~="Y" then if Mode~="Y" then
self:E({"WARNING: The POSITIONABLE you want to attach the AA Tacan Beacon is an aircraft: Mode should Y !The BEACON is not emitting.", self.Positionable}) self:E({"WARNING: The POSITIONABLE you want to attach the AA Tacan Beacon is an aircraft: Mode should Y !The BEACON is not emitting.", self.Positionable})

View File

@ -4,9 +4,9 @@
-- --
-- ## Features: -- ## Features:
-- --
-- * Holds (virtual) assests in stock and spawns them upon request. -- * Holds (virtual) assets in stock and spawns them upon request.
-- * Manages requests of assets from other warehouses. -- * Manages requests of assets from other warehouses.
-- * Queueing system with optional priorization of requests. -- * Queueing system with optional prioritization of requests.
-- * Realistic transportation of assets between warehouses. -- * Realistic transportation of assets between warehouses.
-- * Different means of automatic transportation (planes, helicopters, APCs, self propelled). -- * Different means of automatic transportation (planes, helicopters, APCs, self propelled).
-- * Strategic components such as capturing, defending and destroying warehouses and their associated infrastructure. -- * Strategic components such as capturing, defending and destroying warehouses and their associated infrastructure.
@ -68,7 +68,7 @@
-- @field #number spawnzonemaxdist Max distance between warehouse and spawn zone. Default 5000 meters. -- @field #number spawnzonemaxdist Max distance between warehouse and spawn zone. Default 5000 meters.
-- @field #boolean autosave Automatically save assets to file when mission ends. -- @field #boolean autosave Automatically save assets to file when mission ends.
-- @field #string autosavepath Path where the asset file is saved on auto save. -- @field #string autosavepath Path where the asset file is saved on auto save.
-- @field #string autosavefilename File name of the auto asset save file. Default is auto generated from warehouse id and name. -- @field #string autosavefile File name of the auto asset save file. Default is auto generated from warehouse id and name.
-- @field #boolean safeparking If true, parking spots for aircraft are considered as occupied if e.g. a client aircraft is parked there. Default false. -- @field #boolean safeparking If true, parking spots for aircraft are considered as occupied if e.g. a client aircraft is parked there. Default false.
-- @field #boolean isunit If true, warehouse is represented by a unit instead of a static. -- @field #boolean isunit If true, warehouse is represented by a unit instead of a static.
-- @extends Core.Fsm#FSM -- @extends Core.Fsm#FSM
@ -84,7 +84,7 @@
-- this means they can be destroyed during the transport and add more life to the DCS world. -- this means they can be destroyed during the transport and add more life to the DCS world.
-- --
-- This comes along with some additional interesting stategic aspects since capturing/defending and destroying/protecting an enemy or your -- This comes along with some additional interesting stategic aspects since capturing/defending and destroying/protecting an enemy or your
-- own warehous becomes of critical importance for the development of a conflict. -- own warehouse becomes of critical importance for the development of a conflict.
-- --
-- In essence, creating an efficient network of warehouses is vital for the success of a battle or even the whole war. Likewise, of course, cutting off the enemy -- In essence, creating an efficient network of warehouses is vital for the success of a battle or even the whole war. Likewise, of course, cutting off the enemy
-- of important supply lines by capturing or destroying warehouses or their associated infrastructure is equally important. -- of important supply lines by capturing or destroying warehouses or their associated infrastructure is equally important.
@ -1733,7 +1733,7 @@ WAREHOUSE.db = {
--- Warehouse class version. --- Warehouse class version.
-- @field #string version -- @field #string version
WAREHOUSE.version="0.6.7" WAREHOUSE.version="0.6.8"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO: Warehouse todo list. -- TODO: Warehouse todo list.
@ -1802,10 +1802,11 @@ function WAREHOUSE:New(warehouse, alias)
-- Check if just a string was given and convert to static. -- Check if just a string was given and convert to static.
if type(warehouse)=="string" then if type(warehouse)=="string" then
warehouse=UNIT:FindByName(warehouse) local warehousename=warehouse
warehouse=UNIT:FindByName(warehousename)
if warehouse==nil then if warehouse==nil then
env.info(string.format("No warehouse unit with name %s found trying static.", warehouse)) env.info(string.format("No warehouse unit with name %s found trying static.", tostring(warehousename)))
warehouse=STATIC:FindByName(warehouse, true) warehouse=STATIC:FindByName(warehousename, true)
self.isunit=false self.isunit=false
else else
self.isunit=true self.isunit=true
@ -4795,9 +4796,8 @@ function WAREHOUSE:onafterCaptured(From, Event, To, Coalition, Country)
local text=string.format("Warehouse %s: We were captured by enemy coalition (side=%d)!", self.alias, Coalition) local text=string.format("Warehouse %s: We were captured by enemy coalition (side=%d)!", self.alias, Coalition)
self:_InfoMessage(text) self:_InfoMessage(text)
-- Change coalition and country of warehouse static. -- Warehouse respawned.
self:ChangeCoaliton(Coalition, Country) self:ChangeCountry(Country)
end end
@ -5173,9 +5173,12 @@ function WAREHOUSE:_SpawnAssetRequest(Request)
-- Spawn train. -- Spawn train.
if self.rail then if self.rail then
--TODO: Rail should only get one asset because they would spawn on top! --TODO: Rail should only get one asset because they would spawn on top!
-- Spawn naval assets.
_group=self:_SpawnAssetGroundNaval(_alias,_assetitem, Request, self.spawnzone)
end end
self:E(self.wid.."ERROR: Spawning of TRAIN assets not possible yet!") --self:E(self.wid.."ERROR: Spawning of TRAIN assets not possible yet!")
elseif _assetitem.category==Group.Category.SHIP then elseif _assetitem.category==Group.Category.SHIP then
@ -5220,7 +5223,7 @@ end
-- @return Wrapper.Group#GROUP The spawned group or nil if the group could not be spawned. -- @return Wrapper.Group#GROUP The spawned group or nil if the group could not be spawned.
function WAREHOUSE:_SpawnAssetGroundNaval(alias, asset, request, spawnzone, aioff) function WAREHOUSE:_SpawnAssetGroundNaval(alias, asset, request, spawnzone, aioff)
if asset and (asset.category==Group.Category.GROUND or asset.category==Group.Category.SHIP) then if asset and (asset.category==Group.Category.GROUND or asset.category==Group.Category.SHIP or asset.category==Group.Category.TRAIN) then
-- Prepare spawn template. -- Prepare spawn template.
local template=self:_SpawnAssetPrepareTemplate(asset, alias) local template=self:_SpawnAssetPrepareTemplate(asset, alias)
@ -5231,6 +5234,11 @@ function WAREHOUSE:_SpawnAssetGroundNaval(alias, asset, request, spawnzone, aiof
-- Get a random coordinate in the spawn zone. -- Get a random coordinate in the spawn zone.
local coord=spawnzone:GetRandomCoordinate() local coord=spawnzone:GetRandomCoordinate()
-- For trains, we use the rail connection point.
if asset.category==Group.Category.TRAIN then
coord=self.rail
end
-- Translate the position of the units. -- Translate the position of the units.
for i=1,#template.units do for i=1,#template.units do

File diff suppressed because it is too large Load Diff

View File

@ -266,7 +266,7 @@ RECOVERYTANKER.version="1.0.3"
-- TODO list -- TODO list
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO: Is alive check for tanker necessary? -- DONE: Is alive check for tanker necessary?
-- DONE: Seamless change of position update. Get good updated waypoint and update position if tanker position is right. Not really possiple atm. -- DONE: Seamless change of position update. Get good updated waypoint and update position if tanker position is right. Not really possiple atm.
-- DONE: Check if TACAN mode "X" is allowed for AA TACAN stations. Nope -- DONE: Check if TACAN mode "X" is allowed for AA TACAN stations. Nope
-- DONE: Check if tanker is going back to "Running" state after RTB and respawn. -- DONE: Check if tanker is going back to "Running" state after RTB and respawn.
@ -708,6 +708,24 @@ function RECOVERYTANKER:IsStopped()
return self:is("Stopped") return self:is("Stopped")
end end
--- Alias of tanker spawn group.
-- @param #RECOVERYTANKER self
-- @return #string Alias of the tanker.
function RECOVERYTANKER:GetAlias()
return self.alias
end
--- Get unit name of the spawned tanker.
-- @param #RECOVERYTANKER self
-- @return #string Name of the tanker unit or nil if it does not exist.
function RECOVERYTANKER:GetUnitName()
local unit=self.tanker:GetUnit(1)
if unit then
return unit:GetName()
end
return nil
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- FSM states -- FSM states
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -651,6 +651,17 @@ function RESCUEHELO:GetAlias()
return self.alias return self.alias
end end
--- Get unit name of the spawned helo.
-- @param #RESCUEHELO self
-- @return #string Name of the helo unit or nil if it does not exist.
function RESCUEHELO:GetUnitName()
local unit=self.helo:GetUnit(1)
if unit then
return unit:GetName()
end
return nil
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- EVENT functions -- EVENT functions
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -909,7 +920,7 @@ function RESCUEHELO:onafterStatus(From, Event, To)
-- Report current fuel. -- Report current fuel.
local text=string.format("Rescue Helo %s: state=%s fuel=%.1f", self.helo:GetName(), self:GetState(), fuel) local text=string.format("Rescue Helo %s: state=%s fuel=%.1f", self.helo:GetName(), self:GetState(), fuel)
MESSAGE:New(text, 10, "DEBUG"):ToAllIf(self.Debug) MESSAGE:New(text, 10, "DEBUG"):ToAllIf(self.Debug)
self:E(self.lid..text) self:T(self.lid..text)
if self:IsRunning() then if self:IsRunning() then