mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
AIRBOSS, RECOVERYTANKER, RESCUEHELO, RANGE
AIRBOSS v0.9.3 RECOVERYTANKER v1.0.6 RESCUEHELO v1.0.4 RANGE v1.2.4 SPAWN added modex GROUP added modex respawn
This commit is contained in:
@@ -657,7 +657,7 @@ function AIRBASE:FindFreeParkingSpotForAircraft(group, terminaltype, scanradius,
|
||||
if r1 and r2 then
|
||||
local safedist=(r1+r2)*1.1
|
||||
local safe = (dist > safedist)
|
||||
self:E(string.format("r1=%.1f r2=%.1f s=%.1f d=%.1f ==> safe=%s", r1, r2, safedist, dist, tostring(safe)))
|
||||
self:T2(string.format("r1=%.1f r2=%.1f s=%.1f d=%.1f ==> safe=%s", r1, r2, safedist, dist, tostring(safe)))
|
||||
return safe
|
||||
else
|
||||
return true
|
||||
@@ -710,7 +710,7 @@ function AIRBASE:FindFreeParkingSpotForAircraft(group, terminaltype, scanradius,
|
||||
if verysafe and (parkingspot.Free==false or parkingspot.TOAC==true) then
|
||||
|
||||
-- DCS getParking() routine returned that spot is not free.
|
||||
self:E(string.format("%s: Parking spot id %d NOT free (or aircraft has not taken off yet). Free=%s, TOAC=%s.", airport, parkingspot.TerminalID, tostring(parkingspot.Free), tostring(parkingspot.TOAC)))
|
||||
self:T(string.format("%s: Parking spot id %d NOT free (or aircraft has not taken off yet). Free=%s, TOAC=%s.", airport, parkingspot.TerminalID, tostring(parkingspot.Free), tostring(parkingspot.TOAC)))
|
||||
|
||||
else
|
||||
|
||||
@@ -785,11 +785,12 @@ function AIRBASE:FindFreeParkingSpotForAircraft(group, terminaltype, scanradius,
|
||||
if occupied then
|
||||
self:T(string.format("%s: Parking spot id %d occupied.", airport, _termid))
|
||||
else
|
||||
self:I(string.format("%s: Parking spot id %d free.", airport, _termid))
|
||||
self:I(string.format("%s: Parking spot id %d free.", airport, _termid))
|
||||
if nvalid<_nspots then
|
||||
table.insert(validspots, {Coordinate=_spot, TerminalID=_termid})
|
||||
end
|
||||
nvalid=nvalid+1
|
||||
self:I(string.format("%s: Parking spot id %d free. Nfree=%d/%d.", airport, _termid, nvalid,_nspots))
|
||||
end
|
||||
|
||||
end -- loop over units
|
||||
|
||||
@@ -1457,11 +1457,16 @@ end
|
||||
|
||||
--- Sets the radio comms on or off when the group is respawned. Same as checking/unchecking the COMM box in the mission editor.
|
||||
-- @param #GROUP self
|
||||
-- @param #number switch If true (or nil), enables the radio comms. If false, disables the radio for the spawned group.
|
||||
-- @param #boolean switch If true (or nil), enables the radio comms. If false, disables the radio for the spawned group.
|
||||
-- @return #GROUP self
|
||||
function GROUP:InitRadioCommsOnOff(switch)
|
||||
self:F({switch=switch} )
|
||||
self.InitRespawnRadio=switch or true
|
||||
self:F({switch=switch})
|
||||
if switch==true or switch==nil then
|
||||
self.InitRespawnRadio=true
|
||||
else
|
||||
self.InitRespawnRadio=false
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Sets the radio frequency of the group when it is respawned.
|
||||
@@ -1469,7 +1474,7 @@ end
|
||||
-- @param #number frequency The frequency in MHz.
|
||||
-- @return #GROUP self
|
||||
function GROUP:InitRadioFrequency(frequency)
|
||||
self:F({frequency=frequency} )
|
||||
self:F({frequency=frequency})
|
||||
|
||||
self.InitRespawnFreq=frequency
|
||||
|
||||
@@ -1490,6 +1495,17 @@ function GROUP:InitRadioModulation(modulation)
|
||||
return self
|
||||
end
|
||||
|
||||
--- Sets the modex (tail number) of the first unit of the group. If more units are in the group, the number is increased with every unit.
|
||||
-- @param #GROUP self
|
||||
-- @param #string modex Tail number of the first unit.
|
||||
-- @return #GROUP self
|
||||
function GROUP:InitModex(modex)
|
||||
self:F({modex=modex})
|
||||
if modex then
|
||||
self.InitRespawnModex=tonumber(modex)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
--- Respawn the @{Wrapper.Group} at a @{Point}.
|
||||
-- The method will setup the new group template according the Init(Respawn) settings provided for the group.
|
||||
@@ -1641,6 +1657,13 @@ function GROUP:Respawn( Template, Reset )
|
||||
|
||||
end
|
||||
|
||||
-- Set tail number.
|
||||
if self.InitRespawnModex then
|
||||
for UnitID=1,#Template.units do
|
||||
Template.units[UnitID].onboard_num=string.format("%03d", self.InitRespawnModex+(UnitID-1))
|
||||
end
|
||||
end
|
||||
|
||||
-- Set radio frequency and modulation.
|
||||
if self.InitRespawnRadio then
|
||||
Template.communication=self.InitRespawnRadio
|
||||
|
||||
Reference in New Issue
Block a user