mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-21 20:50:11 +00:00
New Moose Structure + Created New Update Mission Method
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
Include.File( 'Cleanup' )
|
||||
Include.File( 'Spawn' )
|
||||
Include.File( 'Event')
|
||||
|
||||
Clean = CLEANUP:New( 'CLEAN_BATUMI', 180 )
|
||||
|
||||
SpawnRU = SPAWN:New( 'RU Attack Heli Batumi'):Limit( 2, 20 ):SpawnScheduled( 2, 0.2 )
|
||||
|
||||
SpawnUS = SPAWN:New( 'US Attack Heli Batumi'):Limit( 2, 20 ):SpawnScheduled( 2, 0.2 )
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,74 @@
|
||||
Include.File( 'Database' )
|
||||
Include.File( 'Spawn' )
|
||||
|
||||
DBBluePlanes = DATABASE:New()
|
||||
:FilterCoalitions( "blue" )
|
||||
:FilterCategories( "plane" )
|
||||
:FilterStart()
|
||||
|
||||
DBRedVehicles = DATABASE:New()
|
||||
:FilterCoalitions( "red" )
|
||||
:FilterCategories( "ground" )
|
||||
:FilterStart()
|
||||
|
||||
DBShips = DATABASE:New()
|
||||
:FilterCategories( "ship" )
|
||||
:FilterStart()
|
||||
|
||||
DBBelgium = DATABASE:New()
|
||||
:FilterCategories( "helicopter" )
|
||||
:FilterCountries( "BELGIUM" )
|
||||
:FilterStart()
|
||||
|
||||
DBNorthKorea = DATABASE:New()
|
||||
:FilterCountries( "NORTH_KOREA" )
|
||||
:FilterStart()
|
||||
|
||||
DBKA50Vinson = DATABASE:New()
|
||||
:FilterTypes( { "Ka-50", "VINSON" } )
|
||||
:FilterStart()
|
||||
|
||||
DBBluePlanes:TraceDatabase()
|
||||
DBRedVehicles:TraceDatabase()
|
||||
DBShips:TraceDatabase()
|
||||
DBBelgium:TraceDatabase()
|
||||
DBNorthKorea:TraceDatabase()
|
||||
DBKA50Vinson:TraceDatabase()
|
||||
|
||||
|
||||
SpawnUS_Plane = SPAWN:New( 'Database Spawn Test USA Plane')
|
||||
GroupUS_Plane = SpawnUS_Plane:Spawn()
|
||||
|
||||
SpawnUS_Vehicle = SPAWN:New( 'Database Spawn Test USA Vehicle')
|
||||
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
|
||||
|
||||
SpawnUS_Ship = SPAWN:New( 'Database Spawn Test USA Ship')
|
||||
GroupUS_Ship = SpawnUS_Ship:Spawn()
|
||||
|
||||
SpawnRU_Vehicle = SPAWN:New( 'Database Spawn Test RUSSIA Vehicle')
|
||||
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
|
||||
|
||||
SpawnRU_Ship = SPAWN:New( 'Database Spawn Test RUSSIA Ship')
|
||||
GroupRU_Ship = SpawnRU_Ship:Spawn()
|
||||
|
||||
SpawnUS_AttackVehicle = SPAWN:New( 'Database Spawn Test USA Attack Vehicle' )
|
||||
SpawnRU_AttackVehicle = SPAWN:New( 'Database Spawn Test RUSSIA Attack Vehicle' )
|
||||
|
||||
for i = 1, 10 do
|
||||
GroupRU_AttackVehicle = SpawnRU_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone RU"), true)
|
||||
GroupUS_AttackVehicle = SpawnUS_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone US"), true)
|
||||
end
|
||||
|
||||
|
||||
--DBBlue:TraceDatabase()
|
||||
routines.scheduleFunction( DBBluePlanes.TraceDatabase, { DBBluePlanes }, 1 )
|
||||
routines.scheduleFunction( DBRedVehicles.TraceDatabase, { DBRedVehicles }, 1 )
|
||||
routines.scheduleFunction( DBShips.TraceDatabase, { DBShips }, 1 )
|
||||
routines.scheduleFunction( DBBelgium.TraceDatabase, { DBBelgium }, 1 )
|
||||
routines.scheduleFunction( DBNorthKorea.TraceDatabase, { DBNorthKorea }, 1 )
|
||||
routines.scheduleFunction( DBKA50Vinson.TraceDatabase, { DBKA50Vinson }, 1 )
|
||||
|
||||
DBRedVehicles
|
||||
:ForEachAliveUnit( function( DCSUnit )
|
||||
DBRedVehicles:T( DCSUnit:getName() )
|
||||
end )
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,41 @@
|
||||
-- MOOSE include files.
|
||||
Include.File( "Mission" )
|
||||
Include.File( "Client" )
|
||||
Include.File( "DestroyGroupsTask" )
|
||||
Include.File( "DestroyRadarsTask" )
|
||||
Include.File( "DestroyUnitTypesTask" )
|
||||
Include.File( "Group" )
|
||||
Include.File( "Unit" )
|
||||
Include.File( "Zone" )
|
||||
Include.File( "Event" )
|
||||
|
||||
do
|
||||
local Mission = MISSION:New( 'Destroy Gound', 'Ground', 'Briefing', 'CCCP' )
|
||||
|
||||
Mission:AddClient( CLIENT:FindByName( 'Client Plane', "Just wait and observe the SU-25T destoying targets. Your mission goal should increase..." ) )
|
||||
|
||||
local DESTROYGROUPSTASK = DESTROYGROUPSTASK:New( 'Ground Vehicle', 'Ground Vehicles', { 'DESTROY Test 1' }, 100 ) -- 75% of a patriot battery needs to be destroyed to achieve mission success...
|
||||
DESTROYGROUPSTASK:SetGoalTotal( 1 )
|
||||
Mission:AddTask( DESTROYGROUPSTASK, 1 )
|
||||
|
||||
MISSIONSCHEDULER.AddMission( Mission )
|
||||
end
|
||||
|
||||
|
||||
do
|
||||
local Mission = MISSION:New( 'Destroy Helicopters', 'Helicopters', 'Briefing', 'CCCP' )
|
||||
|
||||
Mission:AddClient( CLIENT:FindByName( 'Client Plane', "Just wait and observe the SU-25T destoying the helicopters. The helicopter mission goal should increase once all are destroyed ..." ) )
|
||||
|
||||
local DESTROYGROUPSTASK = DESTROYGROUPSTASK:New( 'Helicopter', 'Helicopters', { 'DESTROY Test 2' }, 50 )
|
||||
DESTROYGROUPSTASK:SetGoalTotal( 2 )
|
||||
Mission:AddTask( DESTROYGROUPSTASK, 1 )
|
||||
|
||||
MISSIONSCHEDULER.AddMission( Mission )
|
||||
end
|
||||
|
||||
-- MISSION SCHEDULER STARTUP
|
||||
MISSIONSCHEDULER.Start()
|
||||
MISSIONSCHEDULER.ReportMenu()
|
||||
MISSIONSCHEDULER.ReportMissionsFlash( 30 )
|
||||
MISSIONSCHEDULER.ReportMissionsHide()
|
||||
@@ -0,0 +1,67 @@
|
||||
Include.File( "Mission" )
|
||||
Include.File( "Client" )
|
||||
Include.File( "Spawn" )
|
||||
Include.File( "Escort" )
|
||||
|
||||
|
||||
|
||||
do
|
||||
local function EventAliveHelicopter( Client )
|
||||
local EscortGroupHeli1 = SpawnEscortHeli:ReSpawn(1)
|
||||
local EscortHeli1 = ESCORT
|
||||
:New( Client, EscortGroupHeli1, "Escort Helicopter" )
|
||||
:MenuFollowAt( 100 )
|
||||
:MenuFollowAt( 200 )
|
||||
:MenuHoldAtEscortPosition( 20, 10, "Hold at %d meters for %d seconds" )
|
||||
:MenuHoldAtLeaderPosition( 120 )
|
||||
:MenuFlare( "Disperse Flares" )
|
||||
:MenuSmoke()
|
||||
:MenuReportTargets( 60, 20 )
|
||||
:MenuResumeMission()
|
||||
:MenuAssistedAttack()
|
||||
end
|
||||
|
||||
local function EventAlivePlane( Client )
|
||||
local EscortGroupPlane2 = SpawnEscortPlane:ReSpawn(1)
|
||||
local EscortPlane2 = ESCORT
|
||||
:New( Client, EscortGroupPlane2, "Escort Test Plane" )
|
||||
:MenuFollowAt( 100 )
|
||||
:MenuFollowAt( 200 )
|
||||
:MenuHoldAtEscortPosition( 20, 10, "Hold at %d meters for %d seconds" )
|
||||
:MenuHoldAtLeaderPosition( 120 )
|
||||
:MenuFlare( "Disperse Flares" )
|
||||
:MenuSmoke()
|
||||
:MenuReportTargets( 60, 20 )
|
||||
:MenuResumeMission()
|
||||
:MenuAssistedAttack()
|
||||
:MenuROE()
|
||||
:MenuEvasion()
|
||||
|
||||
local EscortGroupGround2 = SpawnEscortGround:ReSpawn(1)
|
||||
local EscortGround2 = ESCORT
|
||||
:New( Client, EscortGroupGround2, "Test Ground" )
|
||||
:Menus()
|
||||
|
||||
local EscortGroupShip2 = SpawnEscortShip:ReSpawn(1)
|
||||
local EscortShip2 = ESCORT
|
||||
:New( Client, EscortGroupShip2, "Test Ship" )
|
||||
:Menus()
|
||||
end
|
||||
|
||||
SpawnEscortHeli = SPAWN:New( "Escort Helicopter" )
|
||||
SpawnEscortPlane = SPAWN:New( "Escort Plane" )
|
||||
SpawnEscortGround = SPAWN:New( "Escort Ground" )
|
||||
SpawnEscortShip = SPAWN:New( "Escort Ship" )
|
||||
|
||||
EscortClientHeli = CLIENT:FindByName( "Lead Helicopter", "Fly around and observe the behaviour of the escort helicopter" ):Alive( EventAliveHelicopter )
|
||||
EscortClientPlane = CLIENT:FindByName( "Lead Plane", "Fly around and observe the behaviour of the escort airplane. Select Navigate->Joun-Up and airplane should follow you. Change speed and directions." )
|
||||
:Alive( EventAlivePlane )
|
||||
|
||||
end
|
||||
|
||||
-- MISSION SCHEDULER STARTUP
|
||||
MISSIONSCHEDULER.Start()
|
||||
MISSIONSCHEDULER.ReportMenu()
|
||||
MISSIONSCHEDULER.ReportMissionsHide()
|
||||
|
||||
env.info( "Test Mission loaded" )
|
||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
|
||||
-- Only use Include.File when developing new MOOSE classes.
|
||||
-- When using Moose.lua in the DO SCIPTS FILE initialization box,
|
||||
-- these Include.File statements are not needed, because all classes within Moose will be loaded.
|
||||
Include.File("MissileTrainer")
|
||||
|
||||
-- This is an example of a global
|
||||
local Trainer = MISSILETRAINER
|
||||
:New( 200, "Trainer: Welcome to the missile training, trainee! Missiles will be fired at you. Try to evade them. Good luck!" )
|
||||
:InitMessagesOnOff(true)
|
||||
:InitAlertsToAll(true)
|
||||
:InitAlertsHitsOnOff(true)
|
||||
:InitAlertsLaunchesOnOff(false) -- I'll put it on below ...
|
||||
:InitBearingOnOff(true)
|
||||
:InitRangeOnOff(true)
|
||||
:InitTrackingOnOff(true)
|
||||
:InitTrackingToAll(true)
|
||||
:InitMenusOnOff(false)
|
||||
|
||||
Trainer:InitAlertsToAll(true) -- Now alerts are also on
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
Include.File( "Sead" )
|
||||
|
||||
|
||||
-- CCCP SEAD Defenses
|
||||
SEAD_RU_SAM_Defenses = SEAD
|
||||
:New(
|
||||
{ 'SAM Test'
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
Include.File( "Spawn" )
|
||||
|
||||
|
||||
-- Tests Anapa: Spawn Basics
|
||||
-- -------------------------
|
||||
-- Spawning groups using Spawn function.
|
||||
Spawn_Plane = SPAWN:New( "Spawn Plane" )
|
||||
Group_Plane = Spawn_Plane:Spawn()
|
||||
|
||||
Spawn_Helicopter = SPAWN:New( "Spawn Helicopter" ):RandomizeRoute( 1, 1, 1000 )
|
||||
Group_Helicopter = Spawn_Helicopter:Spawn()
|
||||
Group_Helicopter2 = Spawn_Helicopter:Spawn()
|
||||
|
||||
Spawn_Ship = SPAWN:New( "Spawn Ship" ):RandomizeRoute( 0, 0, 2000 )
|
||||
Group_Ship1 = Spawn_Ship:Spawn()
|
||||
Group_Ship2 = Spawn_Ship:Spawn()
|
||||
|
||||
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle" ):RandomizeRoute( 1, 0, 50 )
|
||||
Group_Vehicle1 = Spawn_Vehicle:Spawn()
|
||||
Group_Vehicle2 = Spawn_Vehicle:Spawn()
|
||||
Group_Vehicle3 = Spawn_Vehicle:Spawn()
|
||||
Group_Vehicle4 = Spawn_Vehicle:Spawn()
|
||||
Group_Vehicle5 = Spawn_Vehicle:Spawn()
|
||||
Group_Vehicle6 = Spawn_Vehicle:Spawn()
|
||||
|
||||
Group_Vehicle1:TaskRouteToZone( ZONE:New( "Landing Zone" ), true, 40, "Cone" )
|
||||
|
||||
-- Now land the spawned plane on to the Vinson, by copying the route of another object.
|
||||
Route_Plane = GROUP:FindByName( "Spawn Helicopter Route Copy" ):CopyRoute( 1, 0 )
|
||||
|
||||
Group_Plane:Route( Route_Plane )
|
||||
|
||||
--Route_Helicopter[#Route_Helicopter].linkUnit = Group_Ship1:GetDCSUnit(1)
|
||||
--Route_Helicopter[#Route_Helicopter].helipadId = Group_Ship1:GetDCSUnit(1)
|
||||
--Route_Helicopter[#Route_Helicopter].x = Group_Ship1:GetUnit(1):GetPointVec2().x
|
||||
--Route_Helicopter[#Route_Helicopter].y = Group_Ship1:GetUnit(1):GetPointVec2().y
|
||||
--env.info( Route_Helicopter[#Route_Helicopter].type .. " on " .. Group_Ship1:GetUnit(1):GetID() )
|
||||
--Group_Helicopter:Route( Route_Helicopter )
|
||||
|
||||
|
||||
-- Tests Batumi: Scheduled Spawning
|
||||
-- --------------------------------
|
||||
-- Unlimited spawning of groups, scheduled every 30 seconds ...
|
||||
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
|
||||
Spawn_Helicopter_Scheduled = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
|
||||
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
|
||||
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
|
||||
|
||||
-- Tests Tbilisi: Limited Spawning and repeat
|
||||
-- ------------------------------------------
|
||||
-- Spawing one group, and respawning the same group when it lands ...
|
||||
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):InitRepeat():Spawn()
|
||||
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):InitRepeatOnLanding():Spawn()
|
||||
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):InitRepeatOnEngineShutDown():Spawn()
|
||||
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):InitRepeat():Spawn()
|
||||
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):InitRepeatOnLanding():Spawn()
|
||||
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):InitRepeatOnEngineShutDown():Spawn()
|
||||
|
||||
|
||||
-- Tests Soganlug
|
||||
-- --------------
|
||||
-- Limited spawning of groups, scheduled every 30 seconds ...
|
||||
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
|
||||
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
|
||||
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
|
||||
|
||||
-- Tests Sukhumi
|
||||
-- -------------
|
||||
-- Limited spawning of groups, scheduled every seconds with route randomization.
|
||||
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 5, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 2, 0 )
|
||||
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 5, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 2, 0 )
|
||||
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
|
||||
|
||||
|
||||
-- Tests Kutaisi
|
||||
-- -------------
|
||||
-- Tests the CleanUp functionality.
|
||||
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
|
||||
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
|
||||
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 60 ):SpawnScheduled( 10, 0 )
|
||||
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
|
||||
|
||||
-- Maykop
|
||||
-- ------
|
||||
-- Creates arrays of groups ready to be spawned and dynamic spawning of groups from another group.
|
||||
|
||||
-- SpawnTestVisible creates an array of 200 groups, every 20 groups with 20 meters space in between, and will activate a group of the array every 10 seconds with a 0.2 time randomization.
|
||||
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):Array( 59, 20, 30, 30 ):SpawnScheduled( 10, 0.2 )
|
||||
|
||||
-- Spawn_Templates_Visible contains different templates...
|
||||
Spawn_Templates_Visible = { "Spawn Vehicle Visible Template A",
|
||||
"Spawn Vehicle Visible Template B",
|
||||
"Spawn Vehicle Visible Template C",
|
||||
"Spawn Vehicle Visible Template D",
|
||||
"Spawn Vehicle Visible Template E",
|
||||
"Spawn Vehicle Visible Template F",
|
||||
"Spawn Vehicle Visible Template G",
|
||||
"Spawn Vehicle Visible Template H",
|
||||
"Spawn Vehicle Visible Template I",
|
||||
"Spawn Vehicle Visible Template J"
|
||||
}
|
||||
|
||||
-- Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled creates an array of 40 vehicle groups, spread out by 20 groups each, with an 8 meter distance,
|
||||
-- and chooses for each group from the templates specified in Spawn_Templates_Visible.
|
||||
|
||||
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
|
||||
:Limit( 80, 80 )
|
||||
:RandomizeTemplate( Spawn_Templates_Visible )
|
||||
:Array( 49, 20, 8, 8 )
|
||||
:SpawnScheduled( 10, 0.2 )
|
||||
|
||||
-- Spawn_Infantry allows to spawn 10 Infantry groups.
|
||||
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
|
||||
:Limit( 10, 10 )
|
||||
|
||||
-- Spawn_Vehicle_Host reserves 10 vehicle groups, shown within an array arranged by 5 vehicles in a row with a distance of 8 meters, and schedules a vehicle each 10 seconds with a 20% variation.
|
||||
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
|
||||
:Limit( 10, 10 )
|
||||
:Array( 0, 5, 8, 8 )
|
||||
:SpawnScheduled( 10, 0.2 )
|
||||
|
||||
-- Spawn_Vehicle_SpawnToZone allows to spawn 10 vehicle groups.
|
||||
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
|
||||
:Limit( 10, 10 )
|
||||
|
||||
-- Spawn_Helicopter_SpawnToZone will fly to a location, hover, and spawn one vehicle on the ground, the helicopter will land
|
||||
-- and the vehicle will drive to a random location within the defined zone.
|
||||
-- For this, the following code is activated within the mission on waypoint 3:
|
||||
--
|
||||
-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) )
|
||||
-- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 )
|
||||
-- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 )
|
||||
--
|
||||
|
||||
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
|
||||
:Limit( 10, 10 )
|
||||
:SpawnScheduled( 60, 0.2 )
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,45 @@
|
||||
---
|
||||
-- MOOSE SPAWN repeat test scenario
|
||||
-- -------------------------------
|
||||
-- There are 8 GROUPs Spawned.
|
||||
-- They fly around Kutaisi and will land.
|
||||
-- Upon landing:
|
||||
-- 1. The KA-50 and the C-101EB should respawn itself directly when landed.
|
||||
-- 2. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp.
|
||||
-- @module MOOSE_Test_SPAWN_Repeat
|
||||
-- @author FlightControl
|
||||
|
||||
|
||||
Include.File("Spawn")
|
||||
|
||||
do
|
||||
|
||||
-- Declare SPAWN objects
|
||||
local Spawn_KA_50 = SPAWN:New("KA-50")
|
||||
local Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2")
|
||||
local Spawn_C_101EB = SPAWN:New("C-101EB")
|
||||
local Spawn_A_10C = SPAWN:New("A-10C")
|
||||
|
||||
-- Choose repeat functionality
|
||||
|
||||
-- Repeat on landing
|
||||
Spawn_KA_50:InitRepeatOnLanding()
|
||||
Spawn_C_101EB:InitRepeatOnLanding()
|
||||
|
||||
-- Repeat on enging shutdown (when landed on the airport)
|
||||
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
|
||||
Spawn_A_10C:InitRepeatOnEngineShutDown()
|
||||
|
||||
-- Now SPAWN the GROUPs
|
||||
Spawn_KA_50:Spawn()
|
||||
Spawn_C_101EB:Spawn()
|
||||
Spawn_MI_8MTV2:Spawn()
|
||||
Spawn_A_10C:Spawn()
|
||||
Spawn_KA_50:Spawn()
|
||||
Spawn_C_101EB:Spawn()
|
||||
Spawn_MI_8MTV2:Spawn()
|
||||
Spawn_A_10C:Spawn()
|
||||
|
||||
-- Now run the mission and observe the behaviour.
|
||||
|
||||
end
|
||||
Binary file not shown.
+125
@@ -0,0 +1,125 @@
|
||||
Include.File( "Mission" )
|
||||
Include.File( "Client" )
|
||||
Include.File( "DeployTask" )
|
||||
Include.File( "PickupTask" )
|
||||
Include.File( "DestroyGroupsTask" )
|
||||
Include.File( "DestroyRadarsTask" )
|
||||
Include.File( "DestroyUnitTypesTask" )
|
||||
Include.File( "GoHomeTask" )
|
||||
Include.File( "Spawn" )
|
||||
Include.File( "Movement" )
|
||||
Include.File( "Sead" )
|
||||
Include.File( "CleanUp" )
|
||||
|
||||
do
|
||||
local Mission = MISSION:New( 'Pickup', 'Operational', 'Pickup Troops', 'NATO' )
|
||||
|
||||
Mission:AddClient( CLIENT:FindByName( 'DE Pickup Test 1' ):Transport() )
|
||||
Mission:AddClient( CLIENT:FindByName( 'DE Pickup Test 2' ):Transport() )
|
||||
|
||||
local CargoTable = {}
|
||||
|
||||
local EngineerNames = { "Alpha", "Beta", "Gamma", "Delta", "Theta" }
|
||||
|
||||
Cargo_Pickup_Zone_1 = CARGO_ZONE:New( 'Pickup Zone 1', 'DE Communication Center 1' ):BlueSmoke()
|
||||
Cargo_Pickup_Zone_2 = CARGO_ZONE:New( 'Pickup Zone 2', 'DE Communication Center 2' ):RedSmoke()
|
||||
|
||||
for CargoItem = 1, 2 do
|
||||
CargoTable[CargoItem] = CARGO_GROUP:New( 'Engineers', 'Team ' .. EngineerNames[CargoItem], math.random( 70, 100 ) * 3, 'DE Infantry', Cargo_Pickup_Zone_1 )
|
||||
end
|
||||
|
||||
for CargoItem = 3, 5 do
|
||||
CargoTable[CargoItem] = CARGO_GROUP:New( 'Engineers', 'Team ' .. EngineerNames[CargoItem], math.random( 70, 100 ) * 3, 'DE Infantry', Cargo_Pickup_Zone_2 )
|
||||
end
|
||||
|
||||
--Cargo_Package = CARGO_INVISIBLE:New( 'Letter', 0.1, 'DE Secret Agent', 'Pickup Zone Package' )
|
||||
--Cargo_Goods = CARGO_STATIC:New( 'Goods', 20, 'Goods', 'Pickup Zone Goods', 'DE Collection Point' )
|
||||
--Cargo_SlingLoad = CARGO_SLING:New( 'Basket', 40, 'Basket', 'Pickup Zone Sling Load', 'DE Cargo Guard' )
|
||||
|
||||
|
||||
-- Assign the Pickup Task
|
||||
local PickupTask = PICKUPTASK:New( 'Engineers', CLIENT.ONBOARDSIDE.LEFT )
|
||||
PickupTask:FromZone( Cargo_Pickup_Zone_1 )
|
||||
PickupTask:FromZone( Cargo_Pickup_Zone_2 )
|
||||
PickupTask:InitCargo( CargoTable )
|
||||
PickupTask:SetGoalTotal( 3 )
|
||||
Mission:AddTask( PickupTask, 1 )
|
||||
|
||||
|
||||
Cargo_Deploy_Zone_1 = CARGO_ZONE:New( 'Deploy Zone 1', 'DE Communication Center 3' ):RedFlare()
|
||||
Cargo_Deploy_Zone_2 = CARGO_ZONE:New( 'Deploy Zone 2', 'DE Communication Center 4' ):WhiteFlare()
|
||||
|
||||
-- Assign the Pickup Task
|
||||
local DeployTask = DEPLOYTASK:New( 'Engineers' )
|
||||
DeployTask:ToZone( Cargo_Deploy_Zone_1 )
|
||||
DeployTask:ToZone( Cargo_Deploy_Zone_2 )
|
||||
DeployTask:SetGoalTotal( 3 )
|
||||
Mission:AddTask( DeployTask, 2 )
|
||||
|
||||
MISSIONSCHEDULER.AddMission( Mission )
|
||||
end
|
||||
|
||||
do
|
||||
local Mission = MISSION:New( 'Deliver secret letter', 'Operational', 'Pickup letter to the commander.', 'NATO' )
|
||||
|
||||
Client_Package_1 = CLIENT:FindByName( 'BE Package Test 1' ):Transport()
|
||||
|
||||
Mission:AddClient( Client_Package_1 )
|
||||
|
||||
Package_Pickup_Zone = CARGO_ZONE:New( 'Package Pickup Zone', 'DE Guard' ):GreenSmoke()
|
||||
|
||||
Cargo_Package = CARGO_PACKAGE:New( 'Letter', 'Letter to Command', 0.1, Client_Package_1 )
|
||||
--Cargo_Goods = CARGO_STATIC:New( 'Goods', 20, 'Goods', 'Pickup Zone Goods', 'DE Collection Point' )
|
||||
--Cargo_SlingLoad = CARGO_SLING:New( 'Basket', 40, 'Basket', 'Pickup Zone Sling Load', 'DE Cargo Guard' )
|
||||
|
||||
|
||||
-- Assign the Pickup Task
|
||||
local PickupTask = PICKUPTASK:New( 'Letter', CLIENT.ONBOARDSIDE.FRONT )
|
||||
PickupTask:FromZone( Package_Pickup_Zone )
|
||||
PickupTask:InitCargo( { Cargo_Package } )
|
||||
PickupTask:SetGoalTotal( 1 )
|
||||
Mission:AddTask( PickupTask, 1 )
|
||||
|
||||
|
||||
Package_Deploy_Zone = CARGO_ZONE:New( 'Package Deploy Zone', 'DE Secret Car' ):GreenFlare()
|
||||
|
||||
-- Assign the Pickup Task
|
||||
local DeployTask = DEPLOYTASK:New( 'Letter' )
|
||||
DeployTask:ToZone( Package_Deploy_Zone )
|
||||
DeployTask:SetGoalTotal( 1 )
|
||||
Mission:AddTask( DeployTask, 2 )
|
||||
|
||||
MISSIONSCHEDULER.AddMission( Mission )
|
||||
end
|
||||
|
||||
do
|
||||
local Mission = MISSION:New( 'Sling load Cargo', 'Operational', 'Sling Load Cargo to Deploy Zone.', 'NATO' )
|
||||
|
||||
Mission:AddClient( CLIENT:FindByName( 'Sling Load Test Client 1' ):Transport() )
|
||||
Mission:AddClient( CLIENT:FindByName( 'Sling Load Test Client 2' ):Transport() )
|
||||
|
||||
Sling_Load_Pickup_Zone = CARGO_ZONE:New( 'Sling Load Pickup Zone', 'Sling Load Guard' ):RedSmoke()
|
||||
|
||||
Cargo_Sling_Load = CARGO_SLINGLOAD:New( 'Sling', 'Food Boxes', 200, 'Sling Load Pickup Zone', 'Sling Load Guard', country.id.USA )
|
||||
--Cargo_Goods = CARGO_STATIC:New( 'Goods', 20, 'Goods', 'Pickup Zone Goods', 'DE Collection Point' )
|
||||
--Cargo_SlingLoad = CARGO_SLING:New( 'Basket', 40, 'Basket', 'Pickup Zone Sling Load', 'DE Cargo Guard' )
|
||||
|
||||
|
||||
-- Assign the Pickup Task
|
||||
local PickupTask = PICKUPTASK:New( 'Sling', CLIENT.ONBOARDSIDE.FRONT )
|
||||
PickupTask:FromZone( Sling_Load_Pickup_Zone )
|
||||
PickupTask:InitCargo( { Cargo_Sling_Load } )
|
||||
PickupTask:SetGoalTotal( 1 )
|
||||
Mission:AddTask( PickupTask, 1 )
|
||||
|
||||
MISSIONSCHEDULER.AddMission( Mission )
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- MISSION SCHEDULER STARTUP
|
||||
MISSIONSCHEDULER.Start()
|
||||
MISSIONSCHEDULER.ReportMenu()
|
||||
MISSIONSCHEDULER.ReportMissionsHide()
|
||||
|
||||
env.info( "Test Mission loaded" )
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,39 @@
|
||||
|
||||
Include.File( "Group" )
|
||||
Include.File( "Unit" )
|
||||
Include.File( "Client" )
|
||||
|
||||
BASE:TraceClass( "UNIT" )
|
||||
BASE:TraceClass( "GROUP" )
|
||||
BASE:TraceClass( "CLIENT" )
|
||||
|
||||
UnitTankAI1 = _DATABASE:FindUnit( "Smoke Test 1" )
|
||||
UnitTankAI2 = _DATABASE:FindUnit( "Smoke Test 2" )
|
||||
UnitTankAI3 = UNIT:FindByName( "Smoke Test 3" )
|
||||
UnitTankAI4 = _DATABASE:FindUnit( "Smoke Test 4" )
|
||||
|
||||
UnitTankAI1:SmokeBlue()
|
||||
|
||||
UnitTankAI3:SmokeOrange()
|
||||
|
||||
UnitTankAI2:T( UnitTankAI2:GetAmmo() )
|
||||
|
||||
GroupTanks = GROUP:FindByName( "Smoke Test" )
|
||||
|
||||
GroupTanks:T( GroupTanks:OptionROEOpenFirePossible() )
|
||||
|
||||
GroupTanks:OptionROEOpenFire()
|
||||
|
||||
local function ClientAlive( Client, ClientNumber )
|
||||
GroupTanks:MessageToClient( "Hello Client " .. ClientNumber .. "! We are reporting to you on our way...", 5, Client )
|
||||
end
|
||||
|
||||
|
||||
ClientHeli = CLIENT:FindByName( "Client Test 1", "Fly slowly to waypoint 3 of the Command Post!" ):Alive( ClientAlive, 1 )
|
||||
ClientHeli2 = CLIENT:FindByName( "Client Test 2", "Fly slowly to waypoint 3 of the Command Post!" ):Alive( ClientAlive, 2 )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user