diff --git a/Moose Development/Moose/Spawn.lua b/Moose Development/Moose/Spawn.lua index 47768ecd5..581cf92ae 100644 --- a/Moose Development/Moose/Spawn.lua +++ b/Moose Development/Moose/Spawn.lua @@ -117,7 +117,7 @@ SPAWN = { -- Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ) -- @usage local Plane = SPAWN:New( "Plane" ) -- Creates a new local variable that can initiate new planes with the name "Plane#ddd" using the template "Plane" as defined within the ME. function SPAWN:New( SpawnTemplatePrefix ) - local self = BASE:Inherit( self, BASE:New() ) + local self = BASE:Inherit( self, BASE:New() ) -- #SPAWN self:F( { SpawnTemplatePrefix } ) local TemplateGroup = Group.getByName( SpawnTemplatePrefix ) @@ -1095,6 +1095,9 @@ function SPAWN:_RandomizeTemplate( SpawnIndex ) self.SpawnGroups[SpawnIndex].SpawnTemplate.start_time = self.SpawnTemplate.start_time for UnitID = 1, #self.SpawnGroups[SpawnIndex].SpawnTemplate.units do self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].heading = self.SpawnTemplate.units[1].heading + self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].x = self.SpawnTemplate.units[1].x + self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].y = self.SpawnTemplate.units[1].y + self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].alt = self.SpawnTemplate.units[1].alt end end diff --git a/Moose Development/Release Notes/2016-07 - ReleaseNotes.txt b/Moose Development/Release Notes/2016-07 - ReleaseNotes.txt index c4ceb7f4f..65b9d8a4b 100644 --- a/Moose Development/Release Notes/2016-07 - ReleaseNotes.txt +++ b/Moose Development/Release Notes/2016-07 - ReleaseNotes.txt @@ -1,3 +1,10 @@ +2016-08-03 + - Fixed error at SPAWN:RandomizeTemplate() + -- Units started in wrong x, y position (at the template, instead of at the master template of the SPAWN). + -- Adjusted x, y and alt to the start position of the first unit of the master template. + -- Added a test mission Moose_Test_SPAWN_RandomizeTemplate. + -- Regenerated MOOSE.lua + 2016-07-31 - Added a SpawnHeight parameter to the SPAWN method RandomizeRoute(), based upon a bug report of David. Air units will now also have optionally the route height randomized. diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 6c4bd658f..bffc3ce0e 100644 --- a/Moose Mission Setup/Moose.lua +++ b/Moose Mission Setup/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20160801_1851' ) +env.info( 'Moose Generation Timestamp: 20160803_2050' ) local base = _G Include = {} @@ -20554,7 +20554,7 @@ SPAWN = { -- Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ) -- @usage local Plane = SPAWN:New( "Plane" ) -- Creates a new local variable that can initiate new planes with the name "Plane#ddd" using the template "Plane" as defined within the ME. function SPAWN:New( SpawnTemplatePrefix ) - local self = BASE:Inherit( self, BASE:New() ) + local self = BASE:Inherit( self, BASE:New() ) -- #SPAWN self:F( { SpawnTemplatePrefix } ) local TemplateGroup = Group.getByName( SpawnTemplatePrefix ) @@ -21532,6 +21532,9 @@ function SPAWN:_RandomizeTemplate( SpawnIndex ) self.SpawnGroups[SpawnIndex].SpawnTemplate.start_time = self.SpawnTemplate.start_time for UnitID = 1, #self.SpawnGroups[SpawnIndex].SpawnTemplate.units do self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].heading = self.SpawnTemplate.units[1].heading + self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].x = self.SpawnTemplate.units[1].x + self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].y = self.SpawnTemplate.units[1].y + self.SpawnGroups[SpawnIndex].SpawnTemplate.units[UnitID].alt = self.SpawnTemplate.units[1].alt end end @@ -27547,7 +27550,7 @@ function PROCESS:OnStateChange( Fsm, Event, From, To ) end ---- This module contains the TASK_ASSIGN classes. +--- This module contains the PROCESS_ASSIGN classes. -- -- === -- @@ -29172,8 +29175,9 @@ end -- -- 1) @{#TASK_SEAD} class, extends @{Task#TASK_BASE} -- ================================================= --- The @{#TASK_SEAD} class defines a new SEAD task of a @{Set} of Target Units, located at a Target Zone, based on the tasking capabilities defined in @{Task#TASK_BASE}. --- The TASK_SEAD is processed through a @{Statemachine#STATEMACHINE_TASK}, and has the following statuses: +-- The @{#TASK_SEAD} class defines a SEAD task for a @{Set} of Target Units, located at a Target Zone, +-- based on the tasking capabilities defined in @{Task#TASK_BASE}. +-- The TASK_SEAD is implemented using a @{Statemachine#STATEMACHINE_TASK}, and has the following statuses: -- -- * **None**: Start of the process -- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Assign#PROCESS_ASSIGN_ACCEPT} is started to accept the task. @@ -29317,8 +29321,9 @@ end -- -- 1) @{#TASK_A2G} class, extends @{Task#TASK_BASE} -- ================================================= --- The @{#TASK_A2G} class defines a new CAS task of a @{Set} of Target Units, located at a Target Zone, based on the tasking capabilities defined in @{Task#TASK_BASE}. --- The TASK_A2G is processed through a @{Statemachine#STATEMACHINE_TASK}, and has the following statuses: +-- The @{#TASK_A2G} class defines a CAS or BAI task of a @{Set} of Target Units, +-- located at a Target Zone, based on the tasking capabilities defined in @{Task#TASK_BASE}. +-- The TASK_A2G is implemented using a @{Statemachine#STATEMACHINE_TASK}, and has the following statuses: -- -- * **None**: Start of the process -- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Assign#PROCESS_ASSIGN_ACCEPT} is started to accept the task. @@ -29330,7 +29335,7 @@ end -- -- ### Authors: FlightControl - Design and Programming -- --- @module Task_CAS +-- @module Task_A2G do -- TASK_A2G diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_RandomizeTemplate/MOOSE_Test_SPAWN_RandomizeTemplate.lua b/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_RandomizeTemplate/MOOSE_Test_SPAWN_RandomizeTemplate.lua new file mode 100644 index 000000000..0f20f3834 --- /dev/null +++ b/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_RandomizeTemplate/MOOSE_Test_SPAWN_RandomizeTemplate.lua @@ -0,0 +1,10 @@ +-- Tests Gudauta +-- -------------- +-- Limited spawning of groups, scheduled every 15 seconds, with RandomizeTemplate ... + +Templates = { "Template1", "Template2", "Template3", "Template4" } + +Spawn_Ground1 = SPAWN:New( "Spawn Vehicle1" ):Limit( 4, 20 ):RandomizeTemplate(Templates):SpawnScheduled( 15, 0 ) +Spawn_Ground2 = SPAWN:New( "Spawn Vehicle2" ):Limit( 4, 20 ):RandomizeTemplate(Templates):SpawnScheduled( 15, 0 ) + + diff --git a/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_RandomizeTemplate/MOOSE_Test_SPAWN_RandomizeTemplate.miz b/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_RandomizeTemplate/MOOSE_Test_SPAWN_RandomizeTemplate.miz new file mode 100644 index 000000000..574db1571 Binary files /dev/null and b/Moose Test Missions/Moose_Test_SPAWN/Moose_Test_SPAWN_RandomizeTemplate/MOOSE_Test_SPAWN_RandomizeTemplate.miz differ