diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-001 - Spawned AI/AIB-001 - Spawned AI.lua b/Moose Test Missions/AIB - AI Balancing/AIB-001 - Spawned AI/AIB-001 - Spawned AI.lua index a3104d156..44b68cdb4 100644 --- a/Moose Test Missions/AIB - AI Balancing/AIB-001 - Spawned AI/AIB-001 - Spawned AI.lua +++ b/Moose Test Missions/AIB - AI Balancing/AIB-001 - Spawned AI/AIB-001 - Spawned AI.lua @@ -17,12 +17,12 @@ -- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base. -- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. -local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) +RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) -- Define the SPAWN object for the red AI plane template. -- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. -- If a blocked plane exists, this red plane will be ReSpawned. -local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) +RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) -- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. -local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) +RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua b/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua index 158a8f5ee..c0b085a92 100644 --- a/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua +++ b/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua @@ -17,15 +17,15 @@ -- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa. -- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. -local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) +RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) -- Define the SPAWN object for the red AI plane template. -- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. -- If a blocked plane exists, this red plane will be ReSpawned. -local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) +RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) -- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. -local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) +RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) local PatrolZones = {} diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.lua b/Moose Test Missions/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.lua index 222c56980..07efab0d0 100644 --- a/Moose Test Missions/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.lua +++ b/Moose Test Missions/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.lua @@ -22,15 +22,15 @@ -- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. -local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) +RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) -- Define the SPAWN object for the red AI plane template. -- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. -- If a blocked plane exists, this red plane will be ReSpawned. -local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) +RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) -- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. -local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) +RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) @@ -44,3 +44,4 @@ function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) Patrol:__Start( 5 ) end + diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.miz b/Moose Test Missions/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.miz index ce5fca1b6..8c681710a 100644 Binary files a/Moose Test Missions/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.miz and b/Moose Test Missions/AIB - AI Balancing/AIB-004 - Respawn Test when Destroyed/AIB-004 - Respawn Test when Destroyed.miz differ diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua b/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua index eab2c2e22..f0253d5e9 100644 --- a/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua +++ b/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua @@ -20,26 +20,26 @@ -- 6. Ensure that you see the AI patrol in one of the two zones ... -- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. -local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) +RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) -- Define the SPAWN object for the red AI plane template. -- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. -- If a blocked plane exists, this red plane will be ReSpawned. -local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) +RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) -- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. -local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) +RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) -- Create the first polygon zone ... -local PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" ) -local PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 ) +PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" ) +PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 ) -- Create the second polygon zone ... -local PatrolZoneGroup2 = GROUP:FindByName( "PatrolZone2" ) -local PatrolZone2 = ZONE_POLYGON:New( "PatrolZone2", PatrolZoneGroup2 ) +PatrolZoneGroup2 = GROUP:FindByName( "PatrolZone2" ) +PatrolZone2 = ZONE_POLYGON:New( "PatrolZone2", PatrolZoneGroup2 ) -- Now, create an array of these zones ... -local PatrolZoneArray = { PatrolZone1, PatrolZone2 } +PatrolZoneArray = { PatrolZone1, PatrolZone2 } function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.miz b/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.miz index e95443857..db0b03af1 100644 Binary files a/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.miz and b/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.miz differ diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua b/Moose Test Missions/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua index 1b604a94f..31574814d 100644 --- a/Moose Test Missions/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua +++ b/Moose Test Missions/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua @@ -19,19 +19,19 @@ -- 2. Play with the InitCleanUp API of the SPAWN class, extende the amount of seconds to find the optimal setting. -- Define the SET of CLIENTs from the red coalition. This SET is filled during startup. -local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) +RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ) -- Define the SPAWN object for the red AI plane template. -- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. -- If a blocked plane exists, this red plane will be ReSpawned. -local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) +RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) -- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. -local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) +RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) -- Create the first polygon zone ... -local PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" ) -local PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 ) +PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" ) +PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 ) function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-007 - AI Balancers For all airports and both coalitions/AIB-007 - AI Balancers For all airports and both coalitions.lua b/Moose Test Missions/AIB - AI Balancing/AIB-007 - AI Balancers For all airports and both coalitions/AIB-007 - AI Balancers For all airports and both coalitions.lua index a62960186..d6cc8a8f3 100644 --- a/Moose Test Missions/AIB - AI Balancing/AIB-007 - AI Balancers For all airports and both coalitions/AIB-007 - AI Balancers For all airports and both coalitions.lua +++ b/Moose Test Missions/AIB - AI Balancing/AIB-007 - AI Balancers For all airports and both coalitions/AIB-007 - AI Balancers For all airports and both coalitions.lua @@ -26,7 +26,7 @@ -- This zone array will be used in the AI_BALANCER to randomize the patrol -- zone that each spawned group will patrol -local RedPatrolZone = {} +RedPatrolZone = {} RedPatrolZone[1] = ZONE:New( "RedPatrolZone1" ) RedPatrolZone[2] = ZONE:New( "RedPatrolZone2" ) RedPatrolZone[3] = ZONE:New( "RedPatrolZone3" ) @@ -40,7 +40,7 @@ RedPatrolZone[6] = ZONE:New( "RedPatrolZone6" ) -- with replacing any CLIENT created aircraft in the mission that a human -- player does not take. -local RU_PlanesSpawn = {} +RU_PlanesSpawn = {} RU_PlanesSpawn[1] = SPAWN:New( "RU CAP Anapa AB" ):InitCleanUp( 45 ) RU_PlanesSpawn[2] = SPAWN:New( "RU CAP Beslan AB" ):InitCleanUp( 45 ) RU_PlanesSpawn[3] = SPAWN:New( "RU CAP Gelendzhik AB" ):InitCleanUp( 45 ) @@ -62,7 +62,7 @@ RU_PlanesSpawn[11] = SPAWN:New( "RU CAP Novorossiysk AB" ):InitCleanUp( 45 ) -- The code here does not need to be changed. Only an addition in the mission editor. An example -- of this can be found on the USA side at Sochi AB. -local RU_PlanesClientSet = {} +RU_PlanesClientSet = {} RU_PlanesClientSet[1] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Anapa AB") RU_PlanesClientSet[2] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Beslan AB") RU_PlanesClientSet[3] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Gelendzhik AB") @@ -84,7 +84,7 @@ RU_PlanesClientSet[11] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Novorossiysk -- of them are included to pick randomly. -local RU_AI_Balancer = {} +RU_AI_Balancer = {} for i=1, 11 do RU_AI_Balancer[i] = AI_BALANCER:New(RU_PlanesClientSet[i], RU_PlanesSpawn[i]) @@ -113,7 +113,7 @@ end -- leader. -- Create the Blue Patrol Zone Array -local BluePatrolZone = {} +BluePatrolZone = {} BluePatrolZone[1] = ZONE:New( "BluePatrolZone1") BluePatrolZone[2] = ZONE:New( "BluePatrolZone2") BluePatrolZone[3] = ZONE:New( "BluePatrolZone3") @@ -123,7 +123,7 @@ BluePatrolZone[6] = ZONE:New( "BluePatrolZone6") --United States CAP Aircraft (these are used as templates for AI) -local US_PlanesSpawn = {} +US_PlanesSpawn = {} US_PlanesSpawn[1] = SPAWN:New( "US CAP Batumi AB" ):InitCleanUp( 45 ) US_PlanesSpawn[2] = SPAWN:New( "US CAP Gudauta AB" ):InitCleanUp( 45 ) US_PlanesSpawn[3] = SPAWN:New( "US CAP Kobuleti AB" ):InitCleanUp( 45 ) @@ -137,7 +137,7 @@ US_PlanesSpawn[10] = SPAWN:New( "US CAP Tbilisi AB" ):InitCleanUp( 45 ) --United States Client Aircraft (via AI_BALANCER, AI will replace these if no human players are in the slot) -local US_PlanesClientSet = {} +US_PlanesClientSet = {} US_PlanesClientSet[1] = SET_CLIENT:New():FilterPrefixes("US CLIENT Batumi AB") US_PlanesClientSet[2] = SET_CLIENT:New():FilterPrefixes("US CLIENT Gudauta AB") US_PlanesClientSet[3] = SET_CLIENT:New():FilterPrefixes("US CLIENT Kobuleti AB") @@ -149,7 +149,7 @@ US_PlanesClientSet[8] = SET_CLIENT:New():FilterPrefixes("US CLIENT Sukhumi AB") US_PlanesClientSet[9] = SET_CLIENT:New():FilterPrefixes("US CLIENT Vaziani AB") US_PlanesClientSet[10] = SET_CLIENT:New():FilterPrefixes("US CLIENT Tbilisi AB") -local US_AI_Balancer = {} +US_AI_Balancer = {} for i=1, 10 do US_AI_Balancer[i] = AI_BALANCER:New( US_PlanesClientSet[i], US_PlanesSpawn[i] ) @@ -160,4 +160,4 @@ for i=1, 10 do Patrol:SetControllable( AIGroup ) Patrol:Start() end -end \ No newline at end of file +end