AIRBOSS v0.8.0

This commit is contained in:
Frank
2019-01-10 17:26:37 +01:00
parent acd6e0f423
commit 47dd068655
5 changed files with 1435 additions and 585 deletions

View File

@@ -322,6 +322,9 @@ function SPAWN:New( SpawnTemplatePrefix )
self.Grouping = nil -- No grouping.
self.SpawnInitLivery = nil -- No special livery.
self.SpawnInitSkill = nil -- No special skill.
self.SpawnInitFreq = nil -- No special frequency.
self.SpawnInitModu = nil -- No special modulation.
self.SpawnInitRadio = nil -- No radio comms setting.
self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned.
else
@@ -370,7 +373,10 @@ function SPAWN:NewWithAlias( SpawnTemplatePrefix, SpawnAliasPrefix )
self.Grouping = nil -- No grouping.
self.SpawnInitLivery = nil -- No special livery.
self.SpawnInitSkill = nil -- No special skill.
self.SpawnInitFreq = nil -- No special frequency.
self.SpawnInitModu = nil -- No special modulation.
self.SpawnInitRadio = nil -- No radio comms setting.
self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned.
else
error( "SPAWN:New: There is no group declared in the mission editor with SpawnTemplatePrefix = '" .. SpawnTemplatePrefix .. "'" )
@@ -421,7 +427,10 @@ function SPAWN:NewFromTemplate( SpawnTemplate, SpawnTemplatePrefix, SpawnAliasPr
self.Grouping = nil -- No grouping.
self.SpawnInitLivery = nil -- No special livery.
self.SpawnInitSkill = nil -- No special skill.
self.SpawnInitFreq = nil -- No special frequency.
self.SpawnInitModu = nil -- No special modulation.
self.SpawnInitRadio = nil -- No radio comms setting.
self.SpawnGroups = {} -- Array containing the descriptions of each Group to be Spawned.
else
error( "There is no template provided for SpawnTemplatePrefix = '" .. SpawnTemplatePrefix .. "'" )
@@ -597,6 +606,42 @@ function SPAWN:InitSkill( Skill )
return self
end
--- Sets the radio comms on or off. Same as checking/unchecking the COMM box in the mission editor.
-- @param #SPAWN self
-- @param #number switch If true (or nil), enables the radio comms. If false, disables the radio for the spawned group.
-- @return #SPAWN self
function SPAWN:InitRadioCommsOnOff(switch)
self:F({switch=switch} )
self.SpawnInitRadio=switch or true
return self
end
--- Sets the radio frequency of the group.
-- @param #SPAWN self
-- @param #number frequency The frequency in MHz.
-- @return #SPAWN self
function SPAWN:InitRadioFrequency(frequency)
self:F({frequency=frequency} )
self.SpawnInitFreq=frequency
return self
end
--- Set radio modulation. Default is AM.
-- @param #SPAWN self
-- @param #string modulation Either "FM" or "AM". If no value is given, modulation is set to AM.
-- @return #SPAWN self
function SPAWN:InitRadioModulation(modulation)
self:F({modulation=modulation})
if modulation and modulation:lower()=="fm" then
self.SpawnInitModu=radio.modulation.FM
else
self.SpawnInitModu=radio.modulation.AM
end
return self
end
--- Randomizes the defined route of the SpawnTemplatePrefix group in the ME. This is very useful to define extra variation of the behaviour of groups.
-- @param #SPAWN self
@@ -1174,6 +1219,22 @@ function SPAWN:SpawnWithIndex( SpawnIndex )
end
end
-- Set radio comms on/off.
if self.SpawnInitRadio then
SpawnTemplate.communication=self.SpawnInitRadio
end
-- Set radio frequency.
if self.SpawnInitFreq then
SpawnTemplate.frequency=self.SpawnInitFreq
end
-- Set radio modulation.
if self.SpawnInitModu then
SpawnTemplate.modulation=self.SpawnInitModu
end
-- Set country, coaliton and categroy.
SpawnTemplate.CategoryID = self.SpawnInitCategory or SpawnTemplate.CategoryID
SpawnTemplate.CountryID = self.SpawnInitCountry or SpawnTemplate.CountryID