SPAWNSTATIC

- Attempt to SPAWN FARPS. Does not work yet.
This commit is contained in:
Frank
2020-12-14 00:08:30 +01:00
parent 2500cfb3c7
commit 47c461e504
2 changed files with 40 additions and 8 deletions

View File

@@ -241,6 +241,20 @@ function SPAWNSTATIC:InitShape(StaticShape)
return self return self
end end
--- Initialize parameters for spawning FARPs.
-- @param #SPAWNSTATIC self
-- @param #number CallsignID Callsign ID. Default 1 (="London").
-- @param #number Frequency Frequency in MHz. Default 127.5 MHz.
-- @param #number Modulation Modulation 0=AM, 1=FM.
-- @return #SPAWNSTATIC self
function SPAWNSTATIC:InitFARP(CallsignID, Frequency, Modulation)
self.InitFarp=true
self.InitFarpCallsignID=CallsignID or 1
self.InitFarpFreq=Frequency or 127.5
self.InitFarpModu=Modulation or 0
return self
end
--- Initialize cargo mass. --- Initialize cargo mass.
-- @param #SPAWNSTATIC self -- @param #SPAWNSTATIC self
-- @param #number Mass Mass of the cargo in kg. -- @param #number Mass Mass of the cargo in kg.
@@ -420,22 +434,34 @@ function SPAWNSTATIC:_SpawnStatic(Template, CountryID)
Template.offsets.angle=self.InitOffsetAngle and math.rad(self.InitOffsetAngle) or 0 Template.offsets.angle=self.InitOffsetAngle and math.rad(self.InitOffsetAngle) or 0
end end
if self.InitFarp then
Template.heliport_callsign_id = self.InitFarpCallsignID
Template.heliport_frequency = self.InitFarpFreq
Template.heliport_modulation = self.InitFarpModu
Template.unitId=nil
end
-- Increase spawn index counter. -- Increase spawn index counter.
self.SpawnIndex = self.SpawnIndex + 1 self.SpawnIndex = self.SpawnIndex + 1
-- Name of the spawned static. -- Name of the spawned static.
Template.name = self.InitStaticName or string.format("%s#%05d", self.SpawnTemplatePrefix, self.SpawnIndex) Template.name = self.InitStaticName or string.format("%s#%05d", self.SpawnTemplatePrefix, self.SpawnIndex)
-- Register the new static. -- Add and register the new static.
--_DATABASE:_RegisterStaticTemplate(Template, self.CoalitionID, self.CategoryID, CountryID) local mystatic=_DATABASE:AddStatic(Template.name)
_DATABASE:AddStatic(Template.name)
-- Debug output. -- Debug output.
self:T(Template) self:T(Template)
-- Add static to the game. -- Add static to the game.
local Static=coalition.addStaticObject(CountryID, Template) local Static=nil
if self.InitFARP then
env.info("Spawning FARP")
Static=coalition.addGroup(CountryID, -1, Template)
else
Static=coalition.addStaticObject(CountryID, Template)
end
return _DATABASE:FindStatic(Static:getName()) return mystatic
end end

View File

@@ -27,12 +27,16 @@
-- **Supported Carriers:** -- **Supported Carriers:**
-- --
-- * [USS John C. Stennis](https://en.wikipedia.org/wiki/USS_John_C._Stennis) (CVN-74) -- * [USS John C. Stennis](https://en.wikipedia.org/wiki/USS_John_C._Stennis) (CVN-74)
-- * [USS Theodore Roosevelt](https://en.wikipedia.org/wiki/USS_Theodore_Roosevelt_(CVN-71)) (CVN-71) [Super Carrier Module]
-- * [USS Abraham Lincoln](https://en.wikipedia.org/wiki/USS_Abraham_Lincoln_(CVN-72)) (CVN-72) [Super Carrier Module]
-- * [USS George Washington](https://en.wikipedia.org/wiki/USS_George_Washington_(CVN-73)) (CVN-73) [Super Carrier Module]
-- * [USS Harry S. Truman](https://en.wikipedia.org/wiki/USS_Harry_S._Truman) (CVN-75) [Super Carrier Module]
-- * [USS Tarawa](https://en.wikipedia.org/wiki/USS_Tarawa_(LHA-1)) (LHA-1) [**WIP**] -- * [USS Tarawa](https://en.wikipedia.org/wiki/USS_Tarawa_(LHA-1)) (LHA-1) [**WIP**]
-- --
-- **Supported Aircraft:** -- **Supported Aircraft:**
-- --
-- * [F/A-18C Hornet Lot 20](https://forums.eagle.ru/forumdisplay.php?f=557) (Player & AI) -- * [F/A-18C Hornet Lot 20](https://forums.eagle.ru/forumdisplay.php?f=557) (Player & AI)
-- * [F-14B Tomcat](https://forums.eagle.ru/forumdisplay.php?f=395) (Player & AI) -- * [F-14A/B Tomcat](https://forums.eagle.ru/forumdisplay.php?f=395) (Player & AI)
-- * [A-4E Skyhawk Community Mod](https://forums.eagle.ru/showthread.php?t=224989) (Player & AI) -- * [A-4E Skyhawk Community Mod](https://forums.eagle.ru/showthread.php?t=224989) (Player & AI)
-- * [AV-8B N/A Harrier](https://forums.eagle.ru/forumdisplay.php?f=555) (Player & AI) [**WIP**] -- * [AV-8B N/A Harrier](https://forums.eagle.ru/forumdisplay.php?f=555) (Player & AI) [**WIP**]
-- * F/A-18C Hornet (AI) -- * F/A-18C Hornet (AI)
@@ -47,7 +51,9 @@
-- the no other fixed wing aircraft (human or AI controlled) are supposed to land on the Tarawa. Currently only Case I is supported. Case II/III take slightly steps from the CVN carrier. -- the no other fixed wing aircraft (human or AI controlled) are supposed to land on the Tarawa. Currently only Case I is supported. Case II/III take slightly steps from the CVN carrier.
-- However, the two Case II/III pattern are very similar so this is not a big drawback. -- However, the two Case II/III pattern are very similar so this is not a big drawback.
-- --
-- Heatblur's mighty F-14B Tomcat has been added (March 13th 2019) as well. -- Heatblur's mighty F-14B Tomcat has been added (March 13th 2019) as well. Same goes for the A version.
--
-- The [DCS Supercarriers](https://forums.eagle.ru/forum/151-dcs-supercarrier/) are also supported.
-- --
-- ## Discussion -- ## Discussion
-- --