mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2025-08-15 10:37:46 +00:00
Last step of bid folder restructure
This commit is contained in:
18
Functional/RAT/Caucasus/RAT-001 - Basic/RAT-001 - Basic.lua
Normal file
18
Functional/RAT/Caucasus/RAT-001 - Basic/RAT-001 - Basic.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
-- Name: RAT-001 - Basic
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn several aircraft at random airports on the map.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe five Yak-40 aircraft being spawned at random airports of the map and fly to random destination airports.
|
||||
-- After the aircraft arrive at their destination they get despawned and then respawned at a new random airport with new random destination.
|
||||
|
||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||
local yak=RAT:New("RAT_Yak")
|
||||
|
||||
-- Spawn five aircraft.
|
||||
yak:Spawn(5)
|
||||
BIN
Functional/RAT/Caucasus/RAT-001 - Basic/RAT-001 - Basic.miz
Normal file
BIN
Functional/RAT/Caucasus/RAT-001 - Basic/RAT-001 - Basic.miz
Normal file
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
-- Name: RAT-002 - Fixed Departure
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn several aircraft of the same type at Gudauta and let them travel to random airports on the map.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe five Yak-40 aircraft being spawned at Gudauta. Destination airport for each aircraft is random.
|
||||
-- After the aircraft arrive at their destination they get despawned and then respawned again at Gudauta. But the next destination is random again.
|
||||
|
||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||
local yak=RAT:New("RAT_Yak")
|
||||
|
||||
-- Set destination airport.
|
||||
yak:SetDeparture("Gudauta")
|
||||
|
||||
-- Spawn five aircraft.
|
||||
yak:Spawn(5)
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
-- Name: RAT-003 - Fixed Destination
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn several aircraft of the same type at random airports and let them all travel to Sochi-Adler.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe five Yak-40 aircraft being spawned at random airports. They will all fly to Sochi-Adler.
|
||||
-- After the aircraft arrive at their destination they get despawned and then respawned at a random aiport with destination Sochi-Adler.
|
||||
|
||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||
local yak=RAT:New("RAT_Yak")
|
||||
|
||||
-- Set destination airport.
|
||||
yak:SetDestination("Sochi-Adler")
|
||||
|
||||
-- Spawn five aircraft.
|
||||
yak:Spawn(5)
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
-- Name: RAT-004 - Fixed Departure and Destination
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn several aircraft of the same type at Guadauta or Batumi and make them fly to Gelendzhik or Beslan.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe five Yak-40 aircraft being spawned at Gudauta or Batumi. Their destination will be either Gelendzhik or Beslan.
|
||||
-- After the aircraft arrive at their destination they get despawned and then respawned again at one of the defined departure airports.
|
||||
-- Then they will travel to one of the defined destinations again.
|
||||
|
||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||
local yak=RAT:New("RAT_Yak")
|
||||
|
||||
-- Set destination airports. If multiple destinations are specified, they have to be given as a table, i.e. in curly brackets {}.
|
||||
yak:SetDeparture({"Gudauta", "Batumi"})
|
||||
|
||||
-- Set destination airports. One of these is chosen randomly as destination.
|
||||
yak:SetDestination({"Gelendzhik", "Beslan"})
|
||||
|
||||
-- Spawn five aircraft.
|
||||
yak:Spawn(5)
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,47 @@
|
||||
-- Name: RAT-005 - Restricted Coalition
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn several aircraft of the same type at airports belonging to a certain coalition.
|
||||
-- In the mission editor, we have set Sochi-Adler, Gelendzhik, Batumi, Senaki-Kolkhi and Kutaisi to red.
|
||||
-- Likewise, Tbilisi-Lochini, Beslan, Nalchik, Mozdok and Mineralnye-Vody were set to blue.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe three Yak-40 aircraft being spawned at red airports only. The will also only get destination airports belonging to that coalition.
|
||||
-- 2. Observe three Yak-40 being spawned at blue airports only. The coalition of the aircraft is changed manually.
|
||||
|
||||
-- Create RAT object. Additionally, to the template group name we give the group an alias to be able to distinguish to another group created from this template.
|
||||
local yak=RAT:New("RAT_Yak", "Yak Red")
|
||||
|
||||
-- This restricts the possible departure and destination airports the airports belonging to the red coalition.
|
||||
-- Here it is important that in the mission editor enough (>2) airports have been set to red! Otherwise there will be no possible departure and/or destination airports.
|
||||
yak:SetCoalition("sameonly")
|
||||
|
||||
-- Explicitly exclude Senaki from possible departures and destinations.
|
||||
yak:ExcludedAirports("Senaki-Kolkhi")
|
||||
|
||||
-- Spawn three aircraft.
|
||||
yak:Spawn(3)
|
||||
|
||||
|
||||
|
||||
-- Create RAT object. Alias is "Yak Blue". If the same template is used multiple times, it is important to give each RAT object an indiviual name!
|
||||
local yakblue=RAT:New("RAT_Yak", "Yak Blue")
|
||||
|
||||
-- Change coalition of Yak to blue.
|
||||
yakblue:SetCoalitionAircraft("blue")
|
||||
|
||||
-- This restricts the possible departure and destination airports the airports belonging to the blue coalition since the coalition is changed manually.
|
||||
yakblue:SetCoalition("sameonly")
|
||||
|
||||
-- We also change the livery of these groups. If a table of liveries is given, each spawned group gets a random livery.
|
||||
yakblue:Livery({"Georgian Airlines"})
|
||||
|
||||
-- Explicitly exclude Nalchik from possible departures and destinations.
|
||||
yakblue:ExcludedAirports({"Nalchik", "Mozdok"})
|
||||
|
||||
-- Spawn three aircraft.
|
||||
yakblue:Spawn(3)
|
||||
@@ -0,0 +1,25 @@
|
||||
-- Name: RAT-006 - Continue Journey
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn several aircraft of the same type at Gudauta. Each will get a random destination.
|
||||
-- Once the aircraft arrives at its destination, it will be respawned there and continue its journey to another random airport.
|
||||
-- Note that we do NOT have to set a departure airport.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe five Yak-40 aircraft being spawned at Gudauta. From there they will hop from airport to airport on the map.
|
||||
|
||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||
local yak=RAT:New("RAT_Yak")
|
||||
|
||||
-- Set Gudauta as departure airport for all spawned aircraft. (Not required for ContinueJourney() to work.)
|
||||
yak:SetDeparture("Gudauta")
|
||||
|
||||
-- This makes aircraft respawn at their destination airport instead of another random airport.
|
||||
yak:ContinueJourney()
|
||||
|
||||
-- Spawn five aircraft.
|
||||
yak:Spawn(5)
|
||||
Binary file not shown.
@@ -0,0 +1,31 @@
|
||||
-- Name: RAT-007 - Commute
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn several aircraft of the same type at Mozdok and let them fly to Mineralnye Vody.
|
||||
-- Once the aircraft arrives at its destination, it will be respawned there and fly back to Mozdok.
|
||||
-- Note that:
|
||||
-- We do NOT have to set a departure or destination airports. If we don't, the first departure and destination are random.
|
||||
-- Commute() also works for random destination and departure airports. But once they are chosen, aircraft will only commute between those.
|
||||
-- Also note that Commute() does NOT work with spawn in air since the departure airport is not defined then.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe two C-17A being spawned at Mozdok and fly back and forth between Mozdok and Mineralnye Vody until the end of time.
|
||||
|
||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||
local c17=RAT:New("RAT_C17")
|
||||
|
||||
-- Set Gudauta as departure airport.
|
||||
c17:SetDeparture("Mozdok")
|
||||
|
||||
-- Set Mineralnye Vody as destination.
|
||||
c17:SetDestination("Mineralnye Vody")
|
||||
|
||||
-- This makes aircraft respawn at their destination airport and fly back to its departure. Hence, departure cannot be in air.
|
||||
c17:Commute()
|
||||
|
||||
-- Spawn two aircraft.
|
||||
c17:Spawn(2)
|
||||
BIN
Functional/RAT/Caucasus/RAT-007 - Commute/RAT-007 - Commute.miz
Normal file
BIN
Functional/RAT/Caucasus/RAT-007 - Commute/RAT-007 - Commute.miz
Normal file
Binary file not shown.
@@ -0,0 +1,53 @@
|
||||
-- Name: RAT-008 - Spawn in Air
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn several aircraft above airports or at zones pre-defined in the mission editor.
|
||||
-- Note that if takeoff is set to air:
|
||||
-- Airports are treated like zones with a certain radius.
|
||||
-- Spawn happens at a random point anywhere within the zone.
|
||||
--
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Obsever ten Yak-40 being spawned in air near random airports of the map.
|
||||
-- 2. Observe five C-17A being spawned within Zones "RAT Zone West", and "RAT Zone North".
|
||||
-- 3. Observe eight IL76 being spawned within RAT Zone North or somewhere near Anapa Vityazevo airport.
|
||||
|
||||
|
||||
-- Create RAT object from Yak-40 template.
|
||||
local yak=RAT:New("RAT_YAK")
|
||||
|
||||
-- Set takeoff type to air.
|
||||
yak:SetTakeoff("air")
|
||||
|
||||
-- Spawn ten Yak-40s.
|
||||
yak:Spawn(10)
|
||||
|
||||
|
||||
-- Create RAT object from C-17A template.
|
||||
local c17=RAT:New("RAT_C17")
|
||||
|
||||
-- Set takeoff type to air.
|
||||
c17:SetTakeoff("air")
|
||||
|
||||
-- Set departure zones for C-17.
|
||||
c17:SetDeparture({"RAT Zone West", "RAT Zone South"})
|
||||
|
||||
-- Spawn five C-17s.
|
||||
c17:Spawn(5)
|
||||
|
||||
|
||||
-- Create RAT object from IL76 template.
|
||||
local il76=RAT:New("RAT_IL76")
|
||||
|
||||
-- Set takeoff type to air.
|
||||
il76:SetTakeoff("air")
|
||||
|
||||
-- Set departure zones for C-17. You can mix zone names and airport names.
|
||||
il76:SetDeparture({"RAT Zone North", "Anapa-Vityazevo"})
|
||||
|
||||
-- Spawn eight C-17s.
|
||||
il76:Spawn(8)
|
||||
Binary file not shown.
@@ -0,0 +1,46 @@
|
||||
-- Name: RAT-009 - Set Cruise Altitude
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn several aircraft randomly but make them fly at certain cruise altitudes.
|
||||
-- In the first example we specify the flight level, i.e. the altitude above sea level in hundreds of meters.
|
||||
-- There are also methods to set the cruise altitude in meters. These are used in the second example.
|
||||
--
|
||||
-- Note that when setting a lower bound for the cruise altitude, this automatically adjusts the minimum distance to possible destinations, since the aircraft must have enough time to climb to that alt and descent again to the destination.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet.
|
||||
-- Most aircraft will travel at or near 10,000 ft.
|
||||
-- 2. Observe two C-17 being spawned at Tbilisi-Lochini. They will travel to a random destination but the cruise alt is set to be > 5 km.
|
||||
|
||||
|
||||
-- Create RAT object from Yak-40 template.
|
||||
local yak=RAT:New("RAT_YAK")
|
||||
|
||||
-- Set the minimum flight level. No aircaft will travel below this altitude.
|
||||
yak:SetFLmin(50)
|
||||
|
||||
-- Set maximum flight level to 20,000 ft ASL. No aircraft will be assigned a cruise flight level above this altitude.
|
||||
yak:SetFLmax(200)
|
||||
|
||||
-- Set cruise flight level to 10,000 ft. The final choise is random between FLmin and FLmax, but morst aircraft will travel at his or near this altitude.
|
||||
yak:SetFLcruise(100)
|
||||
|
||||
-- Spawn five Yak-40s.
|
||||
yak:Spawn(5)
|
||||
|
||||
|
||||
-- Create RAT object from C-17A template.
|
||||
local c17=RAT:New("RAT_C17")
|
||||
|
||||
-- Set departure zones for C-17.
|
||||
c17:SetDeparture("Tbilisi-Lochini")
|
||||
|
||||
-- All aircraft will fly at least at a height of 5 km ASL.
|
||||
c17:SetMinCruiseAltitude(5000)
|
||||
|
||||
-- Spawn two C-17s.
|
||||
c17:Spawn(2)
|
||||
Binary file not shown.
@@ -0,0 +1,67 @@
|
||||
-- Name: RAT-010 - Helo FARP and Ship
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 23 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn helos at FARPS or ships.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet.
|
||||
|
||||
-- Create RAT object from Huey template.
|
||||
local huey1=RAT:New("RAT_HUEY", "Huey Berlin")
|
||||
|
||||
-- Huey departing from FARP Berlin.
|
||||
huey1:SetDeparture({"FARP Berlin"})
|
||||
|
||||
-- Flying to Normandy.
|
||||
huey1:SetDestination({"Normandy"})
|
||||
|
||||
-- Take-off with engines on.
|
||||
huey1:SetTakeoff("hot")
|
||||
|
||||
-- Huey will respawn at Normandy and fly back to FARP Berlin.
|
||||
huey1:Commute()
|
||||
|
||||
-- Huey will be spawned.
|
||||
huey1:Spawn()
|
||||
|
||||
|
||||
-- Create RAT object from Huey template.
|
||||
local huey2=RAT:New("RAT_HUEY", "Huey London")
|
||||
|
||||
-- Huey departing from FARP London.
|
||||
huey2:SetDeparture({"FARP London"})
|
||||
|
||||
-- Flying to Normandy.
|
||||
huey2:SetDestination({"Normandy"})
|
||||
|
||||
-- Take-off with engines on.
|
||||
huey2:SetTakeoff("hot")
|
||||
|
||||
-- Huey will respawn at Normandy and fly back to FARP London.
|
||||
huey2:Commute()
|
||||
|
||||
-- Huey will be spawned.
|
||||
huey2:Spawn()
|
||||
|
||||
|
||||
-- Create RAT object from Huey template.
|
||||
local huey3=RAT:New("RAT_HUEY", "Huey Anapa")
|
||||
|
||||
-- Huey departing from FARP London.
|
||||
huey3:SetDeparture({"FARP London", "FARP Berlin", "Anapa-Vityazevo"})
|
||||
|
||||
-- Flying to Normandy.
|
||||
huey3:SetDestination({"FARP London", "FARP Berlin", "Anapa-Vityazevo"})
|
||||
|
||||
-- Take-off with engines on.
|
||||
huey3:SetTakeoff("hot")
|
||||
|
||||
-- Huey will continue its journey.
|
||||
huey3:ContinueJourney()
|
||||
|
||||
-- Huey will be spawned.
|
||||
huey3:Spawn()
|
||||
Binary file not shown.
@@ -0,0 +1,43 @@
|
||||
-- Name: RAT-011 - Carrier Ops
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Spawn aircraft flying to and from aircraft carriers
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe two SU-33 taking of from Novorossiysk and fly to the Kuznetsov.
|
||||
-- 2. Observe two F-14A taking of from the Carl Vinson flying into Batumi.
|
||||
|
||||
-- Create RAT object from Su-33 template.
|
||||
local su33=RAT:New("RAT_SU33")
|
||||
|
||||
-- Huey departing from FARP Berlin.
|
||||
su33:SetDeparture({"Novorossiysk"})
|
||||
|
||||
-- Flying to Normandy.
|
||||
su33:SetDestination({"Kuznetsov"})
|
||||
|
||||
-- Take-off with engines on.
|
||||
su33:SetTakeoff("hot")
|
||||
|
||||
-- Spawn two aircraft.
|
||||
su33:Spawn(2)
|
||||
|
||||
|
||||
-- Create RAT object from Su-33 template.
|
||||
local f14=RAT:New("RAT_F14")
|
||||
|
||||
-- Huey departing from FARP Berlin.
|
||||
f14:SetDeparture({"Carl Vinson"})
|
||||
|
||||
-- Flying to Normandy.
|
||||
f14:SetDestination({"Batumi"})
|
||||
|
||||
-- Take-off with engines on.
|
||||
f14:SetTakeoff("hot")
|
||||
|
||||
-- Spawn two aircraft.
|
||||
f14:Spawn(2)
|
||||
Binary file not shown.
@@ -0,0 +1,76 @@
|
||||
---
|
||||
-- Name: RAT-010 - Traffic at McCarran International
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
-- Updated: 10 Oct 2023
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- We want to generate some random air traffic at McCarran International Airport.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. KC-135 aircraft are spawned at zones north and east heading to McCarran.
|
||||
-- 2. E-3A aircraft are spawned at McCarran with random destinations.
|
||||
-- 3. Yak-40 aircraft are spawned at random airports heading for McCarran.
|
||||
-- 3. TF-51D aircraft are spawned at Henderson, Boulder City or Echo Bay heading for McCarran.
|
||||
|
||||
-- Create RAT object from KC-135 template.
|
||||
local kc135=RAT:New("RAT_KC135")
|
||||
|
||||
kc135:SetCoalition("same")
|
||||
|
||||
-- Set departure zones. We need takeoff "air" for that.
|
||||
kc135:SetDeparture({"RAT Zone North", "RAT Zone East"})
|
||||
|
||||
-- Set spawn in air.
|
||||
kc135:SetTakeoff("air")
|
||||
|
||||
-- Aircraft will fly to McCarran
|
||||
kc135:SetDestination(AIRBASE.Nevada.McCarran_International_Airport)
|
||||
|
||||
-- Spawn two aircraft.
|
||||
kc135:Spawn(2)
|
||||
|
||||
|
||||
-- Create RAT object from E-3A template.
|
||||
local e3=RAT:New("RAT_E3")
|
||||
|
||||
e3:SetCoalition("same")
|
||||
|
||||
-- Aircraft are spawned at McCarran. Destinations are random.
|
||||
e3:SetDeparture(AIRBASE.Nevada.McCarran_International_Airport)
|
||||
|
||||
-- Enable respawn after landing with a delay of six minutes.
|
||||
e3:RespawnAfterLanding(360)
|
||||
|
||||
-- Spawn two aircraft.
|
||||
e3:Spawn(2)
|
||||
|
||||
|
||||
-- Create RAT object from Yak-40 template.
|
||||
local yak=RAT:New("RAT_YAK")
|
||||
|
||||
-- These are the airports a Yak-40 gets a parking slot.
|
||||
yak:SetDeparture({AIRBASE.Nevada.Tonopah_Airport, AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Henderson_Executive_Airport, AIRBASE.Nevada.Nellis_AFB, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Laughlin_Airport})
|
||||
|
||||
-- Destination McCarran.
|
||||
yak:SetDestination(AIRBASE.Nevada.McCarran_International_Airport)
|
||||
|
||||
-- Spawn eight Yak-40.
|
||||
yak:Spawn(8)
|
||||
|
||||
|
||||
-- Create RAT object from E-3A template.
|
||||
local tf51=RAT:New("RAT_TF51")
|
||||
|
||||
tf51:SetCoalition("same")
|
||||
|
||||
-- Departure airport will be chosen from this list.
|
||||
tf51:SetDeparture({AIRBASE.Nevada.Henderson_Executive_Airport, AIRBASE.Nevada.Boulder_City_Airport, AIRBASE.Nevada.Echo_Bay})
|
||||
|
||||
-- All will fly to McCarran.
|
||||
tf51:SetDestination(AIRBASE.Nevada.McCarran_International_Airport)
|
||||
|
||||
-- Spawn four TF-51D
|
||||
tf51:Spawn(4)
|
||||
Binary file not shown.
@@ -0,0 +1,101 @@
|
||||
---
|
||||
-- Name: RAT-011 - Traffic at Nellis AFB
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 24 Sep 2017
|
||||
-- Updated: 10 Oct 2023
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- We want to generate some random air traffic at Nellis AFB.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. F-15C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech.
|
||||
-- 2. A-10C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech.
|
||||
-- 3. F/A-18C are spawned at Tonopah, Groom Lake or Creech and fly to Nellis.
|
||||
-- 4. KC-135 are spawned in air at two zones heading for Nellis.
|
||||
|
||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Create RAT object from F-15C template.
|
||||
local f15=RAT:New("RAT_F15C")
|
||||
|
||||
-- Departure Nellis.
|
||||
f15:SetDeparture(AIRBASE.Nevada.Nellis_AFB)
|
||||
f15:SetCoalition("same")
|
||||
|
||||
-- Destination Tonopah, Groom Lake or Creech.
|
||||
f15:SetDestination({AIRBASE.Nevada.Tonopah_Airport, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB})
|
||||
|
||||
-- Spawn three flights.
|
||||
f15:Spawn(3)
|
||||
|
||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local a10=RAT:New("RAT_A10C")
|
||||
|
||||
-- Departure Nellis.
|
||||
a10:SetDeparture(AIRBASE.Nevada.Nellis_AFB)
|
||||
a10:SetCoalition("same")
|
||||
|
||||
-- Destination Tonopa, Groom Lake or Creech.
|
||||
a10:SetDestination({AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB})
|
||||
|
||||
-- Spawning will happen 60 seconds after mission start.
|
||||
a10:SetSpawnDelay(60)
|
||||
|
||||
-- Spawn three flights.
|
||||
a10:Spawn(3)
|
||||
|
||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Creat RAT object from F/A-18C template.
|
||||
local f18=RAT:New("RAT_F18C")
|
||||
f18:SetCoalition("same")
|
||||
|
||||
-- Departure airports.
|
||||
f18:SetDeparture({AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB})
|
||||
|
||||
-- Destination Nellis.
|
||||
f18:SetDestination(AIRBASE.Nevada.Nellis_AFB)
|
||||
|
||||
-- Spawn three flights.
|
||||
f18:Spawn(3)
|
||||
|
||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Create RAT object from KC-135 template.
|
||||
local kc135=RAT:New("RAT_KC135")
|
||||
|
||||
-- Set departure zones. We need takeoff "air" for that.
|
||||
kc135:SetDeparture({"RAT Zone North", "RAT Zone East"})
|
||||
|
||||
-- Set spawn in air.
|
||||
kc135:SetTakeoff("air")
|
||||
|
||||
-- Aircraft will fly to McCarran
|
||||
kc135:SetDestination(AIRBASE.Nevada.Nellis_AFB)
|
||||
|
||||
-- Spawning of aircraft will happen in 2 minute intervalls.
|
||||
kc135:SetSpawnInterval(120)
|
||||
|
||||
-- Spawn two aircraft.
|
||||
kc135:Spawn(2)
|
||||
|
||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Store time at mission start
|
||||
local T0=timer.getTime()
|
||||
|
||||
-- Send message with current misson time to all coalisions
|
||||
local function print_mission_time()
|
||||
local Tnow=timer.getTime()
|
||||
local mission_time=Tnow-T0
|
||||
local mission_time_minutes=mission_time/60
|
||||
local mission_time_seconds=mission_time%60
|
||||
local text=string.format("Mission Time: %i:%02d", mission_time_minutes,mission_time_seconds)
|
||||
MESSAGE:New(text, 5):ToAll()
|
||||
end
|
||||
|
||||
-- Start scheduler to report mission time.
|
||||
local Scheduler_Mission_Time = SCHEDULER:New(nil, print_mission_time, {}, 0, 10)
|
||||
Binary file not shown.
@@ -0,0 +1,85 @@
|
||||
-- Name: RAT-020 - WWII Scenario
|
||||
-- Author: funkyfranky
|
||||
-- Date Created: 16 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- We want to generate some random air traffic of WWII units in 1944 Normandy.
|
||||
-- In the mission editor we have defined a couple of red and blue airfields.
|
||||
-- Germans are located to the east while the allies hold the western airfiels and those of southern England.
|
||||
-- Note that the default setting of the RAT aircraft is to hold their weapons and to ignore enemy threads.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Four two-ship flights of Bf-109 get random routes restricted to red airfields.
|
||||
-- 2. Two two-ship flights of FW-190 similar to the Bf-109s.
|
||||
-- 3. Three two-ship flights of TF-51 get random routes restricted to blue airfields.
|
||||
-- 4. Two two-ship flights of Spitfires are set up analogously to the TF-51
|
||||
-- 5. One two-ship flight of Spitfires is explicitly ordered to fly back and forth across the channel.
|
||||
|
||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Create RAT object from Bf-109 template.
|
||||
local bf109=RAT:New("RAT_Bf109")
|
||||
|
||||
-- Airports are restricted to red.
|
||||
bf109:SetCoalition("sameonly")
|
||||
|
||||
-- Spawn four Bf-109.
|
||||
bf109:Spawn(4)
|
||||
|
||||
-- Create RAT object from FW-190 template.
|
||||
local fw190=RAT:New("RAT_Fw190")
|
||||
|
||||
-- Again, airports restricted to red.
|
||||
fw190:SetCoalition("sameonly")
|
||||
|
||||
-- Spawn two FW-190.
|
||||
fw190:Spawn(2)
|
||||
|
||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Create RAT object from TF-51 template.
|
||||
local tf51=RAT:New("RAT_TF-51")
|
||||
|
||||
-- Allow only blue airports for departure and destination.
|
||||
tf51:SetCoalition("sameonly")
|
||||
|
||||
-- We exclude ever airport across the channel.
|
||||
tf51:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"})
|
||||
|
||||
-- Spawn three TF-51.
|
||||
tf51:Spawn(3)
|
||||
|
||||
|
||||
-- Creat RAT object from Spitfire template.
|
||||
local spit=RAT:New("RAT_Spit")
|
||||
|
||||
-- Blue airports only.
|
||||
spit:SetCoalition("sameonly")
|
||||
|
||||
-- We exclude ever airport across the channel.
|
||||
spit:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"})
|
||||
|
||||
-- Spawn two two-ship flights.
|
||||
spit:Spawn(2)
|
||||
|
||||
-- Create RAT object from Spitfire template.
|
||||
-- NOTE that since we have already used this template, we need to give it another name.
|
||||
-- This is done by the second parameter, which is the alias name for RAT aircraft.
|
||||
-- In particular, this will be the name given in the F10 Menu.
|
||||
-- IMPORTANT: It is no problem to reuse the same template multiple times. But each template must get its own alias!
|
||||
local spit_commute=RAT:New("RAT_Spit", "RAT_Spit_Commute")
|
||||
|
||||
-- These Spitfires get the order fly across the channel and to commute between Chailey and Le Molay.
|
||||
spit_commute:SetDeparture("Chailey")
|
||||
spit_commute:SetDestination("Le Molay")
|
||||
spit_commute:Commute()
|
||||
|
||||
-- Set another livery for these aircraft.
|
||||
spit_commute:Livery("RAF, No. 126 Squadron, Harrowbeer")
|
||||
|
||||
-- Spawn one two-ship flight.
|
||||
spit_commute:Spawn()
|
||||
|
||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Binary file not shown.
@@ -0,0 +1,38 @@
|
||||
---
|
||||
-- Name: SCO-100 - Scoring Demo
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and units located near the airport, and shoot them.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
|
||||
|
||||
|
||||
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
||||
|
||||
CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )
|
||||
|
||||
Scoring = SCORING:New( "Shooting Range 1" )
|
||||
|
||||
Scoring:SetScaleDestroyScore( 10 )
|
||||
|
||||
Scoring:SetScaleDestroyPenalty( 40 )
|
||||
|
||||
Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 )
|
||||
|
||||
-- Test for zone scores.
|
||||
|
||||
-- This one is to test scoring on normal units.
|
||||
ShootingRangeZone = ZONE:New( "ScoringZone1" )
|
||||
Scoring:AddZoneScore( ShootingRangeZone, 200 )
|
||||
|
||||
-- This one is to test scoring on scenery.
|
||||
-- Note that you can only destroy scenery with heavy weapons.
|
||||
SceneryZone = ZONE:New( "ScoringZone2" )
|
||||
Scoring:AddZoneScore( SceneryZone, 200 )
|
||||
|
||||
Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 )
|
||||
Binary file not shown.
@@ -0,0 +1,21 @@
|
||||
---
|
||||
-- Name: SCO-101 - Scoring Client to Client
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A shooting range has been setup to test client to client scoring.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the scoring granted to your flight when you hit and kill other clients.
|
||||
|
||||
|
||||
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
||||
|
||||
CommandCenter = COMMANDCENTER:New( HQ, "Lima" )
|
||||
|
||||
Scoring = SCORING:New( "Detect Demo" )
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,41 @@
|
||||
---
|
||||
-- Name: SCO-200 - Telemetry
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and objects located near the airport, and shoot them.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
|
||||
-- 2. Check the scoring telemetry communicated to the website.
|
||||
|
||||
|
||||
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
||||
|
||||
CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )
|
||||
|
||||
Scoring = SCORING:New( "Shooting Range 1" )
|
||||
|
||||
Scoring:SetTelemetryServer( "96.49.78.227", 5010 )
|
||||
|
||||
Scoring:SetScaleDestroyScore( 10 )
|
||||
|
||||
Scoring:SetScaleDestroyPenalty( 40 )
|
||||
|
||||
Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 )
|
||||
|
||||
-- Test for zone scores.
|
||||
|
||||
-- This one is to test scoring on normal units.
|
||||
ShootingRangeZone = ZONE:New( "ScoringZone1" )
|
||||
Scoring:AddZoneScore( ShootingRangeZone, 200 )
|
||||
|
||||
-- This one is to test scoring on scenery.
|
||||
-- Note that you can only destroy scenery with heavy weapons.
|
||||
SceneryZone = ZONE:New( "ScoringZone2" )
|
||||
Scoring:AddZoneScore( SceneryZone, 200 )
|
||||
|
||||
Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 )
|
||||
BIN
Functional/Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.miz
Normal file
BIN
Functional/Scoring/SCO-200 - Telemetry/SCO-200 - Telemetry.miz
Normal file
Binary file not shown.
@@ -0,0 +1,139 @@
|
||||
---
|
||||
-- Name: SCO-500 - Scoring Multi Player Demo Mission 1
|
||||
-- Author: Pikey and FlightControl
|
||||
-- Date Created: 1 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A demo mission for the scoring. Read the briefing and have fun.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
|
||||
|
||||
-- Define the patrol zones
|
||||
BlueCapZone = ZONE_POLYGON:New( "BlueCapZone", GROUP:FindByName( "Blue CAP Zone Patrol" ) )
|
||||
RedCapZone = ZONE_POLYGON:New( "RedCapZone", GROUP:FindByName( "Red CAP Zone Patrol" ) )
|
||||
|
||||
-- Define the engage zones
|
||||
BlueEngageZone = ZONE_POLYGON:New( "BlueEngageZone", GROUP:FindByName( "Blue CAP Zone Engage" ) )
|
||||
RedEngageZone = ZONE_POLYGON:New( "RedEngageZone", GROUP:FindByName( "Red CAP Zone Engage" ) )
|
||||
|
||||
-- Define the Spawn zones for ground vehicles
|
||||
BlueSpawnGroundZone = ZONE_POLYGON:New( "BlueSpawnGroundZone", GROUP:FindByName( "Blue Spawn Zone" ) )
|
||||
--RedSpawnGroundZone = ZONE_POLYGON:New( "RedSpawnGroundZone", GROUP:FindByName( "Red Spawn Zone" ) )
|
||||
|
||||
RedSpawnGroundZone = ZONE:New( "Red Spawn Zone" )
|
||||
|
||||
-- Define the Scoring zones that define the shelters
|
||||
BlueShelterZone = ZONE_POLYGON:New( "Blue Shelters", GROUP:FindByName( "Blue Shelters" ) )
|
||||
RedShelterZone = ZONE_POLYGON:New( "Red Shelters", GROUP:FindByName( "Red Shelters" ) )
|
||||
|
||||
-- Define the Set of Clients that are used for the AI Balancers
|
||||
BluePlanesClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterCategories( "plane" ):FilterPrefixes( "Blue Player")
|
||||
RedPlanesClientSet = SET_CLIENT:New():FilterCoalitions( "red" ):FilterCategories( "plane" ):FilterPrefixes( "Red Player")
|
||||
|
||||
-- Define the Spawn objects for the AI planes
|
||||
BluePlanesSpawn = SPAWN:New( "BlueAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 )
|
||||
RedPlanesSpawn = SPAWN:New( "RedAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 )
|
||||
|
||||
-- Define the AI Balancers for the planes
|
||||
BlueAIB = AI_BALANCER:New( BluePlanesClientSet, BluePlanesSpawn ):InitSpawnInterval( 60, 1200 )
|
||||
RedAIB = AI_BALANCER:New( RedPlanesClientSet, RedPlanesSpawn ):InitSpawnInterval( 60, 1200 )
|
||||
|
||||
-- Define the Spawn objects for the airbase defenses
|
||||
BlueAirbaseDefense1Spawn = SPAWN:New( "Blue Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 )
|
||||
BlueAirbaseDefense2Spawn = SPAWN:New( "Blue Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 )
|
||||
RedAirbaseDefense1Spawn = SPAWN:New( "Red Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 )
|
||||
RedAirbaseDefense2Spawn = SPAWN:New( "Red Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 )
|
||||
|
||||
-- Define the ground forces spawning engines...
|
||||
|
||||
-- First define the template arrays.
|
||||
BlueGroundTemplates = { "Blue Ground Forces 1", "Blue Ground Forces 2", "Blue Ground Forces 3" }
|
||||
RedGroundTemplates = { "Red Ground Forces 2", "Red Ground Forces 2", "Red Ground Forces 3" }
|
||||
|
||||
-- New we are using these templates to define the spawn objects for the ground forces.
|
||||
-- We spawn them at random places into the define zone.
|
||||
BlueGroundSpawn = SPAWN
|
||||
:New( "Blue Ground Forces" )
|
||||
:InitLimit( 12, 30 )
|
||||
:InitRandomizeZones( { BlueSpawnGroundZone } )
|
||||
:InitRandomizeTemplate( BlueGroundTemplates )
|
||||
:SpawnScheduled( 60, 0.2 )
|
||||
|
||||
RedGroundSpawn = SPAWN
|
||||
:New( "Red Ground Forces" )
|
||||
:InitLimit( 12, 30 )
|
||||
:InitRandomizeTemplate( RedGroundTemplates )
|
||||
:InitRandomizeZones( { RedSpawnGroundZone } )
|
||||
:SpawnScheduled( 60, 0.2 )
|
||||
|
||||
|
||||
|
||||
BlueCap = {}
|
||||
RedCap = {}
|
||||
|
||||
-- Define the OnAfterSpawned events of the AI balancer Spawn Groups
|
||||
function BlueAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
if AIGroup then
|
||||
BlueCap[AIGroup] = BlueCap[AIGroup] or AI_CAP_ZONE:New( BlueCapZone, 500, 3000, 450, 1200 )
|
||||
local Cap = BlueCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE
|
||||
|
||||
Cap:ManageFuel( 0.4, 180 )
|
||||
Cap:SetEngageZone( BlueEngageZone )
|
||||
Cap:SetControllable( AIGroup )
|
||||
Cap:Start()
|
||||
end
|
||||
end
|
||||
|
||||
function RedAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||
|
||||
if AIGroup then
|
||||
RedCap[AIGroup] = RedCap[AIGroup] or AI_CAP_ZONE:New( RedCapZone, 500, 3000, 450, 1200 )
|
||||
local Cap = RedCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE
|
||||
|
||||
Cap:ManageFuel( 0.4, 180 )
|
||||
Cap:SetEngageZone( BlueEngageZone )
|
||||
Cap:SetControllable( AIGroup )
|
||||
Cap:Start()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
-- Okay, now that we defined all this stuff, now make the SCORING setup ...
|
||||
|
||||
-- First define a Scoring object
|
||||
local Scoring = SCORING:New( "SCO-500 - Scoring Demonstration Mission" )
|
||||
|
||||
-- Define within the scoring the shelter designated targets.
|
||||
Scoring:AddZoneScore( BlueShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted.
|
||||
Scoring:AddZoneScore( RedShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted.
|
||||
|
||||
-- Define the static objects that give extra scores
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 1"), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 2"), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 3"), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 4"), 100 )
|
||||
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #001"), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #002"), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #003"), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #004"), 80 )
|
||||
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 1" ), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 2" ), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 3" ), 100 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 4" ), 100 )
|
||||
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #001" ), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #002" ), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #003" ), 80 )
|
||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #004" ), 80 )
|
||||
|
||||
-- Scale the scoring rewarded.
|
||||
Scoring:SetScaleDestroyScore( 30 )
|
||||
Scoring:SetScaleDestroyPenalty( 90 ) -- Penalties are punished more than normal destroys.
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
|
||||
-- CCCP SEAD Defenses
|
||||
SEAD_RU_SAM_Defenses = SEAD
|
||||
:New(
|
||||
{ 'SAM Test'
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
-------------------------------------------------------------------------
|
||||
-- SRD-100 - SHORAD - Basic Demo
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- SHORAD: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/tbd
|
||||
--
|
||||
-- Note: As of Feb/21, SHORAD is WIP. Needs a recent build of Moose.lua => 2.5.3
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set of Red SAM sites being attacked by Blue SEAD and Helicopters.
|
||||
-- Red SHORAD systems will be switched on for 10 minutes to defend against
|
||||
-- HARMSs and AGMs.
|
||||
-- Red SAMs will try to evade HARMs fired at them.
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 16 Feb 2021
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart()
|
||||
-- usage: SHORAD:New(name, prefix, samset, radius, time, coalition)
|
||||
myshorad = SHORAD:New("BlueShorad", "Blue SHORAD", SamSet, 22000, 600, "blue")
|
||||
myshorad:SwitchDebug(true)
|
||||
|
||||
-- optional - make SAMs evasive (that is, if they can move)
|
||||
mysead = SEAD:New("Blue SAM")
|
||||
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
-------------------------------------------------------------------------
|
||||
-- SRD-110 - SHORAD - Integrate with Mantis
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- SHORAD: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/tbd
|
||||
--
|
||||
-- Note: As of Feb/21, SHORAD is WIP. Needs a recent build of Moose.lua => 2.5.3
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set of Red SAM sites being attacked by Blue SEAD and Helicopters.
|
||||
-- Red SHORAD systems will be switched on for 10 minutes to defend against
|
||||
-- HARMSs and AGMs.
|
||||
-- Red SAMs will try to evade HARMs fired at them.
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 16 Feb 2021
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart()
|
||||
-- usage: SHORAD:New(name, prefix, samset, radius, time, coalition)
|
||||
myshorad = SHORAD:New("BlueShorad", "Blue SHORAD", SamSet, 22000, 600, "blue")
|
||||
myshorad:SwitchDebug(true)
|
||||
|
||||
mymantis = MANTIS:New("BlueMantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs")
|
||||
mymantis:AddShorad(myshorad,720)
|
||||
mymantis:Start()
|
||||
Binary file not shown.
@@ -0,0 +1,36 @@
|
||||
-------------------------------------------------------------------------
|
||||
-- SRD-120 - SHORAD - Integrate with Detection
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- SHORAD: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Shorad.html
|
||||
--
|
||||
-- Note: As of Feb/21, SHORAD is WIP. Needs a recent build of Moose.lua => 2.5.3
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set Red High-Value-Target (HVT) being attacked by Blue CAS.
|
||||
-- Red SHORAD systems will be switched on for 10 minutes to defend against
|
||||
-- HARMSs and AGMs.
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 17 Feb 2021
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
local SamSet = SET_GROUP:New():FilterPrefixes("Red HVT"):FilterCoalitions("red"):FilterStart()
|
||||
-- usage: SHORAD:New(name, prefix, samset, radius, time, coalition)
|
||||
myshorad = SHORAD:New("RedShorad", "Red SHORAD", SamSet, 22000, 600, "red")
|
||||
myshorad:SwitchDebug(true)
|
||||
|
||||
local dectset = SET_GROUP:New():FilterPrefixes("Red EWR"):FilterCoalitions("red"):FilterStart()
|
||||
local detection = DETECTION_AREAS:New(dectset,1000)
|
||||
detection:SetRefreshTimeInterval(15)
|
||||
detection:SetAcceptZones(ZONE:New("Red HVT Zone")) -- defense zone around our HVT
|
||||
detection:Start()
|
||||
|
||||
-- wake up SHORAD when we detect an attacker
|
||||
function detection:OnAfterDetected(From,Event,To,Units)
|
||||
for _,_unit in pairs (Units) do
|
||||
local text = string.format("Unit detected: %s",_unit:GetName())
|
||||
local m = MESSAGE:New(text,10,"Info"):ToAll()
|
||||
end
|
||||
myshorad:WakeUpShorad("Red SHORAD", 25000, 600)
|
||||
end
|
||||
Binary file not shown.
@@ -0,0 +1,39 @@
|
||||
------------------
|
||||
-- Self Request --
|
||||
------------------
|
||||
-- 1. Two groups of infantry are spawned in the Batumi spawn zone.
|
||||
-- 2. After ~10 seconds they are put back into the warehouse stock.
|
||||
-- 3. After some time they are spawned again.
|
||||
-- 4. And so on and so forth...
|
||||
|
||||
-- Create a WAREHOUSE object.
|
||||
local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi")
|
||||
|
||||
-- Start warehouse Batumi.
|
||||
warehouseBatumi:Start()
|
||||
|
||||
-- Add one infantry asset.
|
||||
warehouseBatumi:AddAsset(GROUP:FindByName("Infantry Platoon Alpha"), 4)
|
||||
|
||||
-- Add self request for one infantry at Batumi.
|
||||
warehouseBatumi:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2)
|
||||
|
||||
--- Self request event. Triggered once the assets are spawned in the spawn zone or at the airbase.
|
||||
function warehouseBatumi:OnAfterSelfRequest(From, Event, To, groupset, request)
|
||||
local groupset=groupset --Core.Set#SET_GROUP
|
||||
|
||||
-- Loop over all groups spawned from that request.
|
||||
for _,group in pairs(groupset:GetSet()) do
|
||||
local group=group --Wrapper.Group#GROUP
|
||||
|
||||
-- Gree smoke on spawned group.
|
||||
--group:SmokeGreen()
|
||||
|
||||
-- Put asset back to stock after 10 seconds.
|
||||
warehouseBatumi:__AddAsset(10, group)
|
||||
end
|
||||
|
||||
-- Add new self request after 20 seconds.
|
||||
warehouseBatumi:__AddRequest(20, warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2)
|
||||
|
||||
end
|
||||
Binary file not shown.
@@ -0,0 +1,30 @@
|
||||
----------------------------------
|
||||
-- Self Propelled Ground Troops --
|
||||
----------------------------------
|
||||
-- 1. Ground troops - APCs and infantry - are transferred from Batumi to FARP Berlin.
|
||||
-- 2. Warehouse Berlin is empty initially. But a request from Batumi is made for APCs. This cannot be processed and is held in the queue.
|
||||
-- 3. Once the assets arrive at Berlin, the request can be processed and some APCs are send back to Batumi.
|
||||
|
||||
-- Create WAREHOUSE objects.
|
||||
local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi")
|
||||
local warehouseBerlin=WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin")
|
||||
|
||||
-- Set spawn zone for warehouse Batumi.
|
||||
warehouseBatumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
||||
|
||||
-- Start Warehouse at Batumi.
|
||||
warehouseBatumi:Start()
|
||||
|
||||
-- Add 20 infantry groups and 10 APCs as assets to Batumi warehouse stock.
|
||||
warehouseBatumi:AddAsset("Infantry Platoon Alpha", 20)
|
||||
warehouseBatumi:AddAsset("TPz Fuchs", 10)
|
||||
|
||||
-- Start Warehouse Berlin.
|
||||
warehouseBerlin:Start()
|
||||
|
||||
-- Warehouse Berlin requests ten infantry groups and five APCs from warehouse Batumi
|
||||
warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 10)
|
||||
warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 5)
|
||||
|
||||
-- Request from Batumi for two APCs. Initially these are not in stock. When they become available, the request is executed.
|
||||
warehouseBerlin:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 2)
|
||||
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
------------------------------------
|
||||
-- Self Propelled Airborne Assets --
|
||||
------------------------------------
|
||||
-- 1. Kutaisi requests two Yak-52 with high (10) priority from Senaki.
|
||||
-- 2. Kobuleti requests half Yak-52 with low (70) priority and gets the remaining half of the rest.
|
||||
-- 3. FARP London requests 1/3 of all available Hueys from Senaki.
|
||||
|
||||
-- Create WAREHOUSE objects.
|
||||
local warehouseSenaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki")
|
||||
local warehouseKutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi")
|
||||
local warehouseKobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti")
|
||||
local warehouseLondon = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London")
|
||||
|
||||
-- Start warehouses
|
||||
warehouseSenaki:Start()
|
||||
warehouseKutaisi:Start()
|
||||
warehouseKobuleti:Start()
|
||||
warehouseLondon:Start()
|
||||
|
||||
-- Add assets to Senaki warehouse
|
||||
warehouseSenaki:AddAsset("Yak-52", 10)
|
||||
warehouseSenaki:AddAsset("Huey", 6)
|
||||
|
||||
-- Kusaisi requests 3 Yak-52 form Senaki while Kobuleti wants all the rest.
|
||||
warehouseSenaki:AddRequest(warehouseKutaisi, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", 1, nil, nil, 10)
|
||||
warehouseSenaki:AddRequest(warehouseKobuleti, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", WAREHOUSE.Quantity.HALF, nil, nil, 70)
|
||||
|
||||
-- FARP London wants 1/3 of the six available Hueys.
|
||||
warehouseSenaki:AddRequest(warehouseLondon, WAREHOUSE.Descriptor.GROUPNAME, "Huey", WAREHOUSE.Quantity.THIRD)
|
||||
Binary file not shown.
@@ -0,0 +1,103 @@
|
||||
-----------------------
|
||||
-- Test 17: Resupply --
|
||||
-----------------------
|
||||
-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone.
|
||||
-- Whenever a group dies, a new group is send from the warehouse to the battle zone.
|
||||
-- Additionally, for each dead group, Berlin requests resupply from Batumi.
|
||||
|
||||
-- Display mission time every 30 seconds.
|
||||
SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Define Warehouses.
|
||||
local warehouse={}
|
||||
|
||||
-- Blue warehouses
|
||||
warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE
|
||||
-- Red warehouse
|
||||
warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE
|
||||
|
||||
-- Fine tune warehouses if necessary.
|
||||
warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
||||
warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone"))
|
||||
warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone")))
|
||||
|
||||
|
||||
-- Creat explosion at an object.
|
||||
local function Explosion(object, power)
|
||||
power=power or 1000
|
||||
if object and object:IsAlive() then
|
||||
object:GetCoordinate():Explosion(power)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Start warehouses.
|
||||
warehouse.Batumi:Start()
|
||||
warehouse.Berlin:Start()
|
||||
|
||||
-- Front line warehouse.
|
||||
warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6)
|
||||
|
||||
-- Resupply warehouse.
|
||||
warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50)
|
||||
|
||||
-- Battle zone near FARP Berlin. This is where the action is!
|
||||
local BattleZone=ZONE:New("Virtual Battle Zone")
|
||||
|
||||
-- Send infantry groups to the battle zone. Two groups every ~60 seconds.
|
||||
for i=1,2 do
|
||||
local time=(i-1)*60+10
|
||||
warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone")
|
||||
end
|
||||
|
||||
-- Take care of the spawned units.
|
||||
function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request)
|
||||
local groupset=groupset --Core.Set#SET_GROUP
|
||||
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
||||
|
||||
-- Get assignment of this request.
|
||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||
|
||||
if assignment=="To Battle Zone" then
|
||||
|
||||
for _,group in pairs(groupset:GetSet()) do
|
||||
local group=group --Wrapper.Group#GROUP
|
||||
|
||||
-- Route group to Battle zone.
|
||||
local ToCoord=BattleZone:GetRandomCoordinate()
|
||||
group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80)
|
||||
|
||||
-- After 3-5 minutes we create an explosion to destroy the group.
|
||||
SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- An asset has died ==> request resupply for it.
|
||||
function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request)
|
||||
local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem
|
||||
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
||||
|
||||
-- Get assignment.
|
||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||
|
||||
-- Request resupply for dead asset from Batumi.
|
||||
warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply")
|
||||
|
||||
-- Send asset to Battle zone either now or when they arrive.
|
||||
warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment)
|
||||
end
|
||||
Binary file not shown.
@@ -0,0 +1,103 @@
|
||||
-----------------------
|
||||
-- Test 17: Resupply --
|
||||
-----------------------
|
||||
-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone.
|
||||
-- Whenever a group dies, a new group is send from the warehouse to the battle zone.
|
||||
-- Additionally, for each dead group, Berlin requests resupply from Batumi.
|
||||
|
||||
-- Display mission time every 30 seconds.
|
||||
SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Define Warehouses.
|
||||
local warehouse={}
|
||||
|
||||
-- Blue warehouses
|
||||
warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE
|
||||
-- Red warehouse
|
||||
warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE
|
||||
|
||||
-- Fine tune warehouses if necessary.
|
||||
warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
||||
warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone"))
|
||||
warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone")))
|
||||
|
||||
|
||||
-- Creat explosion at an object.
|
||||
local function Explosion(object, power)
|
||||
power=power or 1000
|
||||
if object and object:IsAlive() then
|
||||
object:GetCoordinate():Explosion(power)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Start warehouses.
|
||||
warehouse.Batumi:Start()
|
||||
warehouse.Berlin:Start()
|
||||
|
||||
-- Front line warehouse.
|
||||
warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6)
|
||||
|
||||
-- Resupply warehouse.
|
||||
warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50)
|
||||
|
||||
-- Battle zone near FARP Berlin. This is where the action is!
|
||||
local BattleZone=ZONE:New("Virtual Battle Zone")
|
||||
|
||||
-- Send infantry groups to the battle zone. Two groups every ~60 seconds.
|
||||
for i=1,2 do
|
||||
local time=(i-1)*60+10
|
||||
warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone")
|
||||
end
|
||||
|
||||
-- Take care of the spawned units.
|
||||
function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request)
|
||||
local groupset=groupset --Core.Set#SET_GROUP
|
||||
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
||||
|
||||
-- Get assignment of this request.
|
||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||
|
||||
if assignment=="To Battle Zone" then
|
||||
|
||||
for _,group in pairs(groupset:GetSet()) do
|
||||
local group=group --Wrapper.Group#GROUP
|
||||
|
||||
-- Route group to Battle zone.
|
||||
local ToCoord=BattleZone:GetRandomCoordinate()
|
||||
group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80)
|
||||
|
||||
-- After 3-5 minutes we create an explosion to destroy the group.
|
||||
SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- An asset has died ==> request resupply for it.
|
||||
function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request)
|
||||
local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem
|
||||
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
||||
|
||||
-- Get assignment.
|
||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||
|
||||
-- Request resupply for dead asset from Batumi.
|
||||
warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply")
|
||||
|
||||
-- Send asset to Battle zone either now or when they arrive.
|
||||
warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment)
|
||||
end
|
||||
@@ -0,0 +1,104 @@
|
||||
-----------------------
|
||||
-- Test 17: Resupply --
|
||||
-----------------------
|
||||
-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone.
|
||||
-- Whenever a group dies, a new group is send from the warehouse to the battle zone.
|
||||
-- Additionally, for each dead group, Berlin requests resupply from Batumi.
|
||||
|
||||
-- Display mission time every 30 seconds.
|
||||
SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Define Warehouses.
|
||||
local warehouse={}
|
||||
|
||||
-- Blue warehouses
|
||||
warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE
|
||||
-- Red warehouse
|
||||
warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE
|
||||
warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE
|
||||
|
||||
-- Fine tune warehouses if necessary.
|
||||
warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
||||
warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone"))
|
||||
warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone")))
|
||||
|
||||
|
||||
-- Creat explosion at an object.
|
||||
local function Explosion(object, power)
|
||||
power=power or 1000
|
||||
if object and object:IsAlive() then
|
||||
object:GetCoordinate():Explosion(power)
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Start warehouses.
|
||||
warehouse.Batumi:Start()
|
||||
warehouse.Berlin:Start()
|
||||
|
||||
-- Front line warehouse.
|
||||
warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6)
|
||||
|
||||
-- Resupply warehouse.
|
||||
warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50)
|
||||
|
||||
-- Battle zone near FARP Berlin. This is where the action is!
|
||||
local BattleZone=ZONE:New("Virtual Battle Zone")
|
||||
|
||||
-- Send infantry groups to the battle zone. Two groups every ~60 seconds.
|
||||
for i=1,2 do
|
||||
local time=(i-1)*60+10
|
||||
warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone")
|
||||
end
|
||||
|
||||
-- Take care of the spawned units.
|
||||
function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request)
|
||||
local groupset=groupset --Core.Set#SET_GROUP
|
||||
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
||||
|
||||
-- Get assignment of this request.
|
||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||
|
||||
if assignment=="To Battle Zone" then
|
||||
|
||||
for _,group in pairs(groupset:GetSet()) do
|
||||
local group=group --Wrapper.Group#GROUP
|
||||
|
||||
-- Route group to Battle zone.
|
||||
local ToCoord=BattleZone:GetRandomCoordinate()
|
||||
group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*0.8)
|
||||
|
||||
-- After 3-5 minutes we create an explosion to destroy the group.
|
||||
SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- An asset has died ==> request resupply for it.
|
||||
function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request)
|
||||
local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem
|
||||
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
||||
|
||||
-- Get assignment.
|
||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||
|
||||
-- Request resupply for dead asset from Batumi.
|
||||
warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, "Resupply")
|
||||
|
||||
-- Send asset to Battle zone either now or when they arrive.
|
||||
warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment)
|
||||
end
|
||||
Binary file not shown.
Reference in New Issue
Block a user