mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2025-08-15 10:37:46 +00:00
Updated Moose.lua
This commit is contained in:
parent
286d2ed571
commit
f31942aef3
@ -1,9 +1,9 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane", "ship" } ):FilterCoalitions( "red" ):FilterPrefixes( { "Escort", "Ship Defense" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" )
|
||||
Escort:FormationTrail( 750, 750 , 0 )
|
||||
Escort:MenusAirplanes()
|
||||
Escort:__Start( 1 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane", "ship" } ):FilterCoalitions( "red" ):FilterPrefixes( { "Escort", "Ship Defense" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" )
|
||||
Escort:FormationTrail( 750, 750 , 0 )
|
||||
Escort:MenusAirplanes()
|
||||
Escort:__Start( 1 )
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane", "ship" } ):FilterCoalitions( "red" ):FilterPrefixes( { "Escort", "Ship Defense" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" )
|
||||
Escort:FormationTrail( 750, 750 , 0 )
|
||||
Escort:MenusAirplanes()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane", "ship" } ):FilterCoalitions( "red" ):FilterPrefixes( { "Escort", "Ship Defense" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" )
|
||||
Escort:FormationTrail( 750, 750 , 0 )
|
||||
Escort:MenusAirplanes()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" )
|
||||
Escort:FormationTrail( 100, 100 , 0 )
|
||||
Escort:MenusAirplanes()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" )
|
||||
Escort:FormationTrail( 100, 100 , 0 )
|
||||
Escort:MenusAirplanes()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" )
|
||||
Escort:FormationTrail( 100, 100 , 0 )
|
||||
Escort:MenusAirplanes()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "plane" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" )
|
||||
Escort:FormationTrail( 100, 100 , 0 )
|
||||
Escort:MenusAirplanes()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "helicopter" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" )
|
||||
Escort:FormationTrail( 100, 100 , 0 )
|
||||
Escort:MenusHelicopters()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "helicopter" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Attack", "Briefing" )
|
||||
Escort:FormationTrail( 100, 100 , 0 )
|
||||
Escort:MenusHelicopters()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "helicopter" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Test", "Use the ROE and ROT menus to test if the behaviour is working." )
|
||||
|
||||
Escort:SetFlightModeMission()
|
||||
|
||||
Escort:MenusHelicopters()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories( { "helicopter" } ):FilterCoalitions( "blue" ):FilterPrefixes( { "Escort" } ):FilterStart()
|
||||
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local Escort = AI_ESCORT:New( LeaderUnit, FollowGroupSet, "Escort Test", "Use the ROE and ROT menus to test if the behaviour is working." )
|
||||
|
||||
Escort:SetFlightModeMission()
|
||||
|
||||
Escort:MenusHelicopters()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state.
|
||||
|
||||
EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 )
|
||||
EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig )
|
||||
|
||||
|
||||
local EscortUnit = UNIT:FindByName( "Red A2G Pilot" )
|
||||
|
||||
Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" )
|
||||
Escort:FormationTrail( 50, 100, 100 )
|
||||
Escort:Menus( 50, 50, 0, 0, 50, 50, 6 )
|
||||
Escort:__Start( 5 )
|
||||
|
||||
-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state.
|
||||
|
||||
EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 )
|
||||
EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig )
|
||||
|
||||
|
||||
local EscortUnit = UNIT:FindByName( "Red A2G Pilot" )
|
||||
|
||||
Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" )
|
||||
Escort:FormationTrail( 50, 100, 100 )
|
||||
Escort:Menus( 50, 50, 0, 0, 50, 50, 6 )
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state.
|
||||
|
||||
EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 )
|
||||
EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig )
|
||||
|
||||
|
||||
local EscortUnit = UNIT:FindByName( "Red A2G Pilot" )
|
||||
|
||||
Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" )
|
||||
Escort:FormationTrail( 50, 100, 100 )
|
||||
Escort:MenusAirplanes( 50, 50, 0, 0, 50, 50, 6 )
|
||||
Escort:__Start( 5 )
|
||||
|
||||
-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state.
|
||||
|
||||
EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 )
|
||||
EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig )
|
||||
|
||||
|
||||
local EscortUnit = UNIT:FindByName( "Red A2G Pilot" )
|
||||
|
||||
Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" )
|
||||
Escort:FormationTrail( 50, 100, 100 )
|
||||
Escort:MenusAirplanes( 50, 50, 0, 0, 50, 50, 6 )
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state.
|
||||
|
||||
EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 )
|
||||
EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig )
|
||||
|
||||
|
||||
local EscortUnit = UNIT:FindByName( "Red A2G Pilot" )
|
||||
|
||||
Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" )
|
||||
Escort:FormationTrail( 50, 100, 100 )
|
||||
Escort:MenusAirplanes( 50, 50, 0, 0, 50, 50, 6 )
|
||||
Escort:SetEscortSpawnMission()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state.
|
||||
|
||||
EscortSpawn = SPAWN:NewWithAlias( "Red A2G Escort Template", "Red A2G Escort AI" ):InitLimit( 10, 10 )
|
||||
EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Sochi_Adler ), AIRBASE.TerminalType.OpenBig )
|
||||
|
||||
|
||||
local EscortUnit = UNIT:FindByName( "Red A2G Pilot" )
|
||||
|
||||
Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Sochi_Adler), "A2G", "Briefing" )
|
||||
Escort:FormationTrail( 50, 100, 100 )
|
||||
Escort:MenusAirplanes( 50, 50, 0, 0, 50, 50, 6 )
|
||||
Escort:SetEscortSpawnMission()
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
@ -1,51 +1,51 @@
|
||||
-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state.
|
||||
|
||||
HQ = GROUP:FindByName( "HQ", "Bravo" )
|
||||
|
||||
CommandCenter = COMMANDCENTER
|
||||
:New( HQ, "HQ" )
|
||||
|
||||
Mission = MISSION
|
||||
:New( CommandCenter, "Rescue Operation", "Tactical", "Transport General Mc. Connor!", coalition.side.BLUE )
|
||||
|
||||
TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart()
|
||||
TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups )
|
||||
TaskDispatcher:SetDefaultDeployZone( ZONE:New( "HeadQuarter" ) )
|
||||
|
||||
local CargoSet = SET_CARGO:New():FilterTypes( "General" ):FilterStart()
|
||||
WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Rescue the general and transport him to the HeadQuarter (near the airbase Gudauta)." )
|
||||
|
||||
EscortSpawn = SPAWN:NewWithAlias( "Blue A2G Escort Template" ):InitLimit( 6, 6 )
|
||||
EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Gudauta ), AIRBASE.TerminalType.OpenMedOrBig )
|
||||
|
||||
|
||||
|
||||
local EscortUnit = UNIT:FindByName( "Transport" )
|
||||
|
||||
Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Gudauta), "A2G", "Rescue the engineer from the village Lesselide near the station. Beware of enemy air defenses. Use the escorts wisely." )
|
||||
Escort:FormationTrail( 50, 100, 100 )
|
||||
|
||||
Escort:SetEscortSpawnMission()
|
||||
|
||||
Escort:MenuJoinUp()
|
||||
|
||||
Escort:MenuFormationTrail( 50, 50, 0 )
|
||||
Escort:MenuFormationLeftLine( 0, 0, 50, 50 )
|
||||
Escort:MenuFormationRightLine( 0, 0, 50, 50 )
|
||||
|
||||
|
||||
Escort:MenuHoldAtEscortPosition( 30, 0 )
|
||||
Escort:MenuHoldAtEscortPosition( 100, 0 )
|
||||
Escort:MenuHoldAtLeaderPosition( 30, 0 )
|
||||
Escort:MenuHoldAtLeaderPosition( 100, 0 )
|
||||
|
||||
Escort:MenuFlare()
|
||||
Escort:MenuSmoke()
|
||||
|
||||
Escort:MenuTargets( 60 )
|
||||
Escort:MenuROE()
|
||||
Escort:MenuROT()
|
||||
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
-- At startup of the overall mission, we spawn 10 possible escort planes in "Uncontrolled" state.
|
||||
|
||||
HQ = GROUP:FindByName( "HQ", "Bravo" )
|
||||
|
||||
CommandCenter = COMMANDCENTER
|
||||
:New( HQ, "HQ" )
|
||||
|
||||
Mission = MISSION
|
||||
:New( CommandCenter, "Rescue Operation", "Tactical", "Transport General Mc. Connor!", coalition.side.BLUE )
|
||||
|
||||
TransportGroups = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Transport" ):FilterStart()
|
||||
TaskDispatcher = TASK_CARGO_DISPATCHER:New( Mission, TransportGroups )
|
||||
TaskDispatcher:SetDefaultDeployZone( ZONE:New( "HeadQuarter" ) )
|
||||
|
||||
local CargoSet = SET_CARGO:New():FilterTypes( "General" ):FilterStart()
|
||||
WorkplaceTask = TaskDispatcher:AddTransportTask( "Transport Team", CargoSet, "Rescue the general and transport him to the HeadQuarter (near the airbase Gudauta)." )
|
||||
|
||||
EscortSpawn = SPAWN:NewWithAlias( "Blue A2G Escort Template" ):InitLimit( 6, 6 )
|
||||
EscortSpawn:ParkAtAirbase( AIRBASE:FindByName( AIRBASE.Caucasus.Gudauta ), AIRBASE.TerminalType.OpenMedOrBig )
|
||||
|
||||
|
||||
|
||||
local EscortUnit = UNIT:FindByName( "Transport" )
|
||||
|
||||
Escort = AI_ESCORT_REQUEST:New( EscortUnit, EscortSpawn, AIRBASE:FindByName(AIRBASE.Caucasus.Gudauta), "A2G", "Rescue the engineer from the village Lesselide near the station. Beware of enemy air defenses. Use the escorts wisely." )
|
||||
Escort:FormationTrail( 50, 100, 100 )
|
||||
|
||||
Escort:SetEscortSpawnMission()
|
||||
|
||||
Escort:MenuJoinUp()
|
||||
|
||||
Escort:MenuFormationTrail( 50, 50, 0 )
|
||||
Escort:MenuFormationLeftLine( 0, 0, 50, 50 )
|
||||
Escort:MenuFormationRightLine( 0, 0, 50, 50 )
|
||||
|
||||
|
||||
Escort:MenuHoldAtEscortPosition( 30, 0 )
|
||||
Escort:MenuHoldAtEscortPosition( 100, 0 )
|
||||
Escort:MenuHoldAtLeaderPosition( 30, 0 )
|
||||
Escort:MenuHoldAtLeaderPosition( 100, 0 )
|
||||
|
||||
Escort:MenuFlare()
|
||||
Escort:MenuSmoke()
|
||||
|
||||
Escort:MenuTargets( 60 )
|
||||
Escort:MenuROE()
|
||||
Escort:MenuROT()
|
||||
|
||||
Escort:__Start( 5 )
|
||||
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Line Formation", "Briefing" ):TestSmokeDirectionVector(true)
|
||||
LargeFormation:FormationLeftLine( 500, 0, 250, 0 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Line Formation", "Briefing" ):TestSmokeDirectionVector(true)
|
||||
LargeFormation:FormationLeftLine( 500, 0, 250, 0 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Line Formation", "Briefing" )
|
||||
LargeFormation:FormationLeftLine( 0, 0, 250, 250 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Line Formation", "Briefing" )
|
||||
LargeFormation:FormationLeftLine( 0, 0, 250, 250 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Right Line Formation", "Briefing" )
|
||||
LargeFormation:FormationRightLine(500,0,250,250)
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Right Line Formation", "Briefing" )
|
||||
LargeFormation:FormationRightLine(500,0,250,250)
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Wing Formation", "Briefing" )
|
||||
LargeFormation:FormationLeftWing( 500, 50, 0, 250, 250 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Left Wing Formation", "Briefing" )
|
||||
LargeFormation:FormationLeftWing( 500, 50, 0, 250, 250 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Right Wing Formation", "Briefing" )
|
||||
LargeFormation:FormationRightWing( 100, 50, 0, 500, 500 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Right Wing Formation", "Briefing" )
|
||||
LargeFormation:FormationRightWing( 100, 50, 0, 500, 500 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Center Wing Formation", "Briefing" )
|
||||
LargeFormation:FormationCenterWing( 500, 50, 0, 0, 250, 250 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Center Wing Formation", "Briefing" )
|
||||
LargeFormation:FormationCenterWing( 500, 50, 0, 0, 250, 250 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Trail Formation", "Briefing" )
|
||||
LargeFormation:FormationTrail( 250, 750 , 0 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Trail Formation", "Briefing" )
|
||||
LargeFormation:FormationTrail( 250, 750 , 0 )
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Trail Formation", "Briefing" )
|
||||
LargeFormation:FormationBox(150,120,0,-5,0,60,8)
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
collectgarbage()
|
||||
|
||||
|
||||
local FollowGroupSet = SET_GROUP:New():FilterCategories("plane"):FilterCoalitions("blue"):FilterPrefixes("Follow"):FilterStart()
|
||||
FollowGroupSet:Flush()
|
||||
local LeaderUnit = UNIT:FindByName( "Leader" )
|
||||
local LargeFormation = AI_FORMATION:New( LeaderUnit, FollowGroupSet, "Trail Formation", "Briefing" )
|
||||
LargeFormation:FormationBox(150,120,0,-5,0,60,8)
|
||||
LargeFormation:__Start( 1 )
|
||||
|
||||
collectgarbage()
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
|
||||
CargoEngineer = UNIT:FindByName( "Engineer" )
|
||||
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
|
||||
|
||||
CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
InfantryCargo:Board( CargoCarrier )
|
||||
|
||||
|
||||
CargoEngineer = UNIT:FindByName( "Engineer" )
|
||||
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
|
||||
|
||||
CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
InfantryCargo:Board( CargoCarrier )
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
|
||||
CargoEngineer = UNIT:FindByName( "Engineer" )
|
||||
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
|
||||
|
||||
CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This will Load immediately the Cargo into the Carrier, regardless where the Cargo is.
|
||||
InfantryCargo:Load( CargoCarrier )
|
||||
|
||||
-- This will Unboard the Cargo from the Carrier.
|
||||
|
||||
CargoEngineer = UNIT:FindByName( "Engineer" )
|
||||
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
|
||||
|
||||
CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This will Load immediately the Cargo into the Carrier, regardless where the Cargo is.
|
||||
InfantryCargo:Load( CargoCarrier )
|
||||
|
||||
-- This will Unboard the Cargo from the Carrier.
|
||||
InfantryCargo:UnBoard()
|
||||
@ -1,25 +1,25 @@
|
||||
|
||||
CargoEngineer = UNIT:FindByName( "Engineer" )
|
||||
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
|
||||
|
||||
CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" )
|
||||
|
||||
CargoCarrierTo = UNIT:FindByName( "CarrierTo" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
InfantryCargo:Board( CargoCarrierFrom )
|
||||
|
||||
-- Once the Cargo has been loaded into the Carrier, drive to a point and unload the Cargo.
|
||||
function InfantryCargo:OnEnterLoaded()
|
||||
self:__UnBoard( 1 )
|
||||
self.OnEnterLoaded = nil
|
||||
end
|
||||
|
||||
-- Once the Cargo has been unloaded from the Carrier (the Cargo has arrived to the unload gathering point), OnBoard the Cargo in the other Carrier.
|
||||
function InfantryCargo:OnEnterUnLoaded()
|
||||
self:__Board( 1, CargoCarrierTo )
|
||||
self.OnEnterUnLoaded = nil
|
||||
end
|
||||
|
||||
|
||||
CargoEngineer = UNIT:FindByName( "Engineer" )
|
||||
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
|
||||
|
||||
CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" )
|
||||
|
||||
CargoCarrierTo = UNIT:FindByName( "CarrierTo" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
InfantryCargo:Board( CargoCarrierFrom )
|
||||
|
||||
-- Once the Cargo has been loaded into the Carrier, drive to a point and unload the Cargo.
|
||||
function InfantryCargo:OnEnterLoaded()
|
||||
self:__UnBoard( 1 )
|
||||
self.OnEnterLoaded = nil
|
||||
end
|
||||
|
||||
-- Once the Cargo has been unloaded from the Carrier (the Cargo has arrived to the unload gathering point), OnBoard the Cargo in the other Carrier.
|
||||
function InfantryCargo:OnEnterUnLoaded()
|
||||
self:__Board( 1, CargoCarrierTo )
|
||||
self.OnEnterUnLoaded = nil
|
||||
end
|
||||
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
---
|
||||
-- Name: CGO-101 - Group Boarding
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A cargo group called Infantry with Engineers is boarding the Carrier "Carrier".
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the cargo is boarding.
|
||||
--
|
||||
|
||||
local InfantryGroup = GROUP:FindByName( "Infantry" )
|
||||
|
||||
local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 )
|
||||
|
||||
local CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
InfantryCargo:Board( CargoCarrier, 25 )
|
||||
|
||||
---
|
||||
-- Name: CGO-101 - Group Boarding
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A cargo group called Infantry with Engineers is boarding the Carrier "Carrier".
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the cargo is boarding.
|
||||
--
|
||||
|
||||
local InfantryGroup = GROUP:FindByName( "Infantry" )
|
||||
|
||||
local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 )
|
||||
|
||||
local CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
InfantryCargo:Board( CargoCarrier, 25 )
|
||||
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
---
|
||||
-- Name: CGO-102 - Group Unboarding
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A cargo group called Infantry with Engineers is unboarding the Carrier "Carrier".
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the cargo is unboarding.
|
||||
--
|
||||
|
||||
local InfantryGroup = GROUP:FindByName( "Infantry" )
|
||||
|
||||
local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 )
|
||||
|
||||
local CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This will Load immediately the Cargo into the Carrier, regardless where the Cargo is.
|
||||
InfantryCargo:Load( CargoCarrier )
|
||||
|
||||
-- This will Unboard the Cargo from the Carrier.
|
||||
---
|
||||
-- Name: CGO-102 - Group Unboarding
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A cargo group called Infantry with Engineers is unboarding the Carrier "Carrier".
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the cargo is unboarding.
|
||||
--
|
||||
|
||||
local InfantryGroup = GROUP:FindByName( "Infantry" )
|
||||
|
||||
local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 )
|
||||
|
||||
local CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This will Load immediately the Cargo into the Carrier, regardless where the Cargo is.
|
||||
InfantryCargo:Load( CargoCarrier )
|
||||
|
||||
-- This will Unboard the Cargo from the Carrier.
|
||||
InfantryCargo:UnBoard()
|
||||
@ -1,40 +1,40 @@
|
||||
---
|
||||
-- Name: CGO-103 - Group Tranferring
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A cargo group called Infantry with Engineers is tranferring from the APC "CarrierFrom" to the APC "CarrierTo".
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the cargo is boarding the APC "CarrierFrom".
|
||||
-- 2. Observe that the cargo is unboarding the APC "CarrierFrom".
|
||||
-- 3. Observe that the cargo is boarding the APC "CarrierTo".
|
||||
--
|
||||
|
||||
local InfantryGroup = GROUP:FindByName( "Infantry" )
|
||||
|
||||
local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 )
|
||||
|
||||
local CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" )
|
||||
|
||||
local CargoCarrierTo = UNIT:FindByName( "CarrierTo" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
InfantryCargo:Board( CargoCarrierFrom, 20 )
|
||||
|
||||
-- Once the Cargo has been loaded into the Carrier, drive to a point and unload the Cargo.
|
||||
function InfantryCargo:OnEnterLoaded()
|
||||
self:__UnBoard( 1 )
|
||||
self.OnEnterLoaded = nil
|
||||
end
|
||||
|
||||
-- Once the Cargo has been unloaded from the Carrier (the Cargo has arrived to the unload gathering point), OnBoard the Cargo in the other Carrier.
|
||||
function InfantryCargo:OnEnterUnLoaded()
|
||||
self:__Board( 1, CargoCarrierTo, 20 )
|
||||
self.OnEnterUnLoaded = nil
|
||||
end
|
||||
---
|
||||
-- Name: CGO-103 - Group Tranferring
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A cargo group called Infantry with Engineers is tranferring from the APC "CarrierFrom" to the APC "CarrierTo".
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the cargo is boarding the APC "CarrierFrom".
|
||||
-- 2. Observe that the cargo is unboarding the APC "CarrierFrom".
|
||||
-- 3. Observe that the cargo is boarding the APC "CarrierTo".
|
||||
--
|
||||
|
||||
local InfantryGroup = GROUP:FindByName( "Infantry" )
|
||||
|
||||
local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 )
|
||||
|
||||
local CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" )
|
||||
|
||||
local CargoCarrierTo = UNIT:FindByName( "CarrierTo" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
InfantryCargo:Board( CargoCarrierFrom, 20 )
|
||||
|
||||
-- Once the Cargo has been loaded into the Carrier, drive to a point and unload the Cargo.
|
||||
function InfantryCargo:OnEnterLoaded()
|
||||
self:__UnBoard( 1 )
|
||||
self.OnEnterLoaded = nil
|
||||
end
|
||||
|
||||
-- Once the Cargo has been unloaded from the Carrier (the Cargo has arrived to the unload gathering point), OnBoard the Cargo in the other Carrier.
|
||||
function InfantryCargo:OnEnterUnLoaded()
|
||||
self:__Board( 1, CargoCarrierTo, 20 )
|
||||
self.OnEnterUnLoaded = nil
|
||||
end
|
||||
|
||||
@ -1,29 +1,29 @@
|
||||
---
|
||||
-- Name: CGO-110 - Group Respawn
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 07 Jul 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A cargo group called Infantry with Engineers is Respawned after boarding the carrier.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the cargo is Respawned after boarding the Carrier.
|
||||
--
|
||||
|
||||
local InfantryGroup = GROUP:FindByName( "Infantry" )
|
||||
|
||||
local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 )
|
||||
|
||||
local CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
InfantryCargo:Board( CargoCarrier, 25 )
|
||||
|
||||
function InfantryCargo:OnEnterLoaded()
|
||||
InfantryCargo:Respawn()
|
||||
InfantryCargo:Board( CargoCarrier, 25 )
|
||||
---
|
||||
-- Name: CGO-110 - Group Respawn
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 07 Jul 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A cargo group called Infantry with Engineers is Respawned after boarding the carrier.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the cargo is Respawned after boarding the Carrier.
|
||||
--
|
||||
|
||||
local InfantryGroup = GROUP:FindByName( "Infantry" )
|
||||
|
||||
local InfantryCargo = CARGO_GROUP:New( InfantryGroup, "Engineers", "Infantry Engineers", 2000 )
|
||||
|
||||
local CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
InfantryCargo:Board( CargoCarrier, 25 )
|
||||
|
||||
function InfantryCargo:OnEnterLoaded()
|
||||
InfantryCargo:Respawn()
|
||||
InfantryCargo:Board( CargoCarrier, 25 )
|
||||
end
|
||||
@ -1,11 +1,11 @@
|
||||
|
||||
DeliveryUnit = UNIT:FindByName( "Delivery" )
|
||||
Letter = AI_CARGO_PACKAGE:New( DeliveryUnit, "Letter", "Secret Orders", "0.3", 2000, 25 )
|
||||
|
||||
CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
Letter:Board( CargoCarrier, 40, 3, 25, 90 )
|
||||
|
||||
|
||||
DeliveryUnit = UNIT:FindByName( "Delivery" )
|
||||
Letter = AI_CARGO_PACKAGE:New( DeliveryUnit, "Letter", "Secret Orders", "0.3", 2000, 25 )
|
||||
|
||||
CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
Letter:Board( CargoCarrier, 40, 3, 25, 90 )
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
|
||||
CargoEngineer = UNIT:FindByName( "Engineer" )
|
||||
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
|
||||
|
||||
CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This will Load the Cargo into the Carrier, regardless where the Cargo is.
|
||||
InfantryCargo:Load( CargoCarrier )
|
||||
|
||||
-- This will Unboard the Cargo from the Carrier.
|
||||
-- The Cargo will run from the Carrier to a point in the NearRadius around the Carrier.
|
||||
-- Unboard the Cargo with a speed of 10 km/h, go to 200 meters 180 degrees from the Carrier, iin a zone of 25 meters (NearRadius).
|
||||
|
||||
CargoEngineer = UNIT:FindByName( "Engineer" )
|
||||
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
|
||||
|
||||
CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This will Load the Cargo into the Carrier, regardless where the Cargo is.
|
||||
InfantryCargo:Load( CargoCarrier )
|
||||
|
||||
-- This will Unboard the Cargo from the Carrier.
|
||||
-- The Cargo will run from the Carrier to a point in the NearRadius around the Carrier.
|
||||
-- Unboard the Cargo with a speed of 10 km/h, go to 200 meters 180 degrees from the Carrier, iin a zone of 25 meters (NearRadius).
|
||||
InfantryCargo:UnBoard( 10, 2, 20, 10, 180 )
|
||||
@ -1,11 +1,11 @@
|
||||
|
||||
Barrels = STATIC:FindByName( "Barrels" )
|
||||
CargoBarrels = CARGO_CRATE:New( Barrels, "EAQ-234-432" )
|
||||
|
||||
CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
CargoBarrels:Load( CargoCarrier )
|
||||
|
||||
|
||||
Barrels = STATIC:FindByName( "Barrels" )
|
||||
CargoBarrels = CARGO_CRATE:New( Barrels, "EAQ-234-432" )
|
||||
|
||||
CargoCarrier = UNIT:FindByName( "Carrier" )
|
||||
|
||||
-- This call will make the Cargo run to the CargoCarrier.
|
||||
-- Upon arrival at the CargoCarrier, the Cargo will be Loaded into the Carrier.
|
||||
-- This process is now fully automated.
|
||||
CargoBarrels:Load( CargoCarrier )
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
InfantryUnitSet = SET_UNIT:New():FilterCategories("ground"):FilterPrefixes("Infantry"):FilterOnce()
|
||||
InfantryUnitSet:Flush()
|
||||
|
||||
InfantryUnitSet = SET_UNIT:New():FilterCategories("ground"):FilterPrefixes("Infantry"):FilterOnce()
|
||||
InfantryUnitSet:Flush()
|
||||
|
||||
|
||||
@ -1,40 +1,40 @@
|
||||
---
|
||||
-- Name: EVT-001 - API Demo 1
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A task shoots another tank. If one of the is dead, the event will be catched.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the tanks shooting each other.
|
||||
-- 2. If one of the tanks die, an event will be catched.
|
||||
-- 3. Observe the surviving unit smoking.
|
||||
|
||||
|
||||
local Tank1 = UNIT:FindByName( "Tank A" )
|
||||
local Tank2 = UNIT:FindByName( "Tank B" )
|
||||
|
||||
Tank1:HandleEvent( EVENTS.Dead )
|
||||
|
||||
Tank2:HandleEvent( EVENTS.Dead )
|
||||
|
||||
--- @param Wrapper.Unit#UNIT self
|
||||
function Tank1:OnEventDead( EventData )
|
||||
|
||||
self:SmokeGreen()
|
||||
end
|
||||
|
||||
--- @param Wrapper.Unit#UNIT self
|
||||
function Tank2:OnEventDead( EventData )
|
||||
|
||||
self:SmokeBlue()
|
||||
end
|
||||
|
||||
function Tank2:OnEventCrash(EventData)
|
||||
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-001 - API Demo 1
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A task shoots another tank. If one of the is dead, the event will be catched.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the tanks shooting each other.
|
||||
-- 2. If one of the tanks die, an event will be catched.
|
||||
-- 3. Observe the surviving unit smoking.
|
||||
|
||||
|
||||
local Tank1 = UNIT:FindByName( "Tank A" )
|
||||
local Tank2 = UNIT:FindByName( "Tank B" )
|
||||
|
||||
Tank1:HandleEvent( EVENTS.Dead )
|
||||
|
||||
Tank2:HandleEvent( EVENTS.Dead )
|
||||
|
||||
--- @param Wrapper.Unit#UNIT self
|
||||
function Tank1:OnEventDead( EventData )
|
||||
|
||||
self:SmokeGreen()
|
||||
end
|
||||
|
||||
--- @param Wrapper.Unit#UNIT self
|
||||
function Tank2:OnEventDead( EventData )
|
||||
|
||||
self:SmokeBlue()
|
||||
end
|
||||
|
||||
function Tank2:OnEventCrash(EventData)
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,74 +1,74 @@
|
||||
---
|
||||
-- Name: EVT-001 - UNIT OnEventShot Stability Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 9 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A couple of planes are firing to each other. Monitor the shot events.
|
||||
-- I am doing a collectgarbage to test the stability of the event handling.
|
||||
-- Also when the planes are destroyed, the event handling should stop etc.
|
||||
-- The tests are on GROUP level.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missiles.
|
||||
-- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the stability of the event handlings.
|
||||
|
||||
PlaneGroupsBlue = {}
|
||||
|
||||
PlaneGroupsRed = {}
|
||||
|
||||
PlaneSpawnBlue = SPAWN
|
||||
:New( "Planes Blue" )
|
||||
:InitLimit( 2, 0 )
|
||||
:SpawnScheduled( 10,0 )
|
||||
:OnSpawnGroup(
|
||||
function( SpawnGroup )
|
||||
SpawnGroupName = SpawnGroup:GetName()
|
||||
PlaneGroupsBlue[SpawnGroupName] = SpawnGroup
|
||||
PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Shot )
|
||||
PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Hit )
|
||||
collectgarbage()
|
||||
PlaneGroupsBlue[SpawnGroupName].OnEventShot = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just fired a missile!", 15, "Alert!" )
|
||||
end
|
||||
PlaneGroupsBlue[SpawnGroupName].OnEventHit = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
PlaneSpawnRed = SPAWN
|
||||
:New( "Planes Red" )
|
||||
:InitLimit( 2, 0 )
|
||||
:SpawnScheduled(10,0)
|
||||
:OnSpawnGroup(
|
||||
function( SpawnGroup )
|
||||
SpawnGroupName = SpawnGroup:GetName()
|
||||
PlaneGroupsRed[SpawnGroupName] = SpawnGroup
|
||||
PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Shot )
|
||||
PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Hit )
|
||||
collectgarbage()
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
PlaneGroupsRed[SpawnGroupName].OnEventShot = function ( self, EventData )
|
||||
self:F( EventData )
|
||||
|
||||
self:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
PlaneGroupsRed[SpawnGroupName].OnEventHit = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just fired a missile!", 15, "Alert!" )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
collectgarbage()
|
||||
BASE:E( "Collected garbage" )
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-001 - UNIT OnEventShot Stability Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 9 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A couple of planes are firing to each other. Monitor the shot events.
|
||||
-- I am doing a collectgarbage to test the stability of the event handling.
|
||||
-- Also when the planes are destroyed, the event handling should stop etc.
|
||||
-- The tests are on GROUP level.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missiles.
|
||||
-- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the stability of the event handlings.
|
||||
|
||||
PlaneGroupsBlue = {}
|
||||
|
||||
PlaneGroupsRed = {}
|
||||
|
||||
PlaneSpawnBlue = SPAWN
|
||||
:New( "Planes Blue" )
|
||||
:InitLimit( 2, 0 )
|
||||
:SpawnScheduled( 10,0 )
|
||||
:OnSpawnGroup(
|
||||
function( SpawnGroup )
|
||||
SpawnGroupName = SpawnGroup:GetName()
|
||||
PlaneGroupsBlue[SpawnGroupName] = SpawnGroup
|
||||
PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Shot )
|
||||
PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Hit )
|
||||
collectgarbage()
|
||||
PlaneGroupsBlue[SpawnGroupName].OnEventShot = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just fired a missile!", 15, "Alert!" )
|
||||
end
|
||||
PlaneGroupsBlue[SpawnGroupName].OnEventHit = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
PlaneSpawnRed = SPAWN
|
||||
:New( "Planes Red" )
|
||||
:InitLimit( 2, 0 )
|
||||
:SpawnScheduled(10,0)
|
||||
:OnSpawnGroup(
|
||||
function( SpawnGroup )
|
||||
SpawnGroupName = SpawnGroup:GetName()
|
||||
PlaneGroupsRed[SpawnGroupName] = SpawnGroup
|
||||
PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Shot )
|
||||
PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Hit )
|
||||
collectgarbage()
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
PlaneGroupsRed[SpawnGroupName].OnEventShot = function ( self, EventData )
|
||||
self:F( EventData )
|
||||
|
||||
self:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
PlaneGroupsRed[SpawnGroupName].OnEventHit = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just fired a missile!", 15, "Alert!" )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
collectgarbage()
|
||||
BASE:E( "Collected garbage" )
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,40 +1,40 @@
|
||||
---
|
||||
-- Name: EVT-002 - UNIT OnEventLand ReSpawn Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 9 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A couple of planes are taking off from an airbase.
|
||||
-- When they land, they send out a message that they landed.
|
||||
-- But! They are automatically respawned upon landing.
|
||||
-- The 2nd time the same plane lands, they should send the message again!!!
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe in the logging, that the event subscriptions are reset when the respawn happens!
|
||||
-- 2. Observe the 2nd time the same plane lands, they should send the message again!!!
|
||||
-- 3. Check the stability of the event handlings.
|
||||
|
||||
PlaneBlueSpawn = SPAWN
|
||||
:New( "PlaneBlue" )
|
||||
:InitLimit(2,0)
|
||||
:InitRepeatOnEngineShutDown()
|
||||
:SpawnScheduled(60,0)
|
||||
:OnSpawnGroup(
|
||||
--- @param Wrapper.Group#GROUP SpawnGroup
|
||||
function( SpawnGroup )
|
||||
SpawnGroup:HandleEvent( EVENTS.Land )
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function SpawnGroup:OnEventLand(EventData)
|
||||
EventData.IniGroup:MessageToAll("Landed",15,"Land Event")
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
collectgarbage()
|
||||
BASE:E( "Collected garbage" )
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-002 - UNIT OnEventLand ReSpawn Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 9 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A couple of planes are taking off from an airbase.
|
||||
-- When they land, they send out a message that they landed.
|
||||
-- But! They are automatically respawned upon landing.
|
||||
-- The 2nd time the same plane lands, they should send the message again!!!
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe in the logging, that the event subscriptions are reset when the respawn happens!
|
||||
-- 2. Observe the 2nd time the same plane lands, they should send the message again!!!
|
||||
-- 3. Check the stability of the event handlings.
|
||||
|
||||
PlaneBlueSpawn = SPAWN
|
||||
:New( "PlaneBlue" )
|
||||
:InitLimit(2,0)
|
||||
:InitRepeatOnEngineShutDown()
|
||||
:SpawnScheduled(60,0)
|
||||
:OnSpawnGroup(
|
||||
--- @param Wrapper.Group#GROUP SpawnGroup
|
||||
function( SpawnGroup )
|
||||
SpawnGroup:HandleEvent( EVENTS.Land )
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function SpawnGroup:OnEventLand(EventData)
|
||||
EventData.IniGroup:MessageToAll("Landed",15,"Land Event")
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
collectgarbage()
|
||||
BASE:E( "Collected garbage" )
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,74 +1,74 @@
|
||||
---
|
||||
-- Name: EVT-001 - UNIT OnEventShot Stability Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 9 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A couple of planes are firing to each other. Monitor the shot events.
|
||||
-- I am doing a collectgarbage to test the stability of the event handling.
|
||||
-- Also when the planes are destroyed, the event handling should stop etc.
|
||||
-- The tests are on GROUP level.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missiles.
|
||||
-- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the stability of the event handlings.
|
||||
|
||||
PlaneGroupsBlue = {}
|
||||
|
||||
PlaneGroupsRed = {}
|
||||
|
||||
PlaneSpawnBlue = SPAWN
|
||||
:New( "Planes Blue" )
|
||||
:InitLimit( 2, 0 )
|
||||
:SpawnScheduled( 10,0 )
|
||||
:OnSpawnGroup(
|
||||
function( SpawnGroup )
|
||||
SpawnGroupName = SpawnGroup:GetName()
|
||||
PlaneGroupsBlue[SpawnGroupName] = SpawnGroup
|
||||
PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Shot )
|
||||
PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Hit )
|
||||
collectgarbage()
|
||||
PlaneGroupsBlue[SpawnGroupName].OnEventShot = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just fired a missile!", 15, "Alert!" )
|
||||
end
|
||||
PlaneGroupsBlue[SpawnGroupName].OnEventHit = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
PlaneSpawnRed = SPAWN
|
||||
:New( "Planes Red" )
|
||||
:InitLimit( 2, 0 )
|
||||
:SpawnScheduled(10,0)
|
||||
:OnSpawnGroup(
|
||||
function( SpawnGroup )
|
||||
SpawnGroupName = SpawnGroup:GetName()
|
||||
PlaneGroupsRed[SpawnGroupName] = SpawnGroup
|
||||
PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Shot )
|
||||
PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Hit )
|
||||
collectgarbage()
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
PlaneGroupsRed[SpawnGroupName].OnEventShot = function ( self, EventData )
|
||||
self:F( EventData )
|
||||
|
||||
self:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
PlaneGroupsRed[SpawnGroupName].OnEventHit = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just fired a missile!", 15, "Alert!" )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
collectgarbage()
|
||||
BASE:E( "Collected garbage" )
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-001 - UNIT OnEventShot Stability Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 9 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A couple of planes are firing to each other. Monitor the shot events.
|
||||
-- I am doing a collectgarbage to test the stability of the event handling.
|
||||
-- Also when the planes are destroyed, the event handling should stop etc.
|
||||
-- The tests are on GROUP level.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missiles.
|
||||
-- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the stability of the event handlings.
|
||||
|
||||
PlaneGroupsBlue = {}
|
||||
|
||||
PlaneGroupsRed = {}
|
||||
|
||||
PlaneSpawnBlue = SPAWN
|
||||
:New( "Planes Blue" )
|
||||
:InitLimit( 2, 0 )
|
||||
:SpawnScheduled( 10,0 )
|
||||
:OnSpawnGroup(
|
||||
function( SpawnGroup )
|
||||
SpawnGroupName = SpawnGroup:GetName()
|
||||
PlaneGroupsBlue[SpawnGroupName] = SpawnGroup
|
||||
PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Shot )
|
||||
PlaneGroupsBlue[SpawnGroupName]:HandleEvent( EVENTS.Hit )
|
||||
collectgarbage()
|
||||
PlaneGroupsBlue[SpawnGroupName].OnEventShot = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just fired a missile!", 15, "Alert!" )
|
||||
end
|
||||
PlaneGroupsBlue[SpawnGroupName].OnEventHit = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
PlaneSpawnRed = SPAWN
|
||||
:New( "Planes Red" )
|
||||
:InitLimit( 2, 0 )
|
||||
:SpawnScheduled(10,0)
|
||||
:OnSpawnGroup(
|
||||
function( SpawnGroup )
|
||||
SpawnGroupName = SpawnGroup:GetName()
|
||||
PlaneGroupsRed[SpawnGroupName] = SpawnGroup
|
||||
PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Shot )
|
||||
PlaneGroupsRed[SpawnGroupName]:HandleEvent( EVENTS.Hit )
|
||||
collectgarbage()
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
PlaneGroupsRed[SpawnGroupName].OnEventShot = function ( self, EventData )
|
||||
self:F( EventData )
|
||||
|
||||
self:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
PlaneGroupsRed[SpawnGroupName].OnEventHit = function( self, EventData )
|
||||
self:F( EventData )
|
||||
self:MessageToAll( "I just fired a missile!", 15, "Alert!" )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
collectgarbage()
|
||||
BASE:E( "Collected garbage" )
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,40 +1,40 @@
|
||||
---
|
||||
-- Name: EVT-002 - UNIT OnEventLand ReSpawn Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 9 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A couple of planes are taking off from an airbase.
|
||||
-- When they land, they send out a message that they landed.
|
||||
-- But! They are automatically respawned upon landing.
|
||||
-- The 2nd time the same plane lands, they should send the message again!!!
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe in the logging, that the event subscriptions are reset when the respawn happens!
|
||||
-- 2. Observe the 2nd time the same plane lands, they should send the message again!!!
|
||||
-- 3. Check the stability of the event handlings.
|
||||
|
||||
PlaneBlueSpawn = SPAWN
|
||||
:New( "PlaneBlue" )
|
||||
:InitLimit(2,0)
|
||||
:InitRepeatOnEngineShutDown()
|
||||
:SpawnScheduled(60,0)
|
||||
:OnSpawnGroup(
|
||||
--- @param Wrapper.Group#GROUP SpawnGroup
|
||||
function( SpawnGroup )
|
||||
SpawnGroup:HandleEvent( EVENTS.Land )
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function SpawnGroup:OnEventLand(EventData)
|
||||
EventData.IniGroup:MessageToAll("Landed",15,"Land Event")
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
collectgarbage()
|
||||
BASE:E( "Collected garbage" )
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-002 - UNIT OnEventLand ReSpawn Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 9 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A couple of planes are taking off from an airbase.
|
||||
-- When they land, they send out a message that they landed.
|
||||
-- But! They are automatically respawned upon landing.
|
||||
-- The 2nd time the same plane lands, they should send the message again!!!
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe in the logging, that the event subscriptions are reset when the respawn happens!
|
||||
-- 2. Observe the 2nd time the same plane lands, they should send the message again!!!
|
||||
-- 3. Check the stability of the event handlings.
|
||||
|
||||
PlaneBlueSpawn = SPAWN
|
||||
:New( "PlaneBlue" )
|
||||
:InitLimit(2,0)
|
||||
:InitRepeatOnEngineShutDown()
|
||||
:SpawnScheduled(60,0)
|
||||
:OnSpawnGroup(
|
||||
--- @param Wrapper.Group#GROUP SpawnGroup
|
||||
function( SpawnGroup )
|
||||
SpawnGroup:HandleEvent( EVENTS.Land )
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function SpawnGroup:OnEventLand(EventData)
|
||||
EventData.IniGroup:MessageToAll("Landed",15,"Land Event")
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
collectgarbage()
|
||||
BASE:E( "Collected garbage" )
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
---
|
||||
-- Name: EVT-100 - UNIT OnEventShot Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A plane is flying in the air and shoots an missile to a ground target.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the plane shooting the missile.
|
||||
-- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_SHOT entry.
|
||||
|
||||
Plane = UNIT:FindByName( "Plane" )
|
||||
|
||||
Plane:HandleEvent( EVENTS.Shot )
|
||||
|
||||
function Plane:OnEventShot( EventData )
|
||||
|
||||
Plane:MessageToAll( "I just fired a missile!", 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-100 - UNIT OnEventShot Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A plane is flying in the air and shoots an missile to a ground target.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the plane shooting the missile.
|
||||
-- 2. Observe when the plane shoots the missile, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_SHOT entry.
|
||||
|
||||
Plane = UNIT:FindByName( "Plane" )
|
||||
|
||||
Plane:HandleEvent( EVENTS.Shot )
|
||||
|
||||
function Plane:OnEventShot( EventData )
|
||||
|
||||
Plane:MessageToAll( "I just fired a missile!", 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,32 +1,32 @@
|
||||
---
|
||||
-- Name: EVT-101 - UNIT OnEventHit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A plane is flying in the air and shoots an missile to a ground target.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the plane shooting the missile.
|
||||
-- 2. Observe when the missile hits the target, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_HIT entry.
|
||||
|
||||
Plane = UNIT:FindByName( "Plane" )
|
||||
|
||||
Tank = UNIT:FindByName( "Tank" )
|
||||
|
||||
Plane:HandleEvent( EVENTS.Hit )
|
||||
Tank:HandleEvent( EVENTS.Hit )
|
||||
|
||||
function Plane:OnEventHit( EventData )
|
||||
|
||||
Plane:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
|
||||
function Tank:OnEventHit( EventData )
|
||||
Tank:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-101 - UNIT OnEventHit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A plane is flying in the air and shoots an missile to a ground target.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the plane shooting the missile.
|
||||
-- 2. Observe when the missile hits the target, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_HIT entry.
|
||||
|
||||
Plane = UNIT:FindByName( "Plane" )
|
||||
|
||||
Tank = UNIT:FindByName( "Tank" )
|
||||
|
||||
Plane:HandleEvent( EVENTS.Hit )
|
||||
Tank:HandleEvent( EVENTS.Hit )
|
||||
|
||||
function Plane:OnEventHit( EventData )
|
||||
|
||||
Plane:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
|
||||
function Tank:OnEventHit( EventData )
|
||||
Tank:MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,33 +1,33 @@
|
||||
---
|
||||
-- Name: EVT-102 - UNIT OnEventTakeoff Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A human plane and an AI plane are taking off from an airfield.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Take-Off the planes from the runway.
|
||||
-- 2. When the planes take-off, observe the message being sent.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_TAKEOFF entry in the dcs.log file.
|
||||
|
||||
PlaneAI = UNIT:FindByName( "PlaneAI" )
|
||||
|
||||
PlaneHuman = UNIT:FindByName( "PlaneHuman" )
|
||||
|
||||
PlaneAI:HandleEvent( EVENTS.Takeoff )
|
||||
PlaneHuman:HandleEvent( EVENTS.Takeoff )
|
||||
|
||||
function PlaneAI:OnEventTakeoff( EventData )
|
||||
|
||||
PlaneHuman:MessageToAll( "AI Taking Off", 15, "Alert!" )
|
||||
end
|
||||
|
||||
function PlaneHuman:OnEventTakeoff( EventData )
|
||||
|
||||
PlaneHuman:MessageToAll( "Player " .. PlaneHuman:GetPlayerName() .. " is Taking Off", 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-102 - UNIT OnEventTakeoff Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A human plane and an AI plane are taking off from an airfield.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Take-Off the planes from the runway.
|
||||
-- 2. When the planes take-off, observe the message being sent.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_TAKEOFF entry in the dcs.log file.
|
||||
|
||||
PlaneAI = UNIT:FindByName( "PlaneAI" )
|
||||
|
||||
PlaneHuman = UNIT:FindByName( "PlaneHuman" )
|
||||
|
||||
PlaneAI:HandleEvent( EVENTS.Takeoff )
|
||||
PlaneHuman:HandleEvent( EVENTS.Takeoff )
|
||||
|
||||
function PlaneAI:OnEventTakeoff( EventData )
|
||||
|
||||
PlaneHuman:MessageToAll( "AI Taking Off", 15, "Alert!" )
|
||||
end
|
||||
|
||||
function PlaneHuman:OnEventTakeoff( EventData )
|
||||
|
||||
PlaneHuman:MessageToAll( "Player " .. PlaneHuman:GetPlayerName() .. " is Taking Off", 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,38 +1,38 @@
|
||||
---
|
||||
-- Name: EVT-103 - UNIT OnEventLand Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- An AI plane is landing on an airfield.
|
||||
-- When the plane landed, a new plane is spawned.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the plane landing.
|
||||
-- 2. When the AI plane lands, observe the new plane being spawned.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file.
|
||||
|
||||
-- Create a variable PlaneAI that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneAI".
|
||||
PlaneAI = UNIT:FindByName( "PlaneAI" )
|
||||
|
||||
-- Create a SPAWN object to spawn a new plane once the hold one lands.
|
||||
SpawnPlane = SPAWN:New( "SpawnPlaneAI" )
|
||||
|
||||
-- Declare a new variable that will hold the new spawned SpawnPlaneAI
|
||||
local NewPlane
|
||||
|
||||
|
||||
-- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield.
|
||||
PlaneAI:HandleEvent( EVENTS.Land )
|
||||
|
||||
-- Because the PlaneAI object is subscribed to the Land event, the following method will be automatically
|
||||
-- called when the land event is happening FOR THE PlaneAI UNIT only!
|
||||
function PlaneAI:OnEventLand( EventData )
|
||||
|
||||
-- Okay, the PlaneAI has landed, now spawn the new plane ( a predator )
|
||||
NewPlane = SpawnPlane:Spawn()
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-103 - UNIT OnEventLand Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- An AI plane is landing on an airfield.
|
||||
-- When the plane landed, a new plane is spawned.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the plane landing.
|
||||
-- 2. When the AI plane lands, observe the new plane being spawned.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file.
|
||||
|
||||
-- Create a variable PlaneAI that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneAI".
|
||||
PlaneAI = UNIT:FindByName( "PlaneAI" )
|
||||
|
||||
-- Create a SPAWN object to spawn a new plane once the hold one lands.
|
||||
SpawnPlane = SPAWN:New( "SpawnPlaneAI" )
|
||||
|
||||
-- Declare a new variable that will hold the new spawned SpawnPlaneAI
|
||||
local NewPlane
|
||||
|
||||
|
||||
-- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield.
|
||||
PlaneAI:HandleEvent( EVENTS.Land )
|
||||
|
||||
-- Because the PlaneAI object is subscribed to the Land event, the following method will be automatically
|
||||
-- called when the land event is happening FOR THE PlaneAI UNIT only!
|
||||
function PlaneAI:OnEventLand( EventData )
|
||||
|
||||
-- Okay, the PlaneAI has landed, now spawn the new plane ( a predator )
|
||||
NewPlane = SpawnPlane:Spawn()
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,35 +1,35 @@
|
||||
---
|
||||
-- Name: EVT-104 - UNIT OnEventCrash Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A human plane is fyling in the air. Crash it into the ground.
|
||||
-- Once you are crashed into the ground, at the place where you crashed, a smoke should start burning ...
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Fly the plane into the ground.
|
||||
-- 2. When your plane crashes, observe a smoke starting to burn right were you crashed.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_CRASH entry in the dcs.log file.
|
||||
|
||||
-- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneHuman".
|
||||
PlaneHuman = UNIT:FindByName( "PlaneHuman" )
|
||||
|
||||
-- Subscribe to the event Crash. The Crash event occurs when a plane crashes into the ground (or into something else).
|
||||
PlaneHuman:HandleEvent( EVENTS.Crash )
|
||||
|
||||
-- Because the PlaneHuman object is subscribed to the Crash event, the following method will be automatically
|
||||
-- called when the Crash event is happening FOR THE PlaneHuman UNIT only!
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function PlaneHuman:OnEventCrash( EventData )
|
||||
|
||||
-- Okay, the PlaneHuman has crashed, now smoke at the x, z position.
|
||||
self:E( "Smoking at the position" )
|
||||
EventData.IniUnit:SmokeOrange()
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-104 - UNIT OnEventCrash Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 7 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A human plane is fyling in the air. Crash it into the ground.
|
||||
-- Once you are crashed into the ground, at the place where you crashed, a smoke should start burning ...
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Fly the plane into the ground.
|
||||
-- 2. When your plane crashes, observe a smoke starting to burn right were you crashed.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_CRASH entry in the dcs.log file.
|
||||
|
||||
-- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneHuman".
|
||||
PlaneHuman = UNIT:FindByName( "PlaneHuman" )
|
||||
|
||||
-- Subscribe to the event Crash. The Crash event occurs when a plane crashes into the ground (or into something else).
|
||||
PlaneHuman:HandleEvent( EVENTS.Crash )
|
||||
|
||||
-- Because the PlaneHuman object is subscribed to the Crash event, the following method will be automatically
|
||||
-- called when the Crash event is happening FOR THE PlaneHuman UNIT only!
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function PlaneHuman:OnEventCrash( EventData )
|
||||
|
||||
-- Okay, the PlaneHuman has crashed, now smoke at the x, z position.
|
||||
self:E( "Smoking at the position" )
|
||||
EventData.IniUnit:SmokeOrange()
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,107 +1,107 @@
|
||||
---
|
||||
-- Name: EVT-105 - UNIT OnEventPlayerEnterUnit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 Dec 2017
|
||||
--
|
||||
-- 2 planes and 2 tanks are located on and near the airport.
|
||||
-- The test is about checking if S_EVENT_PLAYER_ENTER_UNIT is correctly working in DCS single player and multi player.
|
||||
-- The test requires you to jump into the 2 planes and into the 2 tanks using CA.
|
||||
-- Please execute the following scenarios in Single and Multi-Player:
|
||||
--
|
||||
-- 1. Test in Single Player:
|
||||
--
|
||||
-- First we need to get the mission running... To do this, do the following actions:
|
||||
-- - At mission startup, once you get the slots, press the ESC key... The slot selection window will disappear.
|
||||
-- - Then press the ESC key again, and in the window, select the menu option "Select Slot".
|
||||
--
|
||||
-- Next, we select the 2 planes...
|
||||
-- - Select Plane 1 slot. Go to external view. Once you are in the SU-25T, an orange smoke and a message should appear.
|
||||
-- - Select Plane 2 slot. Go to external view. Once you are in the SU-25T, a red smoke and a message should appear.
|
||||
--
|
||||
-- Next, we select the 2 tanks... Select the MAP view using F10, and:
|
||||
-- - Select the Tank 1 unit using the arrow. And then press RALT-J which should jump you into Tank 1. Go to external view. Once you are in the Tank, a blue smoke and a message should appear.
|
||||
-- - Select the Tank 2 unit using the arrow. And then press RALT-J which should jump you into Tank 2. Go to external view. Once you are in the Tank, a green smoke and a message should appear.
|
||||
--
|
||||
--
|
||||
-- 2. Test in Multi Player:
|
||||
--
|
||||
-- Run the mission on a server, and connect to the mission with a client...
|
||||
--
|
||||
-- On the client machine, we select the 2 planes...
|
||||
-- - Select Plane 1 slot. Go to external view. Once you are in the SU-25T, an orange smoke and a message should appear.
|
||||
-- - Select Plane 2 slot. Go to external view. Once you are in the SU-25T, a red smoke and a message should appear.
|
||||
--
|
||||
-- On the client machine, we select the 2 tanks... Select the MAP view using F10, and:
|
||||
-- - Select the Tank 1 unit using the arrow. And then press RALT-J which should jump you into Tank 1. Go to external view. Once you are in the Tank, a blue smoke and a message should appear.
|
||||
-- - Select the Tank 2 unit using the arrow. And then press RALT-J which should jump you into Tank 2. Go to external view. Once you are in the Tank, a green smoke and a message should appear.
|
||||
--
|
||||
--
|
||||
-- If all of this is working correctly, then the fix is correctly patched!
|
||||
|
||||
|
||||
|
||||
-- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "Plane x".
|
||||
Plane1 = CLIENT:FindByName( "Plane 1" )
|
||||
Plane2 = CLIENT:FindByName( "Plane 2" )
|
||||
|
||||
-- Subscribe to the event. The event occurs when a player enters a slot.
|
||||
Plane1:HandleEvent( EVENTS.PlayerEnterUnit )
|
||||
Plane2:HandleEvent( EVENTS.PlayerEnterUnit )
|
||||
|
||||
-- Because the Plane object is subscribed to the PlayerEnterUnit event, the following method will be automatically
|
||||
-- called when the event is happening!
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function Plane1:OnEventPlayerEnterUnit( EventData )
|
||||
|
||||
-- Okay, the Human has entered the unit, now smoke at the x, z position.
|
||||
EventData.IniUnit:SmokeOrange()
|
||||
MESSAGE:NewType( "A human has entered Plane 1", MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function Plane2:OnEventPlayerEnterUnit( EventData )
|
||||
|
||||
-- Okay, the Human has entered the unit, now smoke at the x, z position.
|
||||
EventData.IniUnit:SmokeRed()
|
||||
MESSAGE:NewType( "A human has entered Plane 2", MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--- Now for the ground units
|
||||
Tank1 = UNIT:FindByName( "Tank 1" )
|
||||
Tank2 = UNIT:FindByName( "Tank 2" )
|
||||
|
||||
-- Subscribe to the event. The event occurs when a player enters a slot.
|
||||
Tank1:HandleEvent( EVENTS.PlayerEnterUnit )
|
||||
Tank2:HandleEvent( EVENTS.PlayerEnterUnit )
|
||||
|
||||
|
||||
-- Because the Tank object is subscribed to the PlayerEnterUnit event, the following method will be automatically
|
||||
-- called when the event is happening!
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function Tank1:OnEventPlayerEnterUnit( EventData )
|
||||
|
||||
-- Okay, the Human has entered the unit, now smoke at the x, z position.
|
||||
EventData.IniUnit:SmokeBlue()
|
||||
MESSAGE:NewType( "A human has entered Tank 1", MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function Tank2:OnEventPlayerEnterUnit( EventData )
|
||||
|
||||
-- Okay, the Human has entered the unit, now smoke at the x, z position.
|
||||
EventData.IniUnit:SmokeGreen()
|
||||
MESSAGE:NewType( "A human has entered Tank 2", MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
|
||||
---
|
||||
-- Name: EVT-105 - UNIT OnEventPlayerEnterUnit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 Dec 2017
|
||||
--
|
||||
-- 2 planes and 2 tanks are located on and near the airport.
|
||||
-- The test is about checking if S_EVENT_PLAYER_ENTER_UNIT is correctly working in DCS single player and multi player.
|
||||
-- The test requires you to jump into the 2 planes and into the 2 tanks using CA.
|
||||
-- Please execute the following scenarios in Single and Multi-Player:
|
||||
--
|
||||
-- 1. Test in Single Player:
|
||||
--
|
||||
-- First we need to get the mission running... To do this, do the following actions:
|
||||
-- - At mission startup, once you get the slots, press the ESC key... The slot selection window will disappear.
|
||||
-- - Then press the ESC key again, and in the window, select the menu option "Select Slot".
|
||||
--
|
||||
-- Next, we select the 2 planes...
|
||||
-- - Select Plane 1 slot. Go to external view. Once you are in the SU-25T, an orange smoke and a message should appear.
|
||||
-- - Select Plane 2 slot. Go to external view. Once you are in the SU-25T, a red smoke and a message should appear.
|
||||
--
|
||||
-- Next, we select the 2 tanks... Select the MAP view using F10, and:
|
||||
-- - Select the Tank 1 unit using the arrow. And then press RALT-J which should jump you into Tank 1. Go to external view. Once you are in the Tank, a blue smoke and a message should appear.
|
||||
-- - Select the Tank 2 unit using the arrow. And then press RALT-J which should jump you into Tank 2. Go to external view. Once you are in the Tank, a green smoke and a message should appear.
|
||||
--
|
||||
--
|
||||
-- 2. Test in Multi Player:
|
||||
--
|
||||
-- Run the mission on a server, and connect to the mission with a client...
|
||||
--
|
||||
-- On the client machine, we select the 2 planes...
|
||||
-- - Select Plane 1 slot. Go to external view. Once you are in the SU-25T, an orange smoke and a message should appear.
|
||||
-- - Select Plane 2 slot. Go to external view. Once you are in the SU-25T, a red smoke and a message should appear.
|
||||
--
|
||||
-- On the client machine, we select the 2 tanks... Select the MAP view using F10, and:
|
||||
-- - Select the Tank 1 unit using the arrow. And then press RALT-J which should jump you into Tank 1. Go to external view. Once you are in the Tank, a blue smoke and a message should appear.
|
||||
-- - Select the Tank 2 unit using the arrow. And then press RALT-J which should jump you into Tank 2. Go to external view. Once you are in the Tank, a green smoke and a message should appear.
|
||||
--
|
||||
--
|
||||
-- If all of this is working correctly, then the fix is correctly patched!
|
||||
|
||||
|
||||
|
||||
-- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "Plane x".
|
||||
Plane1 = CLIENT:FindByName( "Plane 1" )
|
||||
Plane2 = CLIENT:FindByName( "Plane 2" )
|
||||
|
||||
-- Subscribe to the event. The event occurs when a player enters a slot.
|
||||
Plane1:HandleEvent( EVENTS.PlayerEnterUnit )
|
||||
Plane2:HandleEvent( EVENTS.PlayerEnterUnit )
|
||||
|
||||
-- Because the Plane object is subscribed to the PlayerEnterUnit event, the following method will be automatically
|
||||
-- called when the event is happening!
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function Plane1:OnEventPlayerEnterUnit( EventData )
|
||||
|
||||
-- Okay, the Human has entered the unit, now smoke at the x, z position.
|
||||
EventData.IniUnit:SmokeOrange()
|
||||
MESSAGE:NewType( "A human has entered Plane 1", MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function Plane2:OnEventPlayerEnterUnit( EventData )
|
||||
|
||||
-- Okay, the Human has entered the unit, now smoke at the x, z position.
|
||||
EventData.IniUnit:SmokeRed()
|
||||
MESSAGE:NewType( "A human has entered Plane 2", MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--- Now for the ground units
|
||||
Tank1 = UNIT:FindByName( "Tank 1" )
|
||||
Tank2 = UNIT:FindByName( "Tank 2" )
|
||||
|
||||
-- Subscribe to the event. The event occurs when a player enters a slot.
|
||||
Tank1:HandleEvent( EVENTS.PlayerEnterUnit )
|
||||
Tank2:HandleEvent( EVENTS.PlayerEnterUnit )
|
||||
|
||||
|
||||
-- Because the Tank object is subscribed to the PlayerEnterUnit event, the following method will be automatically
|
||||
-- called when the event is happening!
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function Tank1:OnEventPlayerEnterUnit( EventData )
|
||||
|
||||
-- Okay, the Human has entered the unit, now smoke at the x, z position.
|
||||
EventData.IniUnit:SmokeBlue()
|
||||
MESSAGE:NewType( "A human has entered Tank 1", MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function Tank2:OnEventPlayerEnterUnit( EventData )
|
||||
|
||||
-- Okay, the Human has entered the unit, now smoke at the x, z position.
|
||||
EventData.IniUnit:SmokeGreen()
|
||||
MESSAGE:NewType( "A human has entered Tank 2", MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
---
|
||||
-- Name: EVT-200 - GROUP OnEventShot Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 07 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missile.
|
||||
-- 2. Observe when the planes shoots the missile, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_SHOT entry.
|
||||
-- 4. The planes of GROUP "Group Plane A", should only send a message when they shoot a missile.
|
||||
-- 5. The planes of GROUP "Group Plane B", should NOT send a message when they shoot a missile.
|
||||
|
||||
PlaneGroup = GROUP:FindByName( "Group Plane A" )
|
||||
|
||||
PlaneGroup:HandleEvent( EVENTS.Shot )
|
||||
|
||||
function PlaneGroup:OnEventShot( EventData )
|
||||
|
||||
self:E( "I just fired a missile and I am part of " .. EventData.IniGroupName )
|
||||
EventData.IniUnit:MessageToAll( "I just fired a missile and I am part of " .. EventData.IniGroupName, 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-200 - GROUP OnEventShot Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 07 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missile.
|
||||
-- 2. Observe when the planes shoots the missile, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_SHOT entry.
|
||||
-- 4. The planes of GROUP "Group Plane A", should only send a message when they shoot a missile.
|
||||
-- 5. The planes of GROUP "Group Plane B", should NOT send a message when they shoot a missile.
|
||||
|
||||
PlaneGroup = GROUP:FindByName( "Group Plane A" )
|
||||
|
||||
PlaneGroup:HandleEvent( EVENTS.Shot )
|
||||
|
||||
function PlaneGroup:OnEventShot( EventData )
|
||||
|
||||
self:E( "I just fired a missile and I am part of " .. EventData.IniGroupName )
|
||||
EventData.IniUnit:MessageToAll( "I just fired a missile and I am part of " .. EventData.IniGroupName, 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
---
|
||||
-- Name: EVT-201 - GROUP OnEventHit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 08 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missile.
|
||||
-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_HIT entry.
|
||||
-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit.
|
||||
-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit.
|
||||
|
||||
TanksGroup = GROUP:FindByName( "Group Tanks A" )
|
||||
|
||||
TanksGroup:HandleEvent( EVENTS.Hit )
|
||||
|
||||
function TanksGroup:OnEventHit( EventData )
|
||||
|
||||
self:E( "I just got hit and I am part of " .. EventData.TgtGroupName )
|
||||
EventData.TgtUnit:MessageToAll( "I just got hit and I am part of " .. EventData.TgtGroupName, 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-201 - GROUP OnEventHit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 08 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missile.
|
||||
-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_HIT entry.
|
||||
-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit.
|
||||
-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit.
|
||||
|
||||
TanksGroup = GROUP:FindByName( "Group Tanks A" )
|
||||
|
||||
TanksGroup:HandleEvent( EVENTS.Hit )
|
||||
|
||||
function TanksGroup:OnEventHit( EventData )
|
||||
|
||||
self:E( "I just got hit and I am part of " .. EventData.TgtGroupName )
|
||||
EventData.TgtUnit:MessageToAll( "I just got hit and I am part of " .. EventData.TgtGroupName, 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
---
|
||||
-- Name: EVT-201 - GROUP OnEventHit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 08 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missile.
|
||||
-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_HIT entry.
|
||||
-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit.
|
||||
-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit.
|
||||
|
||||
TanksGroup = GROUP:FindByName( "Group Tanks A" )
|
||||
|
||||
TanksGroup:HandleEvent( EVENTS.Hit )
|
||||
|
||||
function TanksGroup:OnEventHit( EventData )
|
||||
|
||||
self:E( "I just got hit and I am part of " .. EventData.TgtGroupName )
|
||||
EventData.TgtUnit:MessageToAll( "I just got hit and I am part of " .. EventData.TgtGroupName, 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-201 - GROUP OnEventHit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 08 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missile.
|
||||
-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_HIT entry.
|
||||
-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit.
|
||||
-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit.
|
||||
|
||||
TanksGroup = GROUP:FindByName( "Group Tanks A" )
|
||||
|
||||
TanksGroup:HandleEvent( EVENTS.Hit )
|
||||
|
||||
function TanksGroup:OnEventHit( EventData )
|
||||
|
||||
self:E( "I just got hit and I am part of " .. EventData.TgtGroupName )
|
||||
EventData.TgtUnit:MessageToAll( "I just got hit and I am part of " .. EventData.TgtGroupName, 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,34 +1,34 @@
|
||||
---
|
||||
-- Name: EVT-204 - GROUP OnEventCrash Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 29 May 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A human plane is fyling in the air. Crash it into the ground.
|
||||
-- Once you are crashed into the ground, at the place where you crashed, a smoke should start burning ...
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Fly the plane into the ground.
|
||||
-- 2. When your plane crashes, observe a smoke starting to burn right were you crashed.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_CRASH entry in the dcs.log file.
|
||||
|
||||
|
||||
-- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneHuman".
|
||||
PlaneHumanGroup = GROUP:FindByName( "PlaneGroup" )
|
||||
|
||||
-- Subscribe to the event Crash. The Crash event occurs when a plane crashes into the ground (or into something else).
|
||||
PlaneHumanGroup:HandleEvent( EVENTS.Crash )
|
||||
|
||||
-- Because the PlaneHuman object is subscribed to the Crash event, the following method will be automatically
|
||||
-- called when the Crash event is happening FOR THE PlaneHuman UNIT only!
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function PlaneHumanGroup:OnEventCrash( EventData )
|
||||
|
||||
-- Okay, the PlaneHuman has crashed, now smoke at the x, z position.
|
||||
self:E( "Smoking at the position" )
|
||||
EventData.IniUnit:SmokeOrange()
|
||||
end
|
||||
---
|
||||
-- Name: EVT-204 - GROUP OnEventCrash Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 29 May 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A human plane is fyling in the air. Crash it into the ground.
|
||||
-- Once you are crashed into the ground, at the place where you crashed, a smoke should start burning ...
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Fly the plane into the ground.
|
||||
-- 2. When your plane crashes, observe a smoke starting to burn right were you crashed.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_CRASH entry in the dcs.log file.
|
||||
|
||||
|
||||
-- Create a variable PlaneHuman that holds a reference to UNIT object (created by moose at the beginning of the mission) with the name "PlaneHuman".
|
||||
PlaneHumanGroup = GROUP:FindByName( "PlaneGroup" )
|
||||
|
||||
-- Subscribe to the event Crash. The Crash event occurs when a plane crashes into the ground (or into something else).
|
||||
PlaneHumanGroup:HandleEvent( EVENTS.Crash )
|
||||
|
||||
-- Because the PlaneHuman object is subscribed to the Crash event, the following method will be automatically
|
||||
-- called when the Crash event is happening FOR THE PlaneHuman UNIT only!
|
||||
|
||||
--- @param self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function PlaneHumanGroup:OnEventCrash( EventData )
|
||||
|
||||
-- Okay, the PlaneHuman has crashed, now smoke at the x, z position.
|
||||
self:E( "Smoking at the position" )
|
||||
EventData.IniUnit:SmokeOrange()
|
||||
end
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
---
|
||||
-- Name: EVT-205 - GROUP OnEventDead Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 29 May 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missile.
|
||||
-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_HIT entry.
|
||||
-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit.
|
||||
-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit.
|
||||
|
||||
TanksGroup = GROUP:FindByName( "Group Tanks A" )
|
||||
|
||||
TanksGroup:HandleEvent( EVENTS.Dead )
|
||||
|
||||
function TanksGroup:OnEventDead( EventData )
|
||||
|
||||
self:E( "I just got dead and I am part of " .. EventData.IniGroupName )
|
||||
EventData.IniUnit:MessageToAll( "I just got dead and I am part of " .. EventData.IniGroupName, 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-205 - GROUP OnEventDead Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 29 May 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Two groups of planes are flying in the air and shoot an missile to a multitude of ground targets.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the planes shooting the missile.
|
||||
-- 2. Observe when the planes shoots the missile, and hit the group Tanks A, a dcs.log entry is written in the logging.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_HIT entry.
|
||||
-- 4. The tanks of GROUP "Group Tanks A", should only send a message when they get hit.
|
||||
-- 5. The tanks of GROUP "Group Tanks B", should NOT send a message when they get hit.
|
||||
|
||||
TanksGroup = GROUP:FindByName( "Group Tanks A" )
|
||||
|
||||
TanksGroup:HandleEvent( EVENTS.Dead )
|
||||
|
||||
function TanksGroup:OnEventDead( EventData )
|
||||
|
||||
self:E( "I just got dead and I am part of " .. EventData.IniGroupName )
|
||||
EventData.IniUnit:MessageToAll( "I just got dead and I am part of " .. EventData.IniGroupName, 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,34 +1,34 @@
|
||||
---
|
||||
-- Name: EVT-401 - Generic OnEventHit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Ground targets are shooting each other.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the ground forces shooting each other.
|
||||
-- 2. Observe when a tank receives a hit, a dcs.log entry is written in the logging.
|
||||
-- 3. The generic EventHandler objects should receive the hit events.
|
||||
|
||||
CC = COMMANDCENTER:New( UNIT:FindByName( "HQ" ), "HQ" )
|
||||
|
||||
EventHandler1 = EVENTHANDLER:New()
|
||||
EventHandler2 = EVENTHANDLER:New()
|
||||
|
||||
EventHandler1:HandleEvent( EVENTS.Hit )
|
||||
EventHandler2:HandleEvent( EVENTS.Hit )
|
||||
|
||||
function EventHandler1:OnEventHit( EventData )
|
||||
self:E("hello 1")
|
||||
CC:GetPositionable():MessageToAll( "I just got hit!", 15 , "Alert!" )
|
||||
end
|
||||
|
||||
function EventHandler2:OnEventHit( EventData )
|
||||
self:E("hello 2")
|
||||
CC:GetPositionable():MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-401 - Generic OnEventHit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Ground targets are shooting each other.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the ground forces shooting each other.
|
||||
-- 2. Observe when a tank receives a hit, a dcs.log entry is written in the logging.
|
||||
-- 3. The generic EventHandler objects should receive the hit events.
|
||||
|
||||
CC = COMMANDCENTER:New( UNIT:FindByName( "HQ" ), "HQ" )
|
||||
|
||||
EventHandler1 = EVENTHANDLER:New()
|
||||
EventHandler2 = EVENTHANDLER:New()
|
||||
|
||||
EventHandler1:HandleEvent( EVENTS.Hit )
|
||||
EventHandler2:HandleEvent( EVENTS.Hit )
|
||||
|
||||
function EventHandler1:OnEventHit( EventData )
|
||||
self:E("hello 1")
|
||||
CC:GetPositionable():MessageToAll( "I just got hit!", 15 , "Alert!" )
|
||||
end
|
||||
|
||||
function EventHandler2:OnEventHit( EventData )
|
||||
self:E("hello 2")
|
||||
CC:GetPositionable():MessageToAll( "I just got hit!", 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,26 +1,26 @@
|
||||
---
|
||||
-- Name: EVT-402 - Generic OnEventMissionEnd Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Test mission end event handler.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe when the mission ends, a dcs.log entry is written in the logging.
|
||||
-- 2. The generic EventHandler objects should be called, and a log entry in dcs.log should be written.
|
||||
|
||||
CC = COMMANDCENTER:New( UNIT:FindByName( "HQ" ), "HQ" )
|
||||
|
||||
EventHandler = EVENTHANDLER:New()
|
||||
|
||||
EventHandler:HandleEvent( EVENTS.MissionEnd )
|
||||
|
||||
function EventHandler:OnEventMissionEnd( EventData )
|
||||
self:E("Mission End")
|
||||
end
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-402 - Generic OnEventMissionEnd Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Test mission end event handler.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe when the mission ends, a dcs.log entry is written in the logging.
|
||||
-- 2. The generic EventHandler objects should be called, and a log entry in dcs.log should be written.
|
||||
|
||||
CC = COMMANDCENTER:New( UNIT:FindByName( "HQ" ), "HQ" )
|
||||
|
||||
EventHandler = EVENTHANDLER:New()
|
||||
|
||||
EventHandler:HandleEvent( EVENTS.MissionEnd )
|
||||
|
||||
function EventHandler:OnEventMissionEnd( EventData )
|
||||
self:E("Mission End")
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,32 +1,32 @@
|
||||
---
|
||||
-- Name: EVT-401 - Generic OnEventHit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Ground targets are shooting each other.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the ground forces shooting each other.
|
||||
-- 2. Observe when a tank receives a hit, a dcs.log entry is written in the logging.
|
||||
-- 3. The generic EventHandler objects should receive the hit events.
|
||||
|
||||
CC = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "HQ" )
|
||||
|
||||
EventHandler1 = EVENTHANDLER:New()
|
||||
|
||||
|
||||
EventHandler1:HandleEvent( EVENTS.Birth )
|
||||
|
||||
--- @param Core.Event#EVENT self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function EventHandler1:OnEventBirth( EventData )
|
||||
self:E("hello 1")
|
||||
self:E( EventData.IniUnit:GetName() )
|
||||
CC:GetPositionable():MessageToAll( "I just got born!", 15 , "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-401 - Generic OnEventHit Example
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Ground targets are shooting each other.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the ground forces shooting each other.
|
||||
-- 2. Observe when a tank receives a hit, a dcs.log entry is written in the logging.
|
||||
-- 3. The generic EventHandler objects should receive the hit events.
|
||||
|
||||
CC = COMMANDCENTER:New( GROUP:FindByName( "HQ" ), "HQ" )
|
||||
|
||||
EventHandler1 = EVENTHANDLER:New()
|
||||
|
||||
|
||||
EventHandler1:HandleEvent( EVENTS.Birth )
|
||||
|
||||
--- @param Core.Event#EVENT self
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function EventHandler1:OnEventBirth( EventData )
|
||||
self:E("hello 1")
|
||||
self:E( EventData.IniUnit:GetName() )
|
||||
CC:GetPositionable():MessageToAll( "I just got born!", 15 , "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,63 +1,63 @@
|
||||
---
|
||||
-- Name: EVT-103 - OnEventLand Example
|
||||
-- Author: CraigOwen
|
||||
-- Date Created: 12 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A client plane is landing on an airfield, trying to pick a rope in the landing zones.
|
||||
-- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Land the plane.
|
||||
-- 2. When the plane landed, observe your message and the signal.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file.
|
||||
|
||||
-- Create a unit which signalizes if the client landed good.
|
||||
signal = UNIT:FindByName("LandingZoneChallenge - Signal")
|
||||
|
||||
-- Create the zones used for the landing check
|
||||
-- Init Zone
|
||||
InitZone = ZONE:New("LandingChallange - InitZone")
|
||||
|
||||
-- Ropes
|
||||
zonegroup1 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 1" )
|
||||
zonegroup2 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 2" )
|
||||
zonegroup3 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 3" )
|
||||
LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1)
|
||||
LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2)
|
||||
LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3)
|
||||
|
||||
-- Create a variable Plane that holds a reference to CLIENT object (created by moose at the beginning of the mission) with the name "Plane".
|
||||
Plane = CLIENT:FindByName( "Plane" )
|
||||
-- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield.
|
||||
Plane:HandleEvent( EVENTS.Land )
|
||||
|
||||
-- This function will be called whenever the Plane-Object (client) lands!
|
||||
function Plane:OnEventLand( EventData )
|
||||
|
||||
-- check wether the client landet at the right airport, where the challenge is located
|
||||
if not Plane:IsInZone(InitZone) then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if the touchdown took place inside of one of the zones
|
||||
if Plane:IsInZone(LandZoneRope1) then
|
||||
MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareGreen()
|
||||
elseif Plane:IsInZone(LandZoneRope2) then
|
||||
MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareYellow()
|
||||
elseif Plane:IsInZone(LandZoneRope3) then
|
||||
MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareRed()
|
||||
else
|
||||
MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-103 - OnEventLand Example
|
||||
-- Author: CraigOwen
|
||||
-- Date Created: 12 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A client plane is landing on an airfield, trying to pick a rope in the landing zones.
|
||||
-- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Land the plane.
|
||||
-- 2. When the plane landed, observe your message and the signal.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file.
|
||||
|
||||
-- Create a unit which signalizes if the client landed good.
|
||||
signal = UNIT:FindByName("LandingZoneChallenge - Signal")
|
||||
|
||||
-- Create the zones used for the landing check
|
||||
-- Init Zone
|
||||
InitZone = ZONE:New("LandingChallange - InitZone")
|
||||
|
||||
-- Ropes
|
||||
zonegroup1 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 1" )
|
||||
zonegroup2 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 2" )
|
||||
zonegroup3 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 3" )
|
||||
LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1)
|
||||
LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2)
|
||||
LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3)
|
||||
|
||||
-- Create a variable Plane that holds a reference to CLIENT object (created by moose at the beginning of the mission) with the name "Plane".
|
||||
Plane = CLIENT:FindByName( "Plane" )
|
||||
-- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield.
|
||||
Plane:HandleEvent( EVENTS.Land )
|
||||
|
||||
-- This function will be called whenever the Plane-Object (client) lands!
|
||||
function Plane:OnEventLand( EventData )
|
||||
|
||||
-- check wether the client landet at the right airport, where the challenge is located
|
||||
if not Plane:IsInZone(InitZone) then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if the touchdown took place inside of one of the zones
|
||||
if Plane:IsInZone(LandZoneRope1) then
|
||||
MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareGreen()
|
||||
elseif Plane:IsInZone(LandZoneRope2) then
|
||||
MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareYellow()
|
||||
elseif Plane:IsInZone(LandZoneRope3) then
|
||||
MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareRed()
|
||||
else
|
||||
MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
MESSAGE:New("Try to land on the runway in between the red trucks.", 15, "Landing challenge"):ToClient(Plane)
|
||||
@ -1,63 +1,63 @@
|
||||
---
|
||||
-- Name: EVT-103 - OnEventLand Example
|
||||
-- Author: CraigOwen
|
||||
-- Date Created: 12 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A client plane is landing on an airfield, trying to pick a rope in the landing zones.
|
||||
-- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Land the plane.
|
||||
-- 2. When the plane landed, observe your message and the signal.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file.
|
||||
|
||||
-- Create a unit which signalizes if the client landed good.
|
||||
signal = UNIT:FindByName("LandingZoneChallenge - Signal")
|
||||
|
||||
-- Create the zones used for the landing check
|
||||
-- Init Zone
|
||||
InitZone = ZONE:New("LandingChallange - InitZone")
|
||||
|
||||
-- Ropes
|
||||
zonegroup1 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 1" )
|
||||
zonegroup2 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 2" )
|
||||
zonegroup3 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 3" )
|
||||
LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1)
|
||||
LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2)
|
||||
LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3)
|
||||
|
||||
-- Create a variable Plane that holds a reference to CLIENT object (created by moose at the beginning of the mission) with the name "Plane".
|
||||
Plane = CLIENT:FindByName( "Plane" )
|
||||
-- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield.
|
||||
Plane:HandleEvent( EVENTS.Land )
|
||||
|
||||
-- This function will be called whenever the Plane-Object (client) lands!
|
||||
function Plane:OnEventLand( EventData )
|
||||
|
||||
-- check wether the client landet at the right airport, where the challenge is located
|
||||
if not Plane:IsInZone(InitZone) then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if the touchdown took place inside of one of the zones
|
||||
if Plane:IsInZone(LandZoneRope1) then
|
||||
MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareGreen()
|
||||
elseif Plane:IsInZone(LandZoneRope2) then
|
||||
MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareYellow()
|
||||
elseif Plane:IsInZone(LandZoneRope3) then
|
||||
MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareRed()
|
||||
else
|
||||
MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-103 - OnEventLand Example
|
||||
-- Author: CraigOwen
|
||||
-- Date Created: 12 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A client plane is landing on an airfield, trying to pick a rope in the landing zones.
|
||||
-- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Land the plane.
|
||||
-- 2. When the plane landed, observe your message and the signal.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file.
|
||||
|
||||
-- Create a unit which signalizes if the client landed good.
|
||||
signal = UNIT:FindByName("LandingZoneChallenge - Signal")
|
||||
|
||||
-- Create the zones used for the landing check
|
||||
-- Init Zone
|
||||
InitZone = ZONE:New("LandingChallange - InitZone")
|
||||
|
||||
-- Ropes
|
||||
zonegroup1 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 1" )
|
||||
zonegroup2 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 2" )
|
||||
zonegroup3 = GROUP:FindByName("LandingZoneChallenge - RopeGroup 3" )
|
||||
LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1)
|
||||
LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2)
|
||||
LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3)
|
||||
|
||||
-- Create a variable Plane that holds a reference to CLIENT object (created by moose at the beginning of the mission) with the name "Plane".
|
||||
Plane = CLIENT:FindByName( "Plane" )
|
||||
-- Subscribe to the event Land. The Land event occurs when a plane lands at an airfield.
|
||||
Plane:HandleEvent( EVENTS.Land )
|
||||
|
||||
-- This function will be called whenever the Plane-Object (client) lands!
|
||||
function Plane:OnEventLand( EventData )
|
||||
|
||||
-- check wether the client landet at the right airport, where the challenge is located
|
||||
if not Plane:IsInZone(InitZone) then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if the touchdown took place inside of one of the zones
|
||||
if Plane:IsInZone(LandZoneRope1) then
|
||||
MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareGreen()
|
||||
elseif Plane:IsInZone(LandZoneRope2) then
|
||||
MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareYellow()
|
||||
elseif Plane:IsInZone(LandZoneRope3) then
|
||||
MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
signal:FlareRed()
|
||||
else
|
||||
MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( Plane )
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
MESSAGE:New("Try to land on the runway in between the red trucks.", 15, "Landing challenge"):ToClient(Plane)
|
||||
@ -1,151 +1,151 @@
|
||||
---
|
||||
-- Name: EVT-103 - OnEventLand LandingChallengeComplex
|
||||
-- Author: CraigOwen
|
||||
-- Date Created: 12 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Approaching the airfield the client gets a message and can try to land inside the landing zones.
|
||||
-- Here we want all clients to participate in the challenge, not only one.
|
||||
-- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Land one of the planes.
|
||||
-- 2. While landing the plane, observe your message and the signal (flare).
|
||||
-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file.
|
||||
|
||||
-- In this advanced challenge we want to make sure all the following.
|
||||
-- 1. The challenge takes place at a certain airfield.
|
||||
-- 2. All clients can repeat the challange at any time, try after try.
|
||||
-- 3. All clients approaching the airport get a message indicating the challenge.
|
||||
-- 4. There is no useraction needet to participate in this, providing full focus on the task.
|
||||
|
||||
-- So lets go then... in five steps
|
||||
-- 1. Create a unit to signalize (flare) whenever a client landed correctly
|
||||
-- 2. Create Zones
|
||||
-- 3. Create a set of clients
|
||||
-- 4. Handle the EVENT.Land for all clients in the set using the signal unit
|
||||
-- 5. Create a scheduler checking for clients in zones
|
||||
|
||||
-- 1. Create a unit which signalizes if the client landed good.
|
||||
signal = UNIT:FindByName("LandingZoneChallenge - Signal")
|
||||
|
||||
-- 2. Create Zones
|
||||
-- Init Zone - This is the global Zone for the LandingChallenge
|
||||
InitZone = ZONE:New("LandingChallange - InitZone")
|
||||
|
||||
--Ingress Zone - This Zone tries to asure the client approaches the runway from the right side
|
||||
IngressZoneTemplate = GROUP:FindByName( "LandingZoneChallenge - IngressZone" )
|
||||
IngressZone = ZONE_POLYGON:New( "IngressZone", IngressZoneTemplate )
|
||||
|
||||
-- Ropes - theese zones will simulate the ropes on a carrier.
|
||||
zonegroup1 = GROUP:FindByName("LandingZoneChallenge - Rope 1" )
|
||||
zonegroup2 = GROUP:FindByName("LandingZoneChallenge - Rope 2" )
|
||||
zonegroup3 = GROUP:FindByName("LandingZoneChallenge - Rope 3" )
|
||||
LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1)
|
||||
LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2)
|
||||
LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3)
|
||||
|
||||
|
||||
-- 3. Create a set of clients
|
||||
-- In this example we do not want to handle the event for one specific client, but rather for all red plane clients.
|
||||
-- To achieve this, we start with filtering the clients and saving those into the "BlueClients" variable
|
||||
RedClients = SET_CLIENT:New():FilterCoalitions("red"):FilterStart()
|
||||
|
||||
|
||||
-- 4. We want to let every client subscribe to the event EVENT.Land. This event occurs when a plane lands. Be aware that this could be any airfield at this point.
|
||||
-- To do so, we run the ForEachClient method on our set of clients and call a function taking the client as parameter
|
||||
RedClients:ForEachClient(
|
||||
--- This function will be called for every single client in the set
|
||||
-- @param MooseClient#CLIENT ClientInSet
|
||||
function( ClientInSet )
|
||||
|
||||
-- Inside here we want to do two things.
|
||||
-- 1. Write down the local function doing all the magic.
|
||||
-- 2. Call this function for each ClientInSet
|
||||
|
||||
-- 1. The magic
|
||||
local function ResetClientForZone( MooseClient )
|
||||
--At first we set this client to a state, in wich she/he is not participating in this event
|
||||
MooseClient:SetState( MooseClient, "ZoneStep", "0" )
|
||||
|
||||
--Now we subscribe to the event just like we did in the first example.
|
||||
MooseClient:HandleEvent(EVENTS.Land)
|
||||
|
||||
|
||||
--- Finally we set up the so called handler FOR the event. This is a function wich will determine what happens, whenever a client lands.
|
||||
-- Note here, that the function has the MooseClient in front. So this function will literaly get a part of the client itself.
|
||||
-- Therefore we can refere to "self" inside the function whenever meaning the MooseClient
|
||||
-- The param EventData is a parameter given to all event handlers and providing several data about this particular event.
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function MooseClient:OnEventLand( EventData )
|
||||
|
||||
-- Ok now the client "MooseClient" definetly has landed. And beeing here means being the client. MooseClient <-> self
|
||||
-- So now i want to know 2 things, to verify that i have done everything right.
|
||||
-- 1. I want to know if my(self) landed in the challengeZone, so landing in other places will not react to this challenge
|
||||
-- 2. Furthermore i want to know if my(self) came from the right side.
|
||||
-- In all other cases nothing shell happen, so we reset the client state here and return doin nothing else.
|
||||
if not self:IsInZone(InitZone) or self:GetState( self, "ZoneStep" ) ~= "2" then
|
||||
self:SetState( self, "ZoneStep", "0" )
|
||||
return
|
||||
end
|
||||
|
||||
-- Here we check wich rope was picked and set the signal and message according to it.
|
||||
if self:IsInZone(LandZoneRope1) then
|
||||
MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( self )
|
||||
signal:FlareGreen()
|
||||
elseif self:IsInZone(LandZoneRope2) then
|
||||
MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( self )
|
||||
signal:FlareYellow()
|
||||
elseif self:IsInZone(LandZoneRope3) then
|
||||
MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( self )
|
||||
signal:FlareRed()
|
||||
else
|
||||
MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( self )
|
||||
end
|
||||
|
||||
-- Finally we set the client back to step 1, allowing a new message for landing
|
||||
self:SetState( self, "ZoneStep", "1" )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
-- 2. As we're now all set, we can finally call our function for every ClientInSet
|
||||
ClientInSet:Alive( ResetClientForZone )
|
||||
|
||||
end
|
||||
)
|
||||
|
||||
-- 5. Finally we use a scheduler checking wether clients are inside or outside these zones.
|
||||
LandingChallangeActionsScheduler, LandingChallangeActionsSchedulerID = SCHEDULER:New( nil,
|
||||
function ()
|
||||
|
||||
-- Flying by the airport there will be a message showing that the landing challange is currently in place.
|
||||
-- This will make the ClientState shift from 0 -> 1
|
||||
RedClients:ForEachClientInZone( InitZone,
|
||||
function( MooseClient )
|
||||
BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } )
|
||||
if MooseClient:IsAlive() and MooseClient:GetState( MooseClient, "ZoneStep" ) == "0" then
|
||||
MooseClient:SetState( MooseClient, "ZoneStep", "1" )
|
||||
MESSAGE:New("Welcome to the Landing challenge. If you want to participate, get yourself a landing clearance by ATC and navigate to the landing corridor.", 20, "Landing challenge" ):ToClient( MooseClient )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
-- The client is approaching the runway from the correct side?
|
||||
-- If yes, then shift state from 1 to 2
|
||||
RedClients:ForEachClientInZone( IngressZone,
|
||||
function( MooseClient )
|
||||
BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } )
|
||||
if MooseClient:IsAlive() and MooseClient:GetState( MooseClient, "ZoneStep" ) == "1" then
|
||||
MooseClient:SetState( MooseClient, "ZoneStep", "2" )
|
||||
MESSAGE:New("Ok, now its your turn. Land your airframe and try to get one of the ropes. Good luck!", 15, "Landing challenge" ):ToClient( MooseClient )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
end, {}, 5, 5
|
||||
)
|
||||
|
||||
---
|
||||
-- Name: EVT-103 - OnEventLand LandingChallengeComplex
|
||||
-- Author: CraigOwen
|
||||
-- Date Created: 12 February 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Approaching the airfield the client gets a message and can try to land inside the landing zones.
|
||||
-- Here we want all clients to participate in the challenge, not only one.
|
||||
-- When the plane landed in one of the zones, a vehicle flares and a message ist printed out to the client.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Land one of the planes.
|
||||
-- 2. While landing the plane, observe your message and the signal (flare).
|
||||
-- 3. Check the contents of the fields of the S_EVENT_LAND entry in the dcs.log file.
|
||||
|
||||
-- In this advanced challenge we want to make sure all the following.
|
||||
-- 1. The challenge takes place at a certain airfield.
|
||||
-- 2. All clients can repeat the challange at any time, try after try.
|
||||
-- 3. All clients approaching the airport get a message indicating the challenge.
|
||||
-- 4. There is no useraction needet to participate in this, providing full focus on the task.
|
||||
|
||||
-- So lets go then... in five steps
|
||||
-- 1. Create a unit to signalize (flare) whenever a client landed correctly
|
||||
-- 2. Create Zones
|
||||
-- 3. Create a set of clients
|
||||
-- 4. Handle the EVENT.Land for all clients in the set using the signal unit
|
||||
-- 5. Create a scheduler checking for clients in zones
|
||||
|
||||
-- 1. Create a unit which signalizes if the client landed good.
|
||||
signal = UNIT:FindByName("LandingZoneChallenge - Signal")
|
||||
|
||||
-- 2. Create Zones
|
||||
-- Init Zone - This is the global Zone for the LandingChallenge
|
||||
InitZone = ZONE:New("LandingChallange - InitZone")
|
||||
|
||||
--Ingress Zone - This Zone tries to asure the client approaches the runway from the right side
|
||||
IngressZoneTemplate = GROUP:FindByName( "LandingZoneChallenge - IngressZone" )
|
||||
IngressZone = ZONE_POLYGON:New( "IngressZone", IngressZoneTemplate )
|
||||
|
||||
-- Ropes - theese zones will simulate the ropes on a carrier.
|
||||
zonegroup1 = GROUP:FindByName("LandingZoneChallenge - Rope 1" )
|
||||
zonegroup2 = GROUP:FindByName("LandingZoneChallenge - Rope 2" )
|
||||
zonegroup3 = GROUP:FindByName("LandingZoneChallenge - Rope 3" )
|
||||
LandZoneRope1 = ZONE_POLYGON:New( "Rope1", zonegroup1)
|
||||
LandZoneRope2 = ZONE_POLYGON:New( "Rope2", zonegroup2)
|
||||
LandZoneRope3 = ZONE_POLYGON:New( "Rope3", zonegroup3)
|
||||
|
||||
|
||||
-- 3. Create a set of clients
|
||||
-- In this example we do not want to handle the event for one specific client, but rather for all red plane clients.
|
||||
-- To achieve this, we start with filtering the clients and saving those into the "BlueClients" variable
|
||||
RedClients = SET_CLIENT:New():FilterCoalitions("red"):FilterStart()
|
||||
|
||||
|
||||
-- 4. We want to let every client subscribe to the event EVENT.Land. This event occurs when a plane lands. Be aware that this could be any airfield at this point.
|
||||
-- To do so, we run the ForEachClient method on our set of clients and call a function taking the client as parameter
|
||||
RedClients:ForEachClient(
|
||||
--- This function will be called for every single client in the set
|
||||
-- @param MooseClient#CLIENT ClientInSet
|
||||
function( ClientInSet )
|
||||
|
||||
-- Inside here we want to do two things.
|
||||
-- 1. Write down the local function doing all the magic.
|
||||
-- 2. Call this function for each ClientInSet
|
||||
|
||||
-- 1. The magic
|
||||
local function ResetClientForZone( MooseClient )
|
||||
--At first we set this client to a state, in wich she/he is not participating in this event
|
||||
MooseClient:SetState( MooseClient, "ZoneStep", "0" )
|
||||
|
||||
--Now we subscribe to the event just like we did in the first example.
|
||||
MooseClient:HandleEvent(EVENTS.Land)
|
||||
|
||||
|
||||
--- Finally we set up the so called handler FOR the event. This is a function wich will determine what happens, whenever a client lands.
|
||||
-- Note here, that the function has the MooseClient in front. So this function will literaly get a part of the client itself.
|
||||
-- Therefore we can refere to "self" inside the function whenever meaning the MooseClient
|
||||
-- The param EventData is a parameter given to all event handlers and providing several data about this particular event.
|
||||
-- @param Core.Event#EVENTDATA EventData
|
||||
function MooseClient:OnEventLand( EventData )
|
||||
|
||||
-- Ok now the client "MooseClient" definetly has landed. And beeing here means being the client. MooseClient <-> self
|
||||
-- So now i want to know 2 things, to verify that i have done everything right.
|
||||
-- 1. I want to know if my(self) landed in the challengeZone, so landing in other places will not react to this challenge
|
||||
-- 2. Furthermore i want to know if my(self) came from the right side.
|
||||
-- In all other cases nothing shell happen, so we reset the client state here and return doin nothing else.
|
||||
if not self:IsInZone(InitZone) or self:GetState( self, "ZoneStep" ) ~= "2" then
|
||||
self:SetState( self, "ZoneStep", "0" )
|
||||
return
|
||||
end
|
||||
|
||||
-- Here we check wich rope was picked and set the signal and message according to it.
|
||||
if self:IsInZone(LandZoneRope1) then
|
||||
MESSAGE:New("Great job! You picked the first rope.", 15, "Landing challenge" ):ToClient( self )
|
||||
signal:FlareGreen()
|
||||
elseif self:IsInZone(LandZoneRope2) then
|
||||
MESSAGE:New("Good job! You picked the second rope.", 15, "Landing challenge" ):ToClient( self )
|
||||
signal:FlareYellow()
|
||||
elseif self:IsInZone(LandZoneRope3) then
|
||||
MESSAGE:New("Close! You picked the last rope.", 15, "Landing challenge" ):ToClient( self )
|
||||
signal:FlareRed()
|
||||
else
|
||||
MESSAGE:New("Too bad, no rope picked! Thrust your engines and try again.", 15, "Landing challenge" ):ToClient( self )
|
||||
end
|
||||
|
||||
-- Finally we set the client back to step 1, allowing a new message for landing
|
||||
self:SetState( self, "ZoneStep", "1" )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
-- 2. As we're now all set, we can finally call our function for every ClientInSet
|
||||
ClientInSet:Alive( ResetClientForZone )
|
||||
|
||||
end
|
||||
)
|
||||
|
||||
-- 5. Finally we use a scheduler checking wether clients are inside or outside these zones.
|
||||
LandingChallangeActionsScheduler, LandingChallangeActionsSchedulerID = SCHEDULER:New( nil,
|
||||
function ()
|
||||
|
||||
-- Flying by the airport there will be a message showing that the landing challange is currently in place.
|
||||
-- This will make the ClientState shift from 0 -> 1
|
||||
RedClients:ForEachClientInZone( InitZone,
|
||||
function( MooseClient )
|
||||
BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } )
|
||||
if MooseClient:IsAlive() and MooseClient:GetState( MooseClient, "ZoneStep" ) == "0" then
|
||||
MooseClient:SetState( MooseClient, "ZoneStep", "1" )
|
||||
MESSAGE:New("Welcome to the Landing challenge. If you want to participate, get yourself a landing clearance by ATC and navigate to the landing corridor.", 20, "Landing challenge" ):ToClient( MooseClient )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
-- The client is approaching the runway from the correct side?
|
||||
-- If yes, then shift state from 1 to 2
|
||||
RedClients:ForEachClientInZone( IngressZone,
|
||||
function( MooseClient )
|
||||
BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } )
|
||||
if MooseClient:IsAlive() and MooseClient:GetState( MooseClient, "ZoneStep" ) == "1" then
|
||||
MooseClient:SetState( MooseClient, "ZoneStep", "2" )
|
||||
MESSAGE:New("Ok, now its your turn. Land your airframe and try to get one of the ropes. Good luck!", 15, "Landing challenge" ):ToClient( MooseClient )
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
end, {}, 5, 5
|
||||
)
|
||||
|
||||
MESSAGE:New("Try to land on the runway in between the red trucks located at the right side.", 15, "Landing challenge"):ToAll()
|
||||
@ -1,29 +1,29 @@
|
||||
---
|
||||
-- Name: EVT-600 - OnEventHit Example with a Set of Units
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 6 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A plane is flying in the air and shoots an missile to a ground target.
|
||||
-- It will shoot a couple of tanks units that are part of a Set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the plane shooting the missile.
|
||||
-- 2. Observe when the plane hits a tank, a dcs.log entry is written in the logging.
|
||||
-- 4. Observe the tanks hitting the targets and the messages appear.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_HIT entries.
|
||||
|
||||
Plane = UNIT:FindByName( "Plane" )
|
||||
|
||||
UnitSet = SET_UNIT:New():FilterPrefixes( "Tank" ):FilterStart()
|
||||
|
||||
UnitSet:HandleEvent( EVENTS.Hit )
|
||||
|
||||
function UnitSet:OnEventHit( EventData )
|
||||
|
||||
Plane:MessageToAll( "I just hit a tank! " .. EventData.IniUnit:GetName(), 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
---
|
||||
-- Name: EVT-600 - OnEventHit Example with a Set of Units
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 6 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A plane is flying in the air and shoots an missile to a ground target.
|
||||
-- It will shoot a couple of tanks units that are part of a Set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the plane shooting the missile.
|
||||
-- 2. Observe when the plane hits a tank, a dcs.log entry is written in the logging.
|
||||
-- 4. Observe the tanks hitting the targets and the messages appear.
|
||||
-- 3. Check the contents of the fields of the S_EVENT_HIT entries.
|
||||
|
||||
Plane = UNIT:FindByName( "Plane" )
|
||||
|
||||
UnitSet = SET_UNIT:New():FilterPrefixes( "Tank" ):FilterStart()
|
||||
|
||||
UnitSet:HandleEvent( EVENTS.Hit )
|
||||
|
||||
function UnitSet:OnEventHit( EventData )
|
||||
|
||||
Plane:MessageToAll( "I just hit a tank! " .. EventData.IniUnit:GetName(), 15, "Alert!" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
@ -1,122 +1,122 @@
|
||||
--- Transition Explanation
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Name: Transition Explanation
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 05 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Create a simple FSM.
|
||||
-- Add 2 transitions that will switch state from "Green" to "Red" upon event "Switch".
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- # Status: TESTED 05 Jan 2017
|
||||
|
||||
local FsmDemo = FSM:New() -- #FsmDemo
|
||||
local FsmUnit = UNIT:FindByName( "FlareUnit" )
|
||||
|
||||
FsmDemo:SetStartState( "Green" )
|
||||
|
||||
do FsmDemo:AddTransition( "Green", "Switch", "Red" ) -- FSM Transition for type #FsmDemo.
|
||||
|
||||
--- OnLeave State Transition for Green.
|
||||
-- @function [parent=#FsmDemo] OnLeaveGreen
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter State Transition for Red.
|
||||
-- @function [parent=#FsmDemo] OnEnterRed
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- OnBefore State Transition for Switch.
|
||||
-- @function [parent=#FsmDemo] OnBeforeSwitch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter State Transition for Switch.
|
||||
-- @function [parent=#FsmDemo] OnAfterSwitch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Embedded Event Trigger for Switch.
|
||||
-- @function [parent=#FsmDemo] Switch
|
||||
-- @param #FsmDemo self
|
||||
|
||||
--- Delayed Event Trigger for Switch
|
||||
-- @function [parent=#FsmDemo] __Switch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
end -- FsmDemo
|
||||
|
||||
do FsmDemo:AddTransition( "Red", "Switch", "Green" ) -- FSM Transition for type #FsmDemo.
|
||||
|
||||
--- OnLeave State Transition for Red.
|
||||
-- @function [parent=#FsmDemo] OnLeaveRed
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter State Transition for Green.
|
||||
-- @function [parent=#FsmDemo] OnEnterGreen
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- OnBefore State Transition for Switch.
|
||||
-- @function [parent=#FsmDemo] OnBeforeSwitch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter State Transition for Switch.
|
||||
-- @function [parent=#FsmDemo] OnAfterSwitch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Embedded Event Trigger for Switch.
|
||||
-- @function [parent=#FsmDemo] Switch
|
||||
-- @param #FsmDemo self
|
||||
|
||||
--- Delayed Event Trigger for Switch
|
||||
-- @function [parent=#FsmDemo] __Switch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
end -- FsmDemo
|
||||
|
||||
function FsmDemo:OnAfterSwitch( From, Event, To, FsmUnit )
|
||||
self:E( { From, Event, To, FsmUnit } )
|
||||
if From == "Green" then
|
||||
FsmUnit:Flare(FLARECOLOR.Green)
|
||||
else
|
||||
if From == "Red" then
|
||||
FsmUnit:Flare(FLARECOLOR.Red)
|
||||
end
|
||||
end
|
||||
FsmDemo:__Switch( 5, FsmUnit )
|
||||
end
|
||||
|
||||
FsmDemo:__Switch( 5, FsmUnit )
|
||||
|
||||
--- Transition Explanation
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Name: Transition Explanation
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 05 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Create a simple FSM.
|
||||
-- Add 2 transitions that will switch state from "Green" to "Red" upon event "Switch".
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- # Status: TESTED 05 Jan 2017
|
||||
|
||||
local FsmDemo = FSM:New() -- #FsmDemo
|
||||
local FsmUnit = UNIT:FindByName( "FlareUnit" )
|
||||
|
||||
FsmDemo:SetStartState( "Green" )
|
||||
|
||||
do FsmDemo:AddTransition( "Green", "Switch", "Red" ) -- FSM Transition for type #FsmDemo.
|
||||
|
||||
--- OnLeave State Transition for Green.
|
||||
-- @function [parent=#FsmDemo] OnLeaveGreen
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter State Transition for Red.
|
||||
-- @function [parent=#FsmDemo] OnEnterRed
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- OnBefore State Transition for Switch.
|
||||
-- @function [parent=#FsmDemo] OnBeforeSwitch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter State Transition for Switch.
|
||||
-- @function [parent=#FsmDemo] OnAfterSwitch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Embedded Event Trigger for Switch.
|
||||
-- @function [parent=#FsmDemo] Switch
|
||||
-- @param #FsmDemo self
|
||||
|
||||
--- Delayed Event Trigger for Switch
|
||||
-- @function [parent=#FsmDemo] __Switch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
end -- FsmDemo
|
||||
|
||||
do FsmDemo:AddTransition( "Red", "Switch", "Green" ) -- FSM Transition for type #FsmDemo.
|
||||
|
||||
--- OnLeave State Transition for Red.
|
||||
-- @function [parent=#FsmDemo] OnLeaveRed
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnEnter State Transition for Green.
|
||||
-- @function [parent=#FsmDemo] OnEnterGreen
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- OnBefore State Transition for Switch.
|
||||
-- @function [parent=#FsmDemo] OnBeforeSwitch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @return #boolean Return false to cancel Transition.
|
||||
|
||||
--- OnAfter State Transition for Switch.
|
||||
-- @function [parent=#FsmDemo] OnAfterSwitch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
|
||||
--- Embedded Event Trigger for Switch.
|
||||
-- @function [parent=#FsmDemo] Switch
|
||||
-- @param #FsmDemo self
|
||||
|
||||
--- Delayed Event Trigger for Switch
|
||||
-- @function [parent=#FsmDemo] __Switch
|
||||
-- @param #FsmDemo self
|
||||
-- @param #number Delay The delay in seconds.
|
||||
|
||||
end -- FsmDemo
|
||||
|
||||
function FsmDemo:OnAfterSwitch( From, Event, To, FsmUnit )
|
||||
self:E( { From, Event, To, FsmUnit } )
|
||||
if From == "Green" then
|
||||
FsmUnit:Flare(FLARECOLOR.Green)
|
||||
else
|
||||
if From == "Red" then
|
||||
FsmUnit:Flare(FLARECOLOR.Red)
|
||||
end
|
||||
end
|
||||
FsmDemo:__Switch( 5, FsmUnit )
|
||||
end
|
||||
|
||||
FsmDemo:__Switch( 5, FsmUnit )
|
||||
|
||||
|
||||
@ -1,86 +1,86 @@
|
||||
-------------------------------------------------------------------------
|
||||
-- MOP-100 - MARKEROPS_BASE - Basic Demo
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- MARKEROPS_BASE: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.MarkerOps_Base.html
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- On the F10, call a tanker to start from the carrier. It will fly to
|
||||
-- an initial zone. Set a marker on the F10 map with keyword "TankerDemo".
|
||||
-- The Tanker will fly there. Set a marker on the F10 map with keywords
|
||||
-- "TankerDemo RTB". The tanke will RTB to the carrier.
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: May 2021
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
-- globals
|
||||
mytanker = nil
|
||||
tankergroup = nil
|
||||
TankerAuftrag = nil
|
||||
|
||||
function menucalltanker()
|
||||
|
||||
if not mytanker then
|
||||
-- new MARKEROPS_BASE object
|
||||
mytanker = MARKEROPS_BASE:New("TankerDemo",{"RTB"}) -- Core.MarkerOps_Base#MARKEROPS_BASE
|
||||
-- start FlightGroup
|
||||
tankergroup = FLIGHTGROUP:New("Tanker")
|
||||
tankergroup:SetHomebase(AIRBASE:FindByName("Truman"))
|
||||
tankergroup:SetDefaultRadio(245,"AM",false)
|
||||
tankergroup:SetDespawnAfterLanding()
|
||||
tankergroup:SwitchTACAN(45, "TKR", 1, "X")
|
||||
tankergroup:SetDefaultCallsign(CALLSIGN.Tanker.Texaco,1)
|
||||
-- Mission
|
||||
local InitialHold = ZONE:New("Initial Hold"):GetCoordinate()
|
||||
TankerAuftrag = AUFTRAG:NewTANKER(InitialHold,18000,UTILS.KnotsToAltKIAS(220,18000),90,20,0)
|
||||
TankerAuftrag:SetMissionRange(500)
|
||||
tankergroup:AddMission(TankerAuftrag)
|
||||
else
|
||||
local status = tankergroup:GetState()
|
||||
local m = MESSAGE:New(string.format("Tanker %s ops in status: %s", mytanker.Tag, status),10,"Info",true):ToAll()
|
||||
end
|
||||
|
||||
-- Handler function
|
||||
local function Handler(Keywords,Coord)
|
||||
|
||||
local MustRTB = false
|
||||
for _,_word in pairs (Keywords) do
|
||||
if string.lower(_word) == "rtb" then
|
||||
MustRTB = true
|
||||
end
|
||||
end
|
||||
|
||||
-- cancel current Auftrag
|
||||
TankerAuftrag:Cancel()
|
||||
|
||||
-- check if we need to RTB
|
||||
if MustRTB then
|
||||
tankergroup:RTB(AIRBASE:FindByName("Truman"))
|
||||
else
|
||||
-- no, fly to coordinate of marker
|
||||
local auftrag = AUFTRAG:NewTANKER(Coord,18000,UTILS.KnotsToAltKIAS(220,18000),90,20,0)
|
||||
auftrag:SetMissionRange(500)
|
||||
tankergroup:AddMission(auftrag)
|
||||
TankerAuftrag = auftrag
|
||||
end
|
||||
end
|
||||
|
||||
-- Event functions
|
||||
function mytanker:OnAfterMarkAdded(From,Event,To,Text,Keywords,Coord)
|
||||
local m = MESSAGE:New(string.format("Tanker %s Mark Added.", self.Tag),10,"Info",true):ToAll()
|
||||
Handler(Keywords,Coord)
|
||||
end
|
||||
|
||||
function mytanker:OnAfterMarkChanged(From,Event,To,Text,Keywords,Coord)
|
||||
local m = MESSAGE:New(string.format("Tanker %s Mark Changed.", self.Tag),10,"Info",true):ToAll()
|
||||
Handler(Keywords,Coord)
|
||||
end
|
||||
|
||||
function mytanker:OnAfterMarkDeleted(From,Event,To)
|
||||
local m = MESSAGE:New(string.format("Tanker %s Mark Deleted.", self.Tag),10,"Info",true):ToAll()
|
||||
end
|
||||
end
|
||||
|
||||
MenuTop = MENU_COALITION:New( coalition.side.BLUE,"Call Tanker")
|
||||
MenuTanker = MENU_COALITION_COMMAND:New(coalition.side.BLUE,"Start Tanker",MenuTop,menucalltanker)
|
||||
-------------------------------------------------------------------------
|
||||
-- MOP-100 - MARKEROPS_BASE - Basic Demo
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- MARKEROPS_BASE: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.MarkerOps_Base.html
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- On the F10, call a tanker to start from the carrier. It will fly to
|
||||
-- an initial zone. Set a marker on the F10 map with keyword "TankerDemo".
|
||||
-- The Tanker will fly there. Set a marker on the F10 map with keywords
|
||||
-- "TankerDemo RTB". The tanke will RTB to the carrier.
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: May 2021
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
-- globals
|
||||
mytanker = nil
|
||||
tankergroup = nil
|
||||
TankerAuftrag = nil
|
||||
|
||||
function menucalltanker()
|
||||
|
||||
if not mytanker then
|
||||
-- new MARKEROPS_BASE object
|
||||
mytanker = MARKEROPS_BASE:New("TankerDemo",{"RTB"}) -- Core.MarkerOps_Base#MARKEROPS_BASE
|
||||
-- start FlightGroup
|
||||
tankergroup = FLIGHTGROUP:New("Tanker")
|
||||
tankergroup:SetHomebase(AIRBASE:FindByName("Truman"))
|
||||
tankergroup:SetDefaultRadio(245,"AM",false)
|
||||
tankergroup:SetDespawnAfterLanding()
|
||||
tankergroup:SwitchTACAN(45, "TKR", 1, "X")
|
||||
tankergroup:SetDefaultCallsign(CALLSIGN.Tanker.Texaco,1)
|
||||
-- Mission
|
||||
local InitialHold = ZONE:New("Initial Hold"):GetCoordinate()
|
||||
TankerAuftrag = AUFTRAG:NewTANKER(InitialHold,18000,UTILS.KnotsToAltKIAS(220,18000),90,20,0)
|
||||
TankerAuftrag:SetMissionRange(500)
|
||||
tankergroup:AddMission(TankerAuftrag)
|
||||
else
|
||||
local status = tankergroup:GetState()
|
||||
local m = MESSAGE:New(string.format("Tanker %s ops in status: %s", mytanker.Tag, status),10,"Info",true):ToAll()
|
||||
end
|
||||
|
||||
-- Handler function
|
||||
local function Handler(Keywords,Coord)
|
||||
|
||||
local MustRTB = false
|
||||
for _,_word in pairs (Keywords) do
|
||||
if string.lower(_word) == "rtb" then
|
||||
MustRTB = true
|
||||
end
|
||||
end
|
||||
|
||||
-- cancel current Auftrag
|
||||
TankerAuftrag:Cancel()
|
||||
|
||||
-- check if we need to RTB
|
||||
if MustRTB then
|
||||
tankergroup:RTB(AIRBASE:FindByName("Truman"))
|
||||
else
|
||||
-- no, fly to coordinate of marker
|
||||
local auftrag = AUFTRAG:NewTANKER(Coord,18000,UTILS.KnotsToAltKIAS(220,18000),90,20,0)
|
||||
auftrag:SetMissionRange(500)
|
||||
tankergroup:AddMission(auftrag)
|
||||
TankerAuftrag = auftrag
|
||||
end
|
||||
end
|
||||
|
||||
-- Event functions
|
||||
function mytanker:OnAfterMarkAdded(From,Event,To,Text,Keywords,Coord)
|
||||
local m = MESSAGE:New(string.format("Tanker %s Mark Added.", self.Tag),10,"Info",true):ToAll()
|
||||
Handler(Keywords,Coord)
|
||||
end
|
||||
|
||||
function mytanker:OnAfterMarkChanged(From,Event,To,Text,Keywords,Coord)
|
||||
local m = MESSAGE:New(string.format("Tanker %s Mark Changed.", self.Tag),10,"Info",true):ToAll()
|
||||
Handler(Keywords,Coord)
|
||||
end
|
||||
|
||||
function mytanker:OnAfterMarkDeleted(From,Event,To)
|
||||
local m = MESSAGE:New(string.format("Tanker %s Mark Deleted.", self.Tag),10,"Info",true):ToAll()
|
||||
end
|
||||
end
|
||||
|
||||
MenuTop = MENU_COALITION:New( coalition.side.BLUE,"Call Tanker")
|
||||
MenuTanker = MENU_COALITION_COMMAND:New(coalition.side.BLUE,"Start Tanker",MenuTop,menucalltanker)
|
||||
|
||||
@ -1,43 +1,43 @@
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the planes within the red coalition.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
|
||||
local Plane1 = GROUP:FindByName( "Red Plane 1" )
|
||||
local Plane2 = GROUP:FindByName( "Red Plane 2" )
|
||||
local Plane3 = GROUP:FindByName( "Red Plane 3" )
|
||||
local Plane4 = GROUP:FindByName( "Red Plane 4" )
|
||||
|
||||
-- This would create a menu for the red coalition under the main DCS "Others" menu.
|
||||
local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" )
|
||||
|
||||
|
||||
local function ShowStatus( StatusText, Coalition )
|
||||
|
||||
Plane1:MessageToRed( StatusText, 15 )
|
||||
Plane2:MessageToRed( StatusText, 15 )
|
||||
end
|
||||
|
||||
local MenuStatus -- Menu#MENU_COALITION
|
||||
local MenuStatusShow -- Menu#MENU_COALITION_COMMAND
|
||||
|
||||
local function RemoveStatusMenu()
|
||||
MenuStatus:Remove()
|
||||
end
|
||||
|
||||
local function AddStatusMenu()
|
||||
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" )
|
||||
MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" )
|
||||
end
|
||||
|
||||
local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
|
||||
local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the planes within the red coalition.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
|
||||
local Plane1 = GROUP:FindByName( "Red Plane 1" )
|
||||
local Plane2 = GROUP:FindByName( "Red Plane 2" )
|
||||
local Plane3 = GROUP:FindByName( "Red Plane 3" )
|
||||
local Plane4 = GROUP:FindByName( "Red Plane 4" )
|
||||
|
||||
-- This would create a menu for the red coalition under the main DCS "Others" menu.
|
||||
local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" )
|
||||
|
||||
|
||||
local function ShowStatus( StatusText, Coalition )
|
||||
|
||||
Plane1:MessageToRed( StatusText, 15 )
|
||||
Plane2:MessageToRed( StatusText, 15 )
|
||||
end
|
||||
|
||||
local MenuStatus -- Menu#MENU_COALITION
|
||||
local MenuStatusShow -- Menu#MENU_COALITION_COMMAND
|
||||
|
||||
local function RemoveStatusMenu()
|
||||
MenuStatus:Remove()
|
||||
end
|
||||
|
||||
local function AddStatusMenu()
|
||||
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" )
|
||||
MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" )
|
||||
end
|
||||
|
||||
local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
|
||||
local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,56 +1,56 @@
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the two clients of planes.
|
||||
-- Each client will receive a different menu structure.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
-- And play with the Add and Remove menu options.
|
||||
|
||||
-- Note that in multi player, this will only work after the DCS clients bug is solved.
|
||||
|
||||
local function ShowStatus( PlaneClient, StatusText, Coalition )
|
||||
|
||||
MESSAGE:New( Coalition, 15 ):ToRed()
|
||||
PlaneClient:Message( StatusText, 15 )
|
||||
end
|
||||
|
||||
local MenuStatus = {}
|
||||
|
||||
local function RemoveStatusMenu( MenuClient )
|
||||
local MenuClientName = MenuClient:GetName()
|
||||
MenuStatus[MenuClientName]:Remove()
|
||||
end
|
||||
|
||||
--- @param Wrapper.Client#CLIENT MenuClient
|
||||
local function AddStatusMenu( MenuClient )
|
||||
local MenuClientName = MenuClient:GetName()
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
MenuStatus[MenuClientName] = MENU_CLIENT:New( MenuClient, "Status for Planes" )
|
||||
MENU_CLIENT_COMMAND:New( MenuClient, "Show Status", MenuStatus[MenuClientName], ShowStatus, MenuClient, "Status of planes is ok!", "Message to Red Coalition" )
|
||||
end
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
local PlaneClient = CLIENT:FindByName( "Plane 1" )
|
||||
if PlaneClient and PlaneClient:IsAlive() then
|
||||
local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" )
|
||||
MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneClient )
|
||||
MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneClient )
|
||||
end
|
||||
end, {}, 10, 10 )
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
local PlaneClient = CLIENT:FindByName( "Plane 2" )
|
||||
if PlaneClient and PlaneClient:IsAlive() then
|
||||
local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" )
|
||||
MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneClient )
|
||||
MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneClient )
|
||||
end
|
||||
end, {}, 10, 10 )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the two clients of planes.
|
||||
-- Each client will receive a different menu structure.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
-- And play with the Add and Remove menu options.
|
||||
|
||||
-- Note that in multi player, this will only work after the DCS clients bug is solved.
|
||||
|
||||
local function ShowStatus( PlaneClient, StatusText, Coalition )
|
||||
|
||||
MESSAGE:New( Coalition, 15 ):ToRed()
|
||||
PlaneClient:Message( StatusText, 15 )
|
||||
end
|
||||
|
||||
local MenuStatus = {}
|
||||
|
||||
local function RemoveStatusMenu( MenuClient )
|
||||
local MenuClientName = MenuClient:GetName()
|
||||
MenuStatus[MenuClientName]:Remove()
|
||||
end
|
||||
|
||||
--- @param Wrapper.Client#CLIENT MenuClient
|
||||
local function AddStatusMenu( MenuClient )
|
||||
local MenuClientName = MenuClient:GetName()
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
MenuStatus[MenuClientName] = MENU_CLIENT:New( MenuClient, "Status for Planes" )
|
||||
MENU_CLIENT_COMMAND:New( MenuClient, "Show Status", MenuStatus[MenuClientName], ShowStatus, MenuClient, "Status of planes is ok!", "Message to Red Coalition" )
|
||||
end
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
local PlaneClient = CLIENT:FindByName( "Plane 1" )
|
||||
if PlaneClient and PlaneClient:IsAlive() then
|
||||
local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" )
|
||||
MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneClient )
|
||||
MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneClient )
|
||||
end
|
||||
end, {}, 10, 10 )
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
local PlaneClient = CLIENT:FindByName( "Plane 2" )
|
||||
if PlaneClient and PlaneClient:IsAlive() then
|
||||
local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" )
|
||||
MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneClient )
|
||||
MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneClient )
|
||||
end
|
||||
end, {}, 10, 10 )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,43 +1,43 @@
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the planes within the red coalition.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
|
||||
local Plane1 = CLIENT:FindByName( "Plane 1" )
|
||||
local Plane2 = CLIENT:FindByName( "Plane 2" )
|
||||
|
||||
|
||||
-- This would create a menu for the red coalition under the main DCS "Others" menu.
|
||||
local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" )
|
||||
|
||||
|
||||
local function ShowStatus( StatusText, Coalition )
|
||||
|
||||
MESSAGE:New( Coalition, 15 ):ToRed()
|
||||
Plane1:Message( StatusText, 15 )
|
||||
Plane2:Message( StatusText, 15 )
|
||||
end
|
||||
|
||||
local MenuStatus -- Menu#MENU_COALITION
|
||||
local MenuStatusShow -- Menu#MENU_COALITION_COMMAND
|
||||
|
||||
local function RemoveStatusMenu()
|
||||
MenuStatus:Remove()
|
||||
end
|
||||
|
||||
local function AddStatusMenu()
|
||||
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" )
|
||||
MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" )
|
||||
end
|
||||
|
||||
local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
|
||||
local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the planes within the red coalition.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
|
||||
local Plane1 = CLIENT:FindByName( "Plane 1" )
|
||||
local Plane2 = CLIENT:FindByName( "Plane 2" )
|
||||
|
||||
|
||||
-- This would create a menu for the red coalition under the main DCS "Others" menu.
|
||||
local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" )
|
||||
|
||||
|
||||
local function ShowStatus( StatusText, Coalition )
|
||||
|
||||
MESSAGE:New( Coalition, 15 ):ToRed()
|
||||
Plane1:Message( StatusText, 15 )
|
||||
Plane2:Message( StatusText, 15 )
|
||||
end
|
||||
|
||||
local MenuStatus -- Menu#MENU_COALITION
|
||||
local MenuStatusShow -- Menu#MENU_COALITION_COMMAND
|
||||
|
||||
local function RemoveStatusMenu()
|
||||
MenuStatus:Remove()
|
||||
end
|
||||
|
||||
local function AddStatusMenu()
|
||||
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" )
|
||||
MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" )
|
||||
end
|
||||
|
||||
local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
|
||||
local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,56 +1,56 @@
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the two groups of planes.
|
||||
-- Each group will receive a different menu structure.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
-- And play with the Add and Remove menu options.
|
||||
|
||||
-- Note that in multi player, this will only work after the DCS groups bug is solved.
|
||||
|
||||
local function ShowStatus( PlaneGroup, StatusText, Coalition )
|
||||
|
||||
MESSAGE:New( Coalition, 15 ):ToRed()
|
||||
PlaneGroup:Message( StatusText, 15 )
|
||||
end
|
||||
|
||||
local MenuStatus = {}
|
||||
|
||||
local function RemoveStatusMenu( MenuGroup )
|
||||
local MenuGroupName = MenuGroup:GetName()
|
||||
MenuStatus[MenuGroupName]:Remove()
|
||||
end
|
||||
|
||||
--- @param Wrapper.Group#GROUP MenuGroup
|
||||
local function AddStatusMenu( MenuGroup )
|
||||
local MenuGroupName = MenuGroup:GetName()
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
MenuStatus[MenuGroupName] = MENU_GROUP:New( MenuGroup, "Status for Planes" )
|
||||
MENU_GROUP_COMMAND:New( MenuGroup, "Show Status", MenuStatus[MenuGroupName], ShowStatus, MenuGroup, "Status of planes is ok!", "Message to Red Coalition" )
|
||||
end
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
local PlaneGroup = GROUP:FindByName( "Plane 1" )
|
||||
if PlaneGroup and PlaneGroup:IsAlive() then
|
||||
local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" )
|
||||
MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneGroup )
|
||||
MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneGroup )
|
||||
end
|
||||
end, {}, 10, 10 )
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
local PlaneGroup = GROUP:FindByName( "Plane 2" )
|
||||
if PlaneGroup and PlaneGroup:IsAlive() then
|
||||
local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" )
|
||||
MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneGroup )
|
||||
MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneGroup )
|
||||
end
|
||||
end, {}, 10, 10 )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the two groups of planes.
|
||||
-- Each group will receive a different menu structure.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
-- And play with the Add and Remove menu options.
|
||||
|
||||
-- Note that in multi player, this will only work after the DCS groups bug is solved.
|
||||
|
||||
local function ShowStatus( PlaneGroup, StatusText, Coalition )
|
||||
|
||||
MESSAGE:New( Coalition, 15 ):ToRed()
|
||||
PlaneGroup:Message( StatusText, 15 )
|
||||
end
|
||||
|
||||
local MenuStatus = {}
|
||||
|
||||
local function RemoveStatusMenu( MenuGroup )
|
||||
local MenuGroupName = MenuGroup:GetName()
|
||||
MenuStatus[MenuGroupName]:Remove()
|
||||
end
|
||||
|
||||
--- @param Wrapper.Group#GROUP MenuGroup
|
||||
local function AddStatusMenu( MenuGroup )
|
||||
local MenuGroupName = MenuGroup:GetName()
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
MenuStatus[MenuGroupName] = MENU_GROUP:New( MenuGroup, "Status for Planes" )
|
||||
MENU_GROUP_COMMAND:New( MenuGroup, "Show Status", MenuStatus[MenuGroupName], ShowStatus, MenuGroup, "Status of planes is ok!", "Message to Red Coalition" )
|
||||
end
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
local PlaneGroup = GROUP:FindByName( "Plane 1" )
|
||||
if PlaneGroup and PlaneGroup:IsAlive() then
|
||||
local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" )
|
||||
MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneGroup )
|
||||
MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneGroup )
|
||||
end
|
||||
end, {}, 10, 10 )
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
local PlaneGroup = GROUP:FindByName( "Plane 2" )
|
||||
if PlaneGroup and PlaneGroup:IsAlive() then
|
||||
local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" )
|
||||
MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneGroup )
|
||||
MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneGroup )
|
||||
end
|
||||
end, {}, 10, 10 )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,43 +1,43 @@
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the planes within the red coalition.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
|
||||
local Plane1 = GROUP:FindByName( "Red Plane 1" )
|
||||
local Plane2 = GROUP:FindByName( "Red Plane 2" )
|
||||
local Plane3 = GROUP:FindByName( "Red Plane 3" )
|
||||
local Plane4 = GROUP:FindByName( "Red Plane 4" )
|
||||
|
||||
-- This would create a menu for the red coalition under the main DCS "Others" menu.
|
||||
local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" )
|
||||
|
||||
|
||||
local function ShowStatus( StatusText, Coalition )
|
||||
|
||||
Plane1:MessageToRed( StatusText, 15 )
|
||||
Plane2:MessageToRed( StatusText, 15 )
|
||||
end
|
||||
|
||||
local MenuStatus -- Menu#MENU_COALITION
|
||||
local MenuStatusShow -- Menu#MENU_COALITION_COMMAND
|
||||
|
||||
local function RemoveStatusMenu()
|
||||
MenuStatus:Remove()
|
||||
end
|
||||
|
||||
local function AddStatusMenu()
|
||||
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" )
|
||||
MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" )
|
||||
end
|
||||
|
||||
local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
|
||||
local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the planes within the red coalition.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
|
||||
local Plane1 = GROUP:FindByName( "Red Plane 1" )
|
||||
local Plane2 = GROUP:FindByName( "Red Plane 2" )
|
||||
local Plane3 = GROUP:FindByName( "Red Plane 3" )
|
||||
local Plane4 = GROUP:FindByName( "Red Plane 4" )
|
||||
|
||||
-- This would create a menu for the red coalition under the main DCS "Others" menu.
|
||||
local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" )
|
||||
|
||||
|
||||
local function ShowStatus( StatusText, Coalition )
|
||||
|
||||
Plane1:MessageToRed( StatusText, 15 )
|
||||
Plane2:MessageToRed( StatusText, 15 )
|
||||
end
|
||||
|
||||
local MenuStatus -- Menu#MENU_COALITION
|
||||
local MenuStatusShow -- Menu#MENU_COALITION_COMMAND
|
||||
|
||||
local function RemoveStatusMenu()
|
||||
MenuStatus:Remove()
|
||||
end
|
||||
|
||||
local function AddStatusMenu()
|
||||
|
||||
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
|
||||
MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" )
|
||||
MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" )
|
||||
end
|
||||
|
||||
local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
|
||||
local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,56 +1,56 @@
|
||||
|
||||
TestMenus = {}
|
||||
|
||||
Menu = MENU_MISSION:New( "Generate Menus" )
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the planes within the red coalition.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
|
||||
local Plane1 = GROUP:FindByName( "Red Plane 1" )
|
||||
local Plane2 = GROUP:FindByName( "Red Plane 2" )
|
||||
local Plane3 = GROUP:FindByName( "Red Plane 3" )
|
||||
local Plane4 = GROUP:FindByName( "Red Plane 4" )
|
||||
|
||||
local CoalitionText = {
|
||||
[coalition.side.BLUE] = "BLUE",
|
||||
[coalition.side.RED] = "RED",
|
||||
}
|
||||
|
||||
local function MenuMessage( Text, Parameter )
|
||||
MESSAGE:NewType( Text .. Parameter, MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
|
||||
local function MenuRemove(m)
|
||||
TestMenus[m]:Remove()
|
||||
end
|
||||
|
||||
local function GenerateMissionMenu()
|
||||
local m = #TestMenus+1
|
||||
TestMenus[m] = MENU_MISSION:New( "Menu Mission "..m )
|
||||
for n = 1, 8 do
|
||||
local MenuMissionCommand = MENU_MISSION_COMMAND:New( "Show Mission "..m.."."..n, TestMenus[m], MenuMessage, "Mission ", m.."."..n)
|
||||
end
|
||||
local MenuMissionRemoveCommand = MENU_MISSION_COMMAND:New( "Remove Mission "..m, TestMenus[m], MenuRemove, m)
|
||||
end
|
||||
|
||||
local function GenerateCoalitionMenu( Coalition )
|
||||
local m = #TestMenus+1
|
||||
TestMenus[m] = MENU_COALITION:New( Coalition, "Menu Coalition "..CoalitionText[Coalition].." ".. m )
|
||||
for n = 1, 8 do
|
||||
local MenuMissionCommand = MENU_COALITION_COMMAND:New( Coalition, "Show Coalition "..CoalitionText[Coalition].." "..m.."."..n, TestMenus[m], MenuMessage, "Coalition ", CoalitionText[Coalition].." "..m.."."..n)
|
||||
end
|
||||
local MenuMissionRemoveCommand = MENU_COALITION_COMMAND:New( Coalition, "Remove Coalition "..CoalitionText[Coalition].." "..m, TestMenus[m], MenuRemove, m)
|
||||
end
|
||||
|
||||
-- Create a mission menu to generate the menus.
|
||||
local MenuMission = MENU_MISSION_COMMAND:New( "Generate Mission Menus", Menu, GenerateMissionMenu )
|
||||
local MenuCoalitionBlue = MENU_MISSION_COMMAND:New( "Generate Blue Coalition Menus", Menu, GenerateCoalitionMenu, coalition.side.BLUE )
|
||||
local MenucoalitionRed = MENU_MISSION_COMMAND:New( "Generate Red Coalition Menus", Menu, GenerateCoalitionMenu, coalition.side.RED )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TestMenus = {}
|
||||
|
||||
Menu = MENU_MISSION:New( "Generate Menus" )
|
||||
|
||||
do
|
||||
-- This demo creates a menu structure for the planes within the red coalition.
|
||||
-- To test, join the planes, then look at the other radio menus (Option F10).
|
||||
-- Then switch planes and check if the menu is still there.
|
||||
|
||||
local Plane1 = GROUP:FindByName( "Red Plane 1" )
|
||||
local Plane2 = GROUP:FindByName( "Red Plane 2" )
|
||||
local Plane3 = GROUP:FindByName( "Red Plane 3" )
|
||||
local Plane4 = GROUP:FindByName( "Red Plane 4" )
|
||||
|
||||
local CoalitionText = {
|
||||
[coalition.side.BLUE] = "BLUE",
|
||||
[coalition.side.RED] = "RED",
|
||||
}
|
||||
|
||||
local function MenuMessage( Text, Parameter )
|
||||
MESSAGE:NewType( Text .. Parameter, MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
|
||||
local function MenuRemove(m)
|
||||
TestMenus[m]:Remove()
|
||||
end
|
||||
|
||||
local function GenerateMissionMenu()
|
||||
local m = #TestMenus+1
|
||||
TestMenus[m] = MENU_MISSION:New( "Menu Mission "..m )
|
||||
for n = 1, 8 do
|
||||
local MenuMissionCommand = MENU_MISSION_COMMAND:New( "Show Mission "..m.."."..n, TestMenus[m], MenuMessage, "Mission ", m.."."..n)
|
||||
end
|
||||
local MenuMissionRemoveCommand = MENU_MISSION_COMMAND:New( "Remove Mission "..m, TestMenus[m], MenuRemove, m)
|
||||
end
|
||||
|
||||
local function GenerateCoalitionMenu( Coalition )
|
||||
local m = #TestMenus+1
|
||||
TestMenus[m] = MENU_COALITION:New( Coalition, "Menu Coalition "..CoalitionText[Coalition].." ".. m )
|
||||
for n = 1, 8 do
|
||||
local MenuMissionCommand = MENU_COALITION_COMMAND:New( Coalition, "Show Coalition "..CoalitionText[Coalition].." "..m.."."..n, TestMenus[m], MenuMessage, "Coalition ", CoalitionText[Coalition].." "..m.."."..n)
|
||||
end
|
||||
local MenuMissionRemoveCommand = MENU_COALITION_COMMAND:New( Coalition, "Remove Coalition "..CoalitionText[Coalition].." "..m, TestMenus[m], MenuRemove, m)
|
||||
end
|
||||
|
||||
-- Create a mission menu to generate the menus.
|
||||
local MenuMission = MENU_MISSION_COMMAND:New( "Generate Mission Menus", Menu, GenerateMissionMenu )
|
||||
local MenuCoalitionBlue = MENU_MISSION_COMMAND:New( "Generate Blue Coalition Menus", Menu, GenerateCoalitionMenu, coalition.side.BLUE )
|
||||
local MenucoalitionRed = MENU_MISSION_COMMAND:New( "Generate Red Coalition Menus", Menu, GenerateCoalitionMenu, coalition.side.RED )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
|
||||
|
||||
|
||||
|
||||
Clean = CLEANUP_AIRBASE:New( AIRBASE.Caucasus.Batumi )
|
||||
Clean:SetCleanMissiles( false )
|
||||
|
||||
|
||||
SpawnRU = SPAWN:New( 'RU Attack Heli Batumi'):InitLimit( 2, 120 ):SpawnScheduled( 10, 0 )
|
||||
|
||||
SpawnUS = SPAWN:New( 'US Attack Heli Batumi'):InitLimit( 2, 120 ):SpawnScheduled( 10, 0 )
|
||||
|
||||
SpawnTransport = SPAWN:New( "US Transport"):SpawnScheduled( 90, 0 )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Clean = CLEANUP_AIRBASE:New( AIRBASE.Caucasus.Batumi )
|
||||
Clean:SetCleanMissiles( false )
|
||||
|
||||
|
||||
SpawnRU = SPAWN:New( 'RU Attack Heli Batumi'):InitLimit( 2, 120 ):SpawnScheduled( 10, 0 )
|
||||
|
||||
SpawnUS = SPAWN:New( 'US Attack Heli Batumi'):InitLimit( 2, 120 ):SpawnScheduled( 10, 0 )
|
||||
|
||||
SpawnTransport = SPAWN:New( "US Transport"):SpawnScheduled( 90, 0 )
|
||||
|
||||
|
||||
@ -1,43 +1,43 @@
|
||||
---
|
||||
-- Name: DES-010 - Designation of AREAS - Threat Level Prioritization
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
-- This test is about the prioritization. First the SAMs should be designated, then the rest.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- - Check if the SAMs are designated first.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a Attack Set, which contains the human player client slots and CA vehicles.
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- This sets the threat level prioritization on
|
||||
RecceDesignation:SetThreatLevelPrioritization( true )
|
||||
|
||||
-- Set the possible laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase with %d for Su-25T" )
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase with %d for A-10A" )
|
||||
|
||||
-- Start the detection process in 5 seconds.
|
||||
RecceDesignation:__Detect( -5 )
|
||||
|
||||
---
|
||||
-- Name: DES-010 - Designation of AREAS - Threat Level Prioritization
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
-- This test is about the prioritization. First the SAMs should be designated, then the rest.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- - Check if the SAMs are designated first.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a Attack Set, which contains the human player client slots and CA vehicles.
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- This sets the threat level prioritization on
|
||||
RecceDesignation:SetThreatLevelPrioritization( true )
|
||||
|
||||
-- Set the possible laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase with %d for Su-25T" )
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase with %d for A-10A" )
|
||||
|
||||
-- Start the detection process in 5 seconds.
|
||||
RecceDesignation:__Detect( -5 )
|
||||
|
||||
|
||||
@ -1,40 +1,40 @@
|
||||
---
|
||||
-- Name: DES-011 - Designation of AREAS - Empty Set with Threat Levels
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 May 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
-- This test is about not failing the process when the Detected Set is empty, and the LaseOn is activated ...
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- - Check nothing is detected, and put lase on.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a Attack Set, which contains the human player client slots and CA vehicles.
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- This sets the threat level prioritization on
|
||||
RecceDesignation:SetThreatLevelPrioritization( true )
|
||||
|
||||
-- Set the possible laser codes.
|
||||
RecceDesignation:SetLaserCodes({1113,1131,1256})
|
||||
|
||||
-- Start the detection process in 5 seconds.
|
||||
RecceDesignation:__Detect( -5 )
|
||||
|
||||
---
|
||||
-- Name: DES-011 - Designation of AREAS - Empty Set with Threat Levels
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 May 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
-- This test is about not failing the process when the Detected Set is empty, and the LaseOn is activated ...
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- - Check nothing is detected, and put lase on.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a Attack Set, which contains the human player client slots and CA vehicles.
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- This sets the threat level prioritization on
|
||||
RecceDesignation:SetThreatLevelPrioritization( true )
|
||||
|
||||
-- Set the possible laser codes.
|
||||
RecceDesignation:SetLaserCodes({1113,1131,1256})
|
||||
|
||||
-- Start the detection process in 5 seconds.
|
||||
RecceDesignation:__Detect( -5 )
|
||||
|
||||
|
||||
@ -1,40 +1,40 @@
|
||||
---
|
||||
-- Name: DES-010 - Designation of AREAS - Threat Level Prioritization
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
-- This test is about the prioritization. First the SAMs should be designated, then the rest.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- - Check if the SAMs are designated first.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a Attack Set, which contains the human player client slots and CA vehicles.
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- This sets the threat level prioritization on
|
||||
RecceDesignation:SetThreatLevelPrioritization( true )
|
||||
|
||||
-- Set the possible laser codes.
|
||||
RecceDesignation:SetLaserCodes({1113,1131,1256})
|
||||
|
||||
-- Start the detection process in 5 seconds.
|
||||
RecceDesignation:__Detect( -5 )
|
||||
|
||||
---
|
||||
-- Name: DES-010 - Designation of AREAS - Threat Level Prioritization
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
-- This test is about the prioritization. First the SAMs should be designated, then the rest.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- - Check if the SAMs are designated first.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a Attack Set, which contains the human player client slots and CA vehicles.
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- This sets the threat level prioritization on
|
||||
RecceDesignation:SetThreatLevelPrioritization( true )
|
||||
|
||||
-- Set the possible laser codes.
|
||||
RecceDesignation:SetLaserCodes({1113,1131,1256})
|
||||
|
||||
-- Start the detection process in 5 seconds.
|
||||
RecceDesignation:__Detect( -5 )
|
||||
|
||||
|
||||
@ -1,40 +1,40 @@
|
||||
---
|
||||
-- Name: DES-020 - Designation of AREAS - Status Menu Flash Activate
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
-- This test is about the prioritization. First the SAMs should be designated, then the rest.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- - Check if the SAMs are designated first.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a Attack Set, which contains the human player client slots and CA vehicles.
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- This sets the current status menu flashing on
|
||||
RecceDesignation:SetFlashStatusMenu( true )
|
||||
|
||||
-- Set the possible laser codes.
|
||||
RecceDesignation:SetLaserCodes({1113,1131,1256})
|
||||
|
||||
-- Start the detection process in 5 seconds.
|
||||
RecceDesignation:__Detect( -5 )
|
||||
|
||||
---
|
||||
-- Name: DES-020 - Designation of AREAS - Status Menu Flash Activate
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
-- This test is about the prioritization. First the SAMs should be designated, then the rest.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- - Check if the SAMs are designated first.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a Attack Set, which contains the human player client slots and CA vehicles.
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- This sets the current status menu flashing on
|
||||
RecceDesignation:SetFlashStatusMenu( true )
|
||||
|
||||
-- Set the possible laser codes.
|
||||
RecceDesignation:SetLaserCodes({1113,1131,1256})
|
||||
|
||||
-- Start the detection process in 5 seconds.
|
||||
RecceDesignation:__Detect( -5 )
|
||||
|
||||
|
||||
@ -1,58 +1,58 @@
|
||||
-- Name: DES-100 - UNITS - Night Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2017
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped per detected UNIT.
|
||||
-- So each DetectedItem contains one detected unit only.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target.
|
||||
-- - Check that when you illuminate a target group, that the target area gets illuminated after a while.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
-- Name: DES-100 - UNITS - Night Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2017
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped per detected UNIT.
|
||||
-- So each DetectedItem contains one detected unit only.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target.
|
||||
-- - Check that when you illuminate a target group, that the target area gets illuminated after a while.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
|
||||
@ -1,58 +1,58 @@
|
||||
-- Name: DES-101 - UNITS - Day Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2018
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped per detected UNIT.
|
||||
-- So each DetectedItem contains one detected unit only.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target.
|
||||
-- - Check that when you smoke a target, that a smoke appears at the target.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
-- Name: DES-101 - UNITS - Day Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2018
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped per detected UNIT.
|
||||
-- So each DetectedItem contains one detected unit only.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target.
|
||||
-- - Check that when you smoke a target, that a smoke appears at the target.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
|
||||
@ -1,58 +1,58 @@
|
||||
-- Name: DES-101 - UNITS - Day Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2018
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped per detected UNIT.
|
||||
-- So each DetectedItem contains one detected unit only.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target.
|
||||
-- - Check that when you smoke a target, that a smoke appears at the target.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
-- Name: DES-101 - UNITS - Day Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2018
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped per detected UNIT.
|
||||
-- So each DetectedItem contains one detected unit only.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target.
|
||||
-- - Check that when you smoke a target, that a smoke appears at the target.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
|
||||
@ -1,57 +1,57 @@
|
||||
-- Name: DES-200 - AREAS - Night Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2017
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target.
|
||||
-- - Check that when you illuminate a target group, that the target area gets illuminated after a while.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
-- Name: DES-200 - AREAS - Night Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2017
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target.
|
||||
-- - Check that when you illuminate a target group, that the target area gets illuminated after a while.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
|
||||
@ -1,57 +1,57 @@
|
||||
-- Name: DES-201 - AREAS - Day Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2017
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target.
|
||||
-- - Check that when you smoke a target, that a smoke appears at the target.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
-- Name: DES-201 - AREAS - Day Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2017
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped in AREAs.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target.
|
||||
-- - Check that when you smoke a target, that a smoke appears at the target.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_AREAS:New( RecceSetGroup, 1000 )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
|
||||
@ -1,57 +1,57 @@
|
||||
-- Name: DES-300 - TYPES - Night Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2017
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped per TYPES of the detected units.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target.
|
||||
-- - Check that when you illuminate a target group, that the target area gets illuminated after a while.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_TYPES:New( RecceSetGroup )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
-- Name: DES-300 - TYPES - Night Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2017
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped per TYPES of the detected units.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you illuminate a target group, that a message appears that the Recce is illuminating the target.
|
||||
-- - Check that when you illuminate a target group, that the target area gets illuminated after a while.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_TYPES:New( RecceSetGroup )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
|
||||
@ -1,57 +1,57 @@
|
||||
-- Name: DES-301 - TYPES - Day Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2018
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped per TYPES of the detected units.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target.
|
||||
-- - Check that when you smoke a target, that a smoke appears at the target.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_TYPES:New( RecceSetGroup )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
-- Name: DES-301 - TYPES - Day Test
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2018
|
||||
--
|
||||
-- Demonstrates the designation of units, which are grouped per TYPES of the detected units.
|
||||
-- A Set of Recce are detecting a large group of units.
|
||||
--
|
||||
-- - Wait until all units are detected by the recce. A report should appear.
|
||||
-- - Once the report appears, the Designation Menu should be generated. In the communication menu, Press F10 and select F1. Designation.
|
||||
-- - Test if one DetectionItem (a designated group) is lased by selecting a Target group from the Designation menu.
|
||||
-- - If a target group is not lased, it should start with "Designate".
|
||||
-- - If a target group is lased, the menu should start with "Lasing".
|
||||
-- - If a target group is smoked, the menu should start with "Smoking".
|
||||
-- - If a target group is illuminated, the menu should start with "Illuminating".
|
||||
-- - Jump into a ground vehicle with the group name "Attack", and activate night vision (FLIR) (N key).
|
||||
-- - With FLIR activated in a ground vehicle, search for the laser beams.
|
||||
-- - Watch the laser beams alternate as targets are being detected or not detected...
|
||||
-- The Recce will try to lase as many targets as possible,
|
||||
-- but only for those targets to be lased,
|
||||
-- and until sufficient laser codes are available.
|
||||
-- - While the target group is lased, check if the available Recce are lasing the most possible targets.
|
||||
-- - Check if all laser codes are being used, but not twice.
|
||||
-- - Check if once a target has been destoyed, that after a while a Recce selects a new target.
|
||||
-- - Check that if all targets are destroyed, that the Recce reports that.
|
||||
-- - Check that while a Recce is lasing a target, that it is marking the target.
|
||||
-- - Check that when you deactive the lasing, that the Recce report the deactivation.
|
||||
-- - Check that when you smoke a target, that a message appears that the Recce is smoking the target.
|
||||
-- - Check that when you smoke a target, that a smoke appears at the target.
|
||||
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
-- Let the RecceSetGroup vehicles in the collection detect targets and group them in AREAS of 1000 meters.
|
||||
RecceDetection = DETECTION_TYPES:New( RecceSetGroup )
|
||||
|
||||
-- Create a
|
||||
AttackSet = SET_GROUP:New():FilterPrefixes("Attack"):FilterStart()
|
||||
|
||||
-- Setup Designation for the AttackSet.
|
||||
RecceDesignation = DESIGNATE:New( CC, RecceDetection, AttackSet )
|
||||
|
||||
-- Generate the random laser codes.
|
||||
RecceDesignation:GenerateLaserCodes()
|
||||
|
||||
-- The su-25T uses a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1113. A special menu option will be added that allows to lase with 1113.
|
||||
RecceDesignation:AddMenuLaserCode( 1113, "Lase for SU-25T (%d)" )
|
||||
|
||||
-- The A-10A etc use a specific laser code to guide its laser guides rockets.
|
||||
-- The code is 1680. A special menu option will be added that allows to lase with 1680.
|
||||
RecceDesignation:AddMenuLaserCode( 1680, "Lase for A-10A (%d)" )
|
||||
|
||||
|
||||
|
||||
@ -1,24 +1,24 @@
|
||||
---
|
||||
-- Name: DET-001 - Detection Areas
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A small blue vehicle with laser detection methods is detecting targets.
|
||||
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
|
||||
-- This demo will group 5 red vehicles in areas. One vehicle is diving from one group to the other.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the flaring of the areas formed
|
||||
-- 2. Observe the smoking of the units detected
|
||||
-- 3. Observe the areas being flexibly changed very detection run.
|
||||
-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second.
|
||||
-- 5. While driving in between the areas, it will have a separate area.
|
||||
|
||||
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
|
||||
|
||||
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
---
|
||||
-- Name: DET-001 - Detection Areas
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A small blue vehicle with laser detection methods is detecting targets.
|
||||
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
|
||||
-- This demo will group 5 red vehicles in areas. One vehicle is diving from one group to the other.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the flaring of the areas formed
|
||||
-- 2. Observe the smoking of the units detected
|
||||
-- 3. Observe the areas being flexibly changed very detection run.
|
||||
-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second.
|
||||
-- 5. While driving in between the areas, it will have a separate area.
|
||||
|
||||
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
|
||||
|
||||
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
FACDetection:__Start( 5 )
|
||||
@ -1,24 +1,24 @@
|
||||
---
|
||||
-- Name: DET-001 - Detection Areas
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A small blue vehicle with laser detection methods is detecting targets.
|
||||
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
|
||||
-- This demo will group 5 red vehicles in areas. One vehicle is diving from one group to the other.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the flaring of the areas formed
|
||||
-- 2. Observe the smoking of the units detected
|
||||
-- 3. Observe the areas being flexibly changed very detection run.
|
||||
-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second.
|
||||
-- 5. While driving in between the areas, it will have a separate area.
|
||||
|
||||
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
|
||||
|
||||
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
---
|
||||
-- Name: DET-001 - Detection Areas
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A small blue vehicle with laser detection methods is detecting targets.
|
||||
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
|
||||
-- This demo will group 5 red vehicles in areas. One vehicle is diving from one group to the other.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the flaring of the areas formed
|
||||
-- 2. Observe the smoking of the units detected
|
||||
-- 3. Observe the areas being flexibly changed very detection run.
|
||||
-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second.
|
||||
-- 5. While driving in between the areas, it will have a separate area.
|
||||
|
||||
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
|
||||
|
||||
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
FACDetection:__Start( 5 )
|
||||
@ -1,56 +1,56 @@
|
||||
---
|
||||
-- Name: DET-100 - Detection Probability Distance
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the DistanceProbability factor during the detection of units.
|
||||
--
|
||||
-- Two JTAC are detecting 4 units, which are 10 km away.
|
||||
-- The first JTAC has no DistanceProbability set.
|
||||
-- The second JTAC has a DistanceProbability set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
|
||||
-- 2. Eventually all units should be detected by both JTAC.
|
||||
|
||||
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
|
||||
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
|
||||
|
||||
RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
|
||||
RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance.
|
||||
|
||||
RecceDetection1:Start()
|
||||
RecceDetection2:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection1:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection1:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" )
|
||||
end
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection2:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection2:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" )
|
||||
end
|
||||
---
|
||||
-- Name: DET-100 - Detection Probability Distance
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the DistanceProbability factor during the detection of units.
|
||||
--
|
||||
-- Two JTAC are detecting 4 units, which are 10 km away.
|
||||
-- The first JTAC has no DistanceProbability set.
|
||||
-- The second JTAC has a DistanceProbability set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
|
||||
-- 2. Eventually all units should be detected by both JTAC.
|
||||
|
||||
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
|
||||
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
|
||||
|
||||
RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
|
||||
RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance.
|
||||
|
||||
RecceDetection1:Start()
|
||||
RecceDetection2:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection1:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection1:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" )
|
||||
end
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection2:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection2:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" )
|
||||
end
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
|
||||
|
||||
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
|
||||
|
||||
FACDetection = DETECTION_AREAS:New( FACSetGroup, 1000, 250 )
|
||||
SeadClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart()
|
||||
DestroyClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart()
|
||||
|
||||
FACReporting = FAC_REPORTING:New( FACClientSet, FACDetection )
|
||||
|
||||
|
||||
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
|
||||
|
||||
FACDetection = DETECTION_AREAS:New( FACSetGroup, 1000, 250 )
|
||||
SeadClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart()
|
||||
DestroyClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart()
|
||||
|
||||
FACReporting = FAC_REPORTING:New( FACClientSet, FACDetection )
|
||||
|
||||
@ -1,62 +1,62 @@
|
||||
---
|
||||
-- Name: DET-120 - Detection Probability Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the DistanceProbability factor during the detection of units.
|
||||
--
|
||||
-- Two JTAC are detecting 4 units, which are 10 km away.
|
||||
-- The first JTAC has no DistanceProbability set.
|
||||
-- The second JTAC has a DistanceProbability set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
|
||||
-- 2. Eventually all units should be detected by both JTAC.
|
||||
|
||||
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
|
||||
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
|
||||
|
||||
RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
|
||||
|
||||
ForestZone = ZONE_POLYGON:New( "ForestZone", GROUP:FindByName( "ForestZone" ) )
|
||||
|
||||
RecceDetection2:SetZoneProbability( { { ForestZone, 0.1 } } ) -- Set a 10% probability that a vehicle can be detected within the forest.
|
||||
|
||||
|
||||
RecceDetection1:Start()
|
||||
RecceDetection2:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection1:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No Zone Probability" )
|
||||
end
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection2:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Forest Zone Probability" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
---
|
||||
-- Name: DET-120 - Detection Probability Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the DistanceProbability factor during the detection of units.
|
||||
--
|
||||
-- Two JTAC are detecting 4 units, which are 10 km away.
|
||||
-- The first JTAC has no DistanceProbability set.
|
||||
-- The second JTAC has a DistanceProbability set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
|
||||
-- 2. Eventually all units should be detected by both JTAC.
|
||||
|
||||
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
|
||||
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
|
||||
|
||||
RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
|
||||
|
||||
ForestZone = ZONE_POLYGON:New( "ForestZone", GROUP:FindByName( "ForestZone" ) )
|
||||
|
||||
RecceDetection2:SetZoneProbability( { { ForestZone, 0.1 } } ) -- Set a 10% probability that a vehicle can be detected within the forest.
|
||||
|
||||
|
||||
RecceDetection1:Start()
|
||||
RecceDetection2:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection1:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No Zone Probability" )
|
||||
end
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection2:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Forest Zone Probability" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
|
||||
@ -1,42 +1,42 @@
|
||||
---
|
||||
-- Name: DET-200 - Detection UNITS
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units, which are 5 km away.
|
||||
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
|
||||
-- The enemy is approaching.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detection reporting of both the Recce.
|
||||
-- 2. Eventually all units should be detected by both Recce.
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
self:E("Detect")
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
---
|
||||
-- Name: DET-200 - Detection UNITS
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units, which are 5 km away.
|
||||
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
|
||||
-- The enemy is approaching.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detection reporting of both the Recce.
|
||||
-- 2. Eventually all units should be detected by both Recce.
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
self:E("Detect")
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
|
||||
@ -1,43 +1,43 @@
|
||||
---
|
||||
-- Name: DET-201 - Detection UNITS - Air
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 03 May 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recce are detecting a approaching airplanes.
|
||||
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
|
||||
-- The enemy is approaching.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detection reporting of both the Recce.
|
||||
-- 2. Eventually all units should be detected by both Recce.
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
RecceDetection:InitDetectRadar(true)
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
self:E("Detect")
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
---
|
||||
-- Name: DET-201 - Detection UNITS - Air
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 03 May 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recce are detecting a approaching airplanes.
|
||||
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
|
||||
-- The enemy is approaching.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detection reporting of both the Recce.
|
||||
-- 2. Eventually all units should be detected by both Recce.
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
RecceDetection:InitDetectRadar(true)
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
self:E("Detect")
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
|
||||
@ -1,42 +1,42 @@
|
||||
---
|
||||
-- Name: DET-210 - Detection TYPES
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units, which are 5 km away.
|
||||
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
|
||||
-- The enemy is approaching.
|
||||
--
|
||||
-- The blue Recce will report the detected units grouped per vehicle type!
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detection reporting of both the Recce.
|
||||
-- 2. Eventually all units should be detected by both Recce.
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_TYPES:New( RecceSetGroup )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
---
|
||||
-- Name: DET-210 - Detection TYPES
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units, which are 5 km away.
|
||||
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
|
||||
-- The enemy is approaching.
|
||||
--
|
||||
-- The blue Recce will report the detected units grouped per vehicle type!
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detection reporting of both the Recce.
|
||||
-- 2. Eventually all units should be detected by both Recce.
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_TYPES:New( RecceSetGroup )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
|
||||
@ -1,58 +1,58 @@
|
||||
---
|
||||
-- Name: DET-100 - Detection Probability Distance
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the DistanceProbability factor during the detection of units.
|
||||
--
|
||||
-- Two JTAC are detecting 4 units, which are 10 km away.
|
||||
-- The first JTAC has no DistanceProbability set.
|
||||
-- The second JTAC has a DistanceProbability set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
|
||||
-- 2. Eventually all units should be detected by both JTAC.
|
||||
|
||||
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
|
||||
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection1 = DETECTION_AREAS:New( RecceSetGroup1, 1000 )
|
||||
RecceDetection1:BoundDetectedZones()
|
||||
|
||||
RecceDetection2 = DETECTION_AREAS:New( RecceSetGroup2, 1000 )
|
||||
RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance.
|
||||
RecceDetection1:BoundDetectedZones()
|
||||
|
||||
RecceDetection1:Start()
|
||||
RecceDetection2:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection1:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection1:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" )
|
||||
end
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection2:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection2:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" )
|
||||
---
|
||||
-- Name: DET-100 - Detection Probability Distance
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the DistanceProbability factor during the detection of units.
|
||||
--
|
||||
-- Two JTAC are detecting 4 units, which are 10 km away.
|
||||
-- The first JTAC has no DistanceProbability set.
|
||||
-- The second JTAC has a DistanceProbability set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
|
||||
-- 2. Eventually all units should be detected by both JTAC.
|
||||
|
||||
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
|
||||
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection1 = DETECTION_AREAS:New( RecceSetGroup1, 1000 )
|
||||
RecceDetection1:BoundDetectedZones()
|
||||
|
||||
RecceDetection2 = DETECTION_AREAS:New( RecceSetGroup2, 1000 )
|
||||
RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance.
|
||||
RecceDetection1:BoundDetectedZones()
|
||||
|
||||
RecceDetection1:Start()
|
||||
RecceDetection2:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection1:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection1:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" )
|
||||
end
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection2:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection2:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" )
|
||||
end
|
||||
@ -1,46 +1,46 @@
|
||||
---
|
||||
-- Name: DET-255 - Detection AEAS with Destroys
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 06 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A small blue vehicle with laser detection methods is detecting targets.
|
||||
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
|
||||
-- This demo will group red vehicles in areas. One vehicle is diving from one group to the other.
|
||||
-- After 30 seconds, one vehicle is destroyed in a zone.
|
||||
-- After 60 seconds, a vehicle is destroyed that is a leader of a zone.
|
||||
-- After 90 seconds, all vehicles are destroyed in a zone.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the flaring of the areas formed
|
||||
-- 2. Observe the smoking of the units detected
|
||||
-- 3. Observe the areas being flexibly changed very detection run.
|
||||
-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second.
|
||||
-- 5. While driving in between the areas, it will have a separate area.
|
||||
-- 6. Observe the correct removal or relocation of the ZONEs.
|
||||
|
||||
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
|
||||
|
||||
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
FACDetection:__Start( 5 )
|
||||
|
||||
SCHEDULER:New( nil,function()
|
||||
local Target = UNIT:FindByName( "Target #004")
|
||||
Target:Destroy()
|
||||
end, {}, 30
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,function()
|
||||
local Target = UNIT:FindByName( "Target #006")
|
||||
Target:Destroy()
|
||||
end, {}, 60
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,function()
|
||||
local Target = UNIT:FindByName( "Target #007")
|
||||
Target:Destroy()
|
||||
end, {}, 90
|
||||
---
|
||||
-- Name: DET-255 - Detection AEAS with Destroys
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 06 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A small blue vehicle with laser detection methods is detecting targets.
|
||||
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
|
||||
-- This demo will group red vehicles in areas. One vehicle is diving from one group to the other.
|
||||
-- After 30 seconds, one vehicle is destroyed in a zone.
|
||||
-- After 60 seconds, a vehicle is destroyed that is a leader of a zone.
|
||||
-- After 90 seconds, all vehicles are destroyed in a zone.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the flaring of the areas formed
|
||||
-- 2. Observe the smoking of the units detected
|
||||
-- 3. Observe the areas being flexibly changed very detection run.
|
||||
-- 4. The truck driving from the one group to the other, will leave the first area, and will join the second.
|
||||
-- 5. While driving in between the areas, it will have a separate area.
|
||||
-- 6. Observe the correct removal or relocation of the ZONEs.
|
||||
|
||||
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
|
||||
|
||||
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
FACDetection:__Start( 5 )
|
||||
|
||||
SCHEDULER:New( nil,function()
|
||||
local Target = UNIT:FindByName( "Target #004")
|
||||
Target:Destroy()
|
||||
end, {}, 30
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,function()
|
||||
local Target = UNIT:FindByName( "Target #006")
|
||||
Target:Destroy()
|
||||
end, {}, 60
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,function()
|
||||
local Target = UNIT:FindByName( "Target #007")
|
||||
Target:Destroy()
|
||||
end, {}, 90
|
||||
)
|
||||
@ -1,36 +1,36 @@
|
||||
---
|
||||
-- Name: DET-300 - Dectection Filter AIRPLANE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting only detecting the airplane, not the other units.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.AIRPLANE )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
---
|
||||
-- Name: DET-300 - Dectection Filter AIRPLANE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting only detecting the airplane, not the other units.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.AIRPLANE )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
|
||||
@ -1,36 +1,36 @@
|
||||
---
|
||||
-- Name: DET-301 - Dectection Filter GROUND_UNIT
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting only detecting the ground unit, not the other units.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.GROUND_UNIT )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
---
|
||||
-- Name: DET-301 - Dectection Filter GROUND_UNIT
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting only detecting the ground unit, not the other units.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.GROUND_UNIT )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
|
||||
@ -1,36 +1,36 @@
|
||||
---
|
||||
-- Name: DET-302 - Dectection Filter HELICOPTER
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting only detecting the helicopter, not the other units.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.HELICOPTER )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
---
|
||||
-- Name: DET-302 - Dectection Filter HELICOPTER
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting only detecting the helicopter, not the other units.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.HELICOPTER )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
|
||||
@ -1,36 +1,36 @@
|
||||
---
|
||||
-- Name: DET-303 - Dectection Filter SHIP
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting only detecting the ship, not the other units.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.SHIP )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
---
|
||||
-- Name: DET-303 - Dectection Filter SHIP
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting only detecting the ship, not the other units.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.SHIP )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
|
||||
@ -1,36 +1,36 @@
|
||||
---
|
||||
-- Name: DET-304 - Dectection Filter STRUCTURE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting only detecting the structure, not the other units.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.STRUCTURE )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
collectgarbage()
|
||||
---
|
||||
-- Name: DET-304 - Dectection Filter STRUCTURE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting only detecting the structure, not the other units.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( SetGroup ):FilterCategories( Unit.Category.STRUCTURE )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
collectgarbage()
|
||||
|
||||
@ -1,44 +1,44 @@
|
||||
---
|
||||
-- Name: DET-305 - Dectection Filter ALL
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting detecting all the units regardless of the type.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS
|
||||
:New( SetGroup )
|
||||
:FilterCategories( {
|
||||
Unit.Category.AIRPLANE,
|
||||
Unit.Category.GROUND_UNIT,
|
||||
Unit.Category.HELICOPTER,
|
||||
Unit.Category.SHIP,
|
||||
Unit.Category.STRUCTURE
|
||||
} )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
---
|
||||
-- Name: DET-305 - Dectection Filter ALL
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the filtering of detections.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting detecting all the units regardless of the type.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS
|
||||
:New( SetGroup )
|
||||
:FilterCategories( {
|
||||
Unit.Category.AIRPLANE,
|
||||
Unit.Category.GROUND_UNIT,
|
||||
Unit.Category.HELICOPTER,
|
||||
Unit.Category.SHIP,
|
||||
Unit.Category.STRUCTURE
|
||||
} )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
|
||||
@ -1,40 +1,40 @@
|
||||
---
|
||||
-- Name: DET-310 - EWR - Line Of Sight
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Sep 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the lost of line of sight using an airplane.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS
|
||||
:New( SetGroup )
|
||||
:FilterCategories( {
|
||||
Unit.Category.AIRPLANE,
|
||||
Unit.Category.GROUND_UNIT,
|
||||
Unit.Category.HELICOPTER,
|
||||
Unit.Category.SHIP,
|
||||
Unit.Category.STRUCTURE
|
||||
} )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
---
|
||||
-- Name: DET-310 - EWR - Line Of Sight
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Sep 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the lost of line of sight using an airplane.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS
|
||||
:New( SetGroup )
|
||||
:FilterCategories( {
|
||||
Unit.Category.AIRPLANE,
|
||||
Unit.Category.GROUND_UNIT,
|
||||
Unit.Category.HELICOPTER,
|
||||
Unit.Category.SHIP,
|
||||
Unit.Category.STRUCTURE
|
||||
} )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
|
||||
@ -1,57 +1,57 @@
|
||||
---
|
||||
-- Name: DET-310 - EWR - Line Of Sight
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Sep 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the lost of line of sight using an airplane.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_AREAS
|
||||
:New( SetGroup, 1500 )
|
||||
:FilterCategories( { Unit.Category.AIRPLANE } )
|
||||
:InitDetectRWR(true)
|
||||
|
||||
local Zones = {
|
||||
ZONE:New( "Zone1" ),
|
||||
ZONE:New( "Zone2" )
|
||||
}
|
||||
|
||||
local Sams = {
|
||||
GROUP:FindByName( "SAM1" ),
|
||||
GROUP:FindByName( "SAM2" )
|
||||
}
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event DetectedItem.
|
||||
-- @param RecceDetection self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
|
||||
function RecceDetection:OnAfterDetectedItem(From,Event,To,DetectedItem)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
|
||||
if DetectedItem.IsDetected then
|
||||
local Coordinate = DetectedItem.Coordinate -- Core.Point#COORDINATE
|
||||
for ZoneID, ZoneData in pairs( Zones ) do
|
||||
local Zone = ZoneData -- Core.Zone#ZONE
|
||||
if Zone:IsCoordinateInZone(Coordinate) then
|
||||
Sams[ZoneID]:Activate()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
---
|
||||
-- Name: DET-310 - EWR - Line Of Sight
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Sep 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the lost of line of sight using an airplane.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_AREAS
|
||||
:New( SetGroup, 1500 )
|
||||
:FilterCategories( { Unit.Category.AIRPLANE } )
|
||||
:InitDetectRWR(true)
|
||||
|
||||
local Zones = {
|
||||
ZONE:New( "Zone1" ),
|
||||
ZONE:New( "Zone2" )
|
||||
}
|
||||
|
||||
local Sams = {
|
||||
GROUP:FindByName( "SAM1" ),
|
||||
GROUP:FindByName( "SAM2" )
|
||||
}
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event DetectedItem.
|
||||
-- @param RecceDetection self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
|
||||
function RecceDetection:OnAfterDetectedItem(From,Event,To,DetectedItem)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
|
||||
if DetectedItem.IsDetected then
|
||||
local Coordinate = DetectedItem.Coordinate -- Core.Point#COORDINATE
|
||||
for ZoneID, ZoneData in pairs( Zones ) do
|
||||
local Zone = ZoneData -- Core.Zone#ZONE
|
||||
if Zone:IsCoordinateInZone(Coordinate) then
|
||||
Sams[ZoneID]:Activate()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
|
||||
@ -1,49 +1,49 @@
|
||||
---
|
||||
-- Name: DET-310 - EWR - Line Of Sight
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Sep 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the lost of line of sight using an airplane.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_AREAS
|
||||
:New( SetGroup, 1500 )
|
||||
:FilterCategories( { Unit.Category.AIRPLANE } )
|
||||
--:InitDetectVisual( true )
|
||||
:InitDetectIRST( true )
|
||||
:InitDetectRadar( true )
|
||||
:InitDetectRWR( true )
|
||||
:InitDetectOptical( true )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
_SETTINGS:SetA2A_BRAA()
|
||||
_SETTINGS:SetA2G_BR()
|
||||
|
||||
--- OnAfter Transition Handler for Event DetectedItem.
|
||||
-- @param Functional.Detection#DETECTION_AREAS RecceDetection self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
|
||||
function RecceDetection:OnAfterDetectedItem(From,Event,To,DetectedItem)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed( SetGroup:GetFirst() )
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
|
||||
if DetectedItem.IsDetected then
|
||||
local Coordinate = DetectedItem.Coordinate -- Core.Point#COORDINATE
|
||||
HQ:MessageToAll( "Detected", 15, "Detection" )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
---
|
||||
-- Name: DET-310 - EWR - Line Of Sight
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Sep 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the lost of line of sight using an airplane.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_AREAS
|
||||
:New( SetGroup, 1500 )
|
||||
:FilterCategories( { Unit.Category.AIRPLANE } )
|
||||
--:InitDetectVisual( true )
|
||||
:InitDetectIRST( true )
|
||||
:InitDetectRadar( true )
|
||||
:InitDetectRWR( true )
|
||||
:InitDetectOptical( true )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
_SETTINGS:SetA2A_BRAA()
|
||||
_SETTINGS:SetA2G_BR()
|
||||
|
||||
--- OnAfter Transition Handler for Event DetectedItem.
|
||||
-- @param Functional.Detection#DETECTION_AREAS RecceDetection self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
|
||||
function RecceDetection:OnAfterDetectedItem(From,Event,To,DetectedItem)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed( SetGroup:GetFirst() )
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection" )
|
||||
|
||||
if DetectedItem.IsDetected then
|
||||
local Coordinate = DetectedItem.Coordinate -- Core.Point#COORDINATE
|
||||
HQ:MessageToAll( "Detected", 15, "Detection" )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
|
||||
@ -1,70 +1,70 @@
|
||||
---
|
||||
-- Name: DET-500 - Handle Detected Event - Govern Artillery Demo
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recces are detecting a large group of units, which are 5 km away.
|
||||
-- Once the Recces detect the enemy, the artilley units are controlled and will fire a missile to the target.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detected reporting of the recces.
|
||||
-- 2. When one Recce group detects a target, it will select an artillery unit and fire a missile.
|
||||
-- 3. This will run until all Recces have eliminated the targets.
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Recce" ):FilterStart()
|
||||
ArtillerySetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Artillery" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
RecceDetection:SetRefreshTimeInterval( 5 )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:GetPositionable():MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
local ArtilleryTime = {}
|
||||
local ArtilleryAim = 180
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @param Wrapper.Unit#UNIT DetectedUnits
|
||||
function RecceDetection:OnAfterDetected( From, Event, To, DetectedUnits )
|
||||
self:E( { From, Event, To, DetectedUnits } )
|
||||
|
||||
for DetectedUnitID, DetectedUnit in pairs( DetectedUnits ) do
|
||||
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
|
||||
local Artillery = ArtillerySetGroup:GetRandom() -- Wrapper.Group#GROUP
|
||||
|
||||
if ArtilleryTime[Artillery] and ArtilleryTime[Artillery] <= timer.getTime() - ArtilleryAim then
|
||||
ArtilleryTime[Artillery] = nil
|
||||
end
|
||||
|
||||
if not ArtilleryTime[Artillery] then
|
||||
local Task = Artillery:TaskFireAtPoint( DetectedUnit:GetVec2(), 500, 4 ) -- Fire 2 rockets to the target point.
|
||||
Artillery:SetTask( Task, 0.5 )
|
||||
ArtilleryTime[Artillery] = timer.getTime()
|
||||
end
|
||||
|
||||
end
|
||||
---
|
||||
-- Name: DET-500 - Handle Detected Event - Govern Artillery Demo
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recces are detecting a large group of units, which are 5 km away.
|
||||
-- Once the Recces detect the enemy, the artilley units are controlled and will fire a missile to the target.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detected reporting of the recces.
|
||||
-- 2. When one Recce group detects a target, it will select an artillery unit and fire a missile.
|
||||
-- 3. This will run until all Recces have eliminated the targets.
|
||||
|
||||
RecceSetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Recce" ):FilterStart()
|
||||
ArtillerySetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Artillery" ):FilterStart()
|
||||
|
||||
HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
RecceDetection:SetRefreshTimeInterval( 5 )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:GetPositionable():MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
local ArtilleryTime = {}
|
||||
local ArtilleryAim = 180
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @param Wrapper.Unit#UNIT DetectedUnits
|
||||
function RecceDetection:OnAfterDetected( From, Event, To, DetectedUnits )
|
||||
self:E( { From, Event, To, DetectedUnits } )
|
||||
|
||||
for DetectedUnitID, DetectedUnit in pairs( DetectedUnits ) do
|
||||
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
|
||||
local Artillery = ArtillerySetGroup:GetRandom() -- Wrapper.Group#GROUP
|
||||
|
||||
if ArtilleryTime[Artillery] and ArtilleryTime[Artillery] <= timer.getTime() - ArtilleryAim then
|
||||
ArtilleryTime[Artillery] = nil
|
||||
end
|
||||
|
||||
if not ArtilleryTime[Artillery] then
|
||||
local Task = Artillery:TaskFireAtPoint( DetectedUnit:GetVec2(), 500, 4 ) -- Fire 2 rockets to the target point.
|
||||
Artillery:SetTask( Task, 0.5 )
|
||||
ArtilleryTime[Artillery] = timer.getTime()
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@ -1,16 +1,16 @@
|
||||
---
|
||||
-- Name: DET-600 - Detection Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 Mar 2019
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- 2 trigger zones are defined using the mission editor.
|
||||
-- The detection algorithm will detect the units within the zones and report them.
|
||||
|
||||
|
||||
DetectionSetZones = SET_ZONE:New():FilterPrefixes( { "Detection Zone" } ):FilterOnce()
|
||||
|
||||
DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.RED ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
---
|
||||
-- Name: DET-600 - Detection Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 Mar 2019
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- 2 trigger zones are defined using the mission editor.
|
||||
-- The detection algorithm will detect the units within the zones and report them.
|
||||
|
||||
|
||||
DetectionSetZones = SET_ZONE:New():FilterPrefixes( { "Detection Zone" } ):FilterOnce()
|
||||
|
||||
DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.RED ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
DetectionZones:__Start( 5 )
|
||||
@ -1,18 +1,18 @@
|
||||
---
|
||||
-- Name: DET-600 - Detection Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 Mar 2019
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- 2 trigger zones are defined using the mission editor.
|
||||
-- The detection algorithm will detect the units within the zones and report them.
|
||||
|
||||
|
||||
DetectionSetZones = SET_ZONE_GOAL:New():FilterPrefixes( { "Detection Zone" } ):FilterStart()
|
||||
|
||||
DetectionZone1 = ZONE_CAPTURE_COALITION:New( ZONE:New( "Detection Zone 1" ), coalition.side.RED )
|
||||
|
||||
DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.RED ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
---
|
||||
-- Name: DET-600 - Detection Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 Mar 2019
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- 2 trigger zones are defined using the mission editor.
|
||||
-- The detection algorithm will detect the units within the zones and report them.
|
||||
|
||||
|
||||
DetectionSetZones = SET_ZONE_GOAL:New():FilterPrefixes( { "Detection Zone" } ):FilterStart()
|
||||
|
||||
DetectionZone1 = ZONE_CAPTURE_COALITION:New( ZONE:New( "Detection Zone 1" ), coalition.side.RED )
|
||||
|
||||
DetectionZones = DETECTION_ZONES:New( DetectionSetZones, coalition.side.RED ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
DetectionZones:__Start( 5 )
|
||||
@ -1,25 +1,25 @@
|
||||
---
|
||||
-- Name: DET-900 - Detection Test with RED FACA
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 06 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A red FACA is detecting targets while airborne.
|
||||
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
|
||||
-- This demo will group blue vehicles in areas.
|
||||
-- Upon the detection capabilities of the red FACA, the blue vehicles will be grouped when detected.
|
||||
-- All blue vehicles have ROE on hold.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the tyres put around the detected areas formed
|
||||
-- 2. Observe the smoking of the units detected
|
||||
-- 3. Observe the areas being flexibly changed very detection run.
|
||||
|
||||
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart()
|
||||
|
||||
FACDetection = DETECTION_AREAS:New( FACSetGroup, 2000, 250 ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
|
||||
FACDetection:__Start( 5 )
|
||||
---
|
||||
-- Name: DET-900 - Detection Test with RED FACA
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 06 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A red FACA is detecting targets while airborne.
|
||||
-- Targets are grouped within areas. A detection range and zone range is given to group the detected units.
|
||||
-- This demo will group blue vehicles in areas.
|
||||
-- Upon the detection capabilities of the red FACA, the blue vehicles will be grouped when detected.
|
||||
-- All blue vehicles have ROE on hold.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the tyres put around the detected areas formed
|
||||
-- 2. Observe the smoking of the units detected
|
||||
-- 3. Observe the areas being flexibly changed very detection run.
|
||||
|
||||
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart()
|
||||
|
||||
FACDetection = DETECTION_AREAS:New( FACSetGroup, 2000, 250 ):BoundDetectedZones():SmokeDetectedUnits()
|
||||
|
||||
|
||||
FACDetection:__Start( 5 )
|
||||
|
||||
@ -1,89 +1,89 @@
|
||||
---
|
||||
-- Name: ESC-001 - Escorting Helicopters
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Your client helicopter is flying in the battle field.
|
||||
-- It is escorted by an MI-28N, which you can command...
|
||||
-- Use the menu options to:
|
||||
-- - Make the escort follow you.
|
||||
-- - Report detected targets.
|
||||
-- - Attack targets
|
||||
-- - Flare
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. When executing the commands, observe the MI-28N reactions.
|
||||
|
||||
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()
|
||||
:MenuROE()
|
||||
:MenuAssistedAttack()
|
||||
|
||||
EscortHeli1:SetDetection( EscortHeliDetection )
|
||||
|
||||
local EscortGroupArtillery = SpawnEscortArtillery:ReSpawn(1)
|
||||
local EscortArtillery = ESCORT
|
||||
:New( Client, EscortGroupArtillery, "Escort Artillery" )
|
||||
:Menus()
|
||||
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" )
|
||||
SpawnEscortArtillery = SPAWN:New( "Ground Attack Assistance" )
|
||||
|
||||
EscortHeliSetGroup = SET_GROUP:New():FilterPrefixes("Escort Helicopter"):FilterStart()
|
||||
EscortHeliDetection = DETECTION_AREAS:New( EscortHeliSetGroup, 1000, 500 )
|
||||
|
||||
EscortHeliDetection:BoundDetectedZones()
|
||||
EscortHeliDetection:SetRefreshTimeInterval( 15 )
|
||||
|
||||
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
|
||||
|
||||
env.info( "Test Mission loaded" )
|
||||
---
|
||||
-- Name: ESC-001 - Escorting Helicopters
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Your client helicopter is flying in the battle field.
|
||||
-- It is escorted by an MI-28N, which you can command...
|
||||
-- Use the menu options to:
|
||||
-- - Make the escort follow you.
|
||||
-- - Report detected targets.
|
||||
-- - Attack targets
|
||||
-- - Flare
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. When executing the commands, observe the MI-28N reactions.
|
||||
|
||||
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()
|
||||
:MenuROE()
|
||||
:MenuAssistedAttack()
|
||||
|
||||
EscortHeli1:SetDetection( EscortHeliDetection )
|
||||
|
||||
local EscortGroupArtillery = SpawnEscortArtillery:ReSpawn(1)
|
||||
local EscortArtillery = ESCORT
|
||||
:New( Client, EscortGroupArtillery, "Escort Artillery" )
|
||||
:Menus()
|
||||
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" )
|
||||
SpawnEscortArtillery = SPAWN:New( "Ground Attack Assistance" )
|
||||
|
||||
EscortHeliSetGroup = SET_GROUP:New():FilterPrefixes("Escort Helicopter"):FilterStart()
|
||||
EscortHeliDetection = DETECTION_AREAS:New( EscortHeliSetGroup, 1000, 500 )
|
||||
|
||||
EscortHeliDetection:BoundDetectedZones()
|
||||
EscortHeliDetection:SetRefreshTimeInterval( 15 )
|
||||
|
||||
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
|
||||
|
||||
env.info( "Test Mission loaded" )
|
||||
|
||||
@ -1,23 +1,23 @@
|
||||
-------------------------------------------------------------------------
|
||||
-- MTS-100 - MANTIS - Autorelocate HQ and EWR
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html
|
||||
--
|
||||
-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 16 Dec 20
|
||||
-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters.
|
||||
-- HQ and EWR will randomly relocate between 30 and 60 mins
|
||||
-- The SA 11 Radar will only relocate if not detected units are in range
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 17 Dec 2020
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",false)
|
||||
myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS!
|
||||
myredmantis:Debug(true)
|
||||
myredmantis.verbose = true
|
||||
-------------------------------------------------------------------------
|
||||
-- MTS-100 - MANTIS - Autorelocate HQ and EWR
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html
|
||||
--
|
||||
-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 16 Dec 20
|
||||
-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters.
|
||||
-- HQ and EWR will randomly relocate between 30 and 60 mins
|
||||
-- The SA 11 Radar will only relocate if not detected units are in range
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 17 Dec 2020
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",false)
|
||||
myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS!
|
||||
myredmantis:Debug(true)
|
||||
myredmantis.verbose = true
|
||||
myredmantis:Start()
|
||||
@ -1,23 +1,23 @@
|
||||
-------------------------------------------------------------------------
|
||||
-- MTS-100 - MANTIS - Autorelocate HQ and EWR
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html
|
||||
--
|
||||
-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 16 Dec 20
|
||||
-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set of Blue SAM sites being attacked by Red SEAD and Helicopters
|
||||
-- HQ and EWR will randomly relocate between 30 and 60 mins
|
||||
-- The Radar will only relocate if not detected units are in range
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 26 Dec 2020
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
myredmantis = MANTIS:New("mybluemantis","Blue SAM","Blue EWR","Blue HQ","blue",false)
|
||||
myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS!
|
||||
myredmantis:Debug(false)
|
||||
myredmantis.verbose = true
|
||||
-------------------------------------------------------------------------
|
||||
-- MTS-100 - MANTIS - Autorelocate HQ and EWR
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html
|
||||
--
|
||||
-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 16 Dec 20
|
||||
-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set of Blue SAM sites being attacked by Red SEAD and Helicopters
|
||||
-- HQ and EWR will randomly relocate between 30 and 60 mins
|
||||
-- The Radar will only relocate if not detected units are in range
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 26 Dec 2020
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
myredmantis = MANTIS:New("mybluemantis","Blue SAM","Blue EWR","Blue HQ","blue",false)
|
||||
myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS!
|
||||
myredmantis:Debug(false)
|
||||
myredmantis.verbose = true
|
||||
myredmantis:Start()
|
||||
@ -1,37 +1,37 @@
|
||||
-------------------------------------------------------------------------
|
||||
-- MTS-110 - Mantis Link to A2A-Dispatcher
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters.
|
||||
-- HQ and EWR will randomly relocate between 30 and 60 mins
|
||||
-- SU-27 GCICAP Flights will start from Pashkovsky to help the SAMs
|
||||
--
|
||||
-- NOTE - This demo requires the Master version of Moose and will not work with the Develop version!
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 17 Dec 2020
|
||||
-- Last Update: Feb 2023
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",false)
|
||||
myredmantis:Debug(false)
|
||||
myredmantis:Start()
|
||||
|
||||
-- link in AI_A2A_Dispatcher
|
||||
|
||||
Red_GCI = AI_A2A_DISPATCHER:New(myredmantis.Detection) -- use existing detection object
|
||||
|
||||
Red_GCI:SetTacticalDisplay(true)
|
||||
Red_GCI:SetDefaultLandingAtRunway()
|
||||
Red_GCI:SetDefaultTakeoffInAir()
|
||||
Red_GCI:SetDisengageRadius(125000)
|
||||
Red_GCI:SetDefaultOverhead(0.4)
|
||||
Red_GCI:SetDefaultGrouping(2)
|
||||
Red_GCI:SetGciRadius(125000)
|
||||
Red_GCI:SetSquadron("Russian Tigers Sq1",AIRBASE.Caucasus.Krasnodar_Pashkovsky,"Red Interceptor",10)
|
||||
Red_GCI:SetSquadronGci("Russian Tigers Sq1",900,1800)
|
||||
Red_GCI:Start() -- never forget to use Start()!!
|
||||
-------------------------------------------------------------------------
|
||||
-- MTS-110 - Mantis Link to A2A-Dispatcher
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters.
|
||||
-- HQ and EWR will randomly relocate between 30 and 60 mins
|
||||
-- SU-27 GCICAP Flights will start from Pashkovsky to help the SAMs
|
||||
--
|
||||
-- NOTE - This demo requires the Master version of Moose and will not work with the Develop version!
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 17 Dec 2020
|
||||
-- Last Update: Feb 2023
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",false)
|
||||
myredmantis:Debug(false)
|
||||
myredmantis:Start()
|
||||
|
||||
-- link in AI_A2A_Dispatcher
|
||||
|
||||
Red_GCI = AI_A2A_DISPATCHER:New(myredmantis.Detection) -- use existing detection object
|
||||
|
||||
Red_GCI:SetTacticalDisplay(true)
|
||||
Red_GCI:SetDefaultLandingAtRunway()
|
||||
Red_GCI:SetDefaultTakeoffInAir()
|
||||
Red_GCI:SetDisengageRadius(125000)
|
||||
Red_GCI:SetDefaultOverhead(0.4)
|
||||
Red_GCI:SetDefaultGrouping(2)
|
||||
Red_GCI:SetGciRadius(125000)
|
||||
Red_GCI:SetSquadron("Russian Tigers Sq1",AIRBASE.Caucasus.Krasnodar_Pashkovsky,"Red Interceptor",10)
|
||||
Red_GCI:SetSquadronGci("Russian Tigers Sq1",900,1800)
|
||||
Red_GCI:Start() -- never forget to use Start()!!
|
||||
|
||||
@ -1,71 +1,71 @@
|
||||
-------------------------------------------------------------------------
|
||||
-- MTS-200 - MANTIS - Advanced Mode
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html
|
||||
--
|
||||
-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 17 Dec 20
|
||||
-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters.
|
||||
-- HQ and EWR will be destroyed after 10 and 15 mins, respectively
|
||||
-- Detection will slow down accordingly, if both units are dead, all SAM sites go to RED state
|
||||
-- Set up of a new HQ and EWR will recover MANTIS
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 21 Dec 2020
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",true)
|
||||
--myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS!
|
||||
myredmantis:SetAdvancedMode(true, 100) -- switch on advanced mode - detection will slow down or die if HQ and EWR die
|
||||
myredmantis:Debug(false)
|
||||
myredmantis.verbose = true -- watch DCS.log
|
||||
myredmantis:Start()
|
||||
|
||||
function destroy(objectname)
|
||||
local text = "Destroying "..objectname
|
||||
m=MESSAGE:New(text,30,"Info"):ToAll()
|
||||
local grp = GROUP:FindByName(objectname)
|
||||
grp:Destroy()
|
||||
end
|
||||
|
||||
function createhq()
|
||||
newhq = SPAWN
|
||||
:New("Red HQ-1")
|
||||
:InitDelayOff()
|
||||
:OnSpawnGroup(
|
||||
function (group)
|
||||
myredmantis:SetCommandCenter(group)
|
||||
end
|
||||
)
|
||||
:Spawn()
|
||||
local text = "Creating new HQ!"
|
||||
m=MESSAGE:New(text,30,"Info"):ToAll()
|
||||
end
|
||||
|
||||
function createewr()
|
||||
newewr = SPAWN
|
||||
:New("Red EWR-1")
|
||||
:InitDelayOff()
|
||||
:Spawn()
|
||||
local text = "Creating new EWR!"
|
||||
m=MESSAGE:New(text,30,"Info"):ToAll()
|
||||
end
|
||||
|
||||
hqtimer = TIMER:New(destroy,"Red HQ")
|
||||
ewrtimer = TIMER:New(destroy,"Red EWR")
|
||||
awacstimer = TIMER:New(destroy,"Red EWR Awacs")
|
||||
|
||||
nhqtimer = TIMER:New(createhq)
|
||||
newrtimer = TIMER:New(createewr)
|
||||
|
||||
-- slow down
|
||||
hqtimer:Start(300) -- 5 min
|
||||
ewrtimer:Start(360) -- 6 min
|
||||
awacstimer:Start(420) -- 7 min
|
||||
|
||||
--speed up
|
||||
nhqtimer:Start(600) -- 10 min
|
||||
newrtimer:Start(660) -- 11 min
|
||||
-------------------------------------------------------------------------
|
||||
-- MTS-200 - MANTIS - Advanced Mode
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Functional.Mantis.html
|
||||
--
|
||||
-- Note: As of Dec/20, MANTIS is WIP. Needs a recent build of Moose.lua > 17 Dec 20
|
||||
-- for CONTROLLABLE:RelocateGroundRandomInRadius() to be available
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/CONTROLLABLE.RelocateGroundRandomInRadius.html
|
||||
-------------------------------------------------------------------------
|
||||
-- Observe a set of SAM sites being attacked by F18 SEAD, A10 and Helicopters.
|
||||
-- HQ and EWR will be destroyed after 10 and 15 mins, respectively
|
||||
-- Detection will slow down accordingly, if both units are dead, all SAM sites go to RED state
|
||||
-- Set up of a new HQ and EWR will recover MANTIS
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: 21 Dec 2020
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
myredmantis = MANTIS:New("myredmantis","Red SAM","Red EWR","Red HQ","red",true)
|
||||
--myredmantis:SetAutoRelocate(true, true) -- make HQ and EWR relocatable, if they are actually mobile in DCS!
|
||||
myredmantis:SetAdvancedMode(true, 100) -- switch on advanced mode - detection will slow down or die if HQ and EWR die
|
||||
myredmantis:Debug(false)
|
||||
myredmantis.verbose = true -- watch DCS.log
|
||||
myredmantis:Start()
|
||||
|
||||
function destroy(objectname)
|
||||
local text = "Destroying "..objectname
|
||||
m=MESSAGE:New(text,30,"Info"):ToAll()
|
||||
local grp = GROUP:FindByName(objectname)
|
||||
grp:Destroy()
|
||||
end
|
||||
|
||||
function createhq()
|
||||
newhq = SPAWN
|
||||
:New("Red HQ-1")
|
||||
:InitDelayOff()
|
||||
:OnSpawnGroup(
|
||||
function (group)
|
||||
myredmantis:SetCommandCenter(group)
|
||||
end
|
||||
)
|
||||
:Spawn()
|
||||
local text = "Creating new HQ!"
|
||||
m=MESSAGE:New(text,30,"Info"):ToAll()
|
||||
end
|
||||
|
||||
function createewr()
|
||||
newewr = SPAWN
|
||||
:New("Red EWR-1")
|
||||
:InitDelayOff()
|
||||
:Spawn()
|
||||
local text = "Creating new EWR!"
|
||||
m=MESSAGE:New(text,30,"Info"):ToAll()
|
||||
end
|
||||
|
||||
hqtimer = TIMER:New(destroy,"Red HQ")
|
||||
ewrtimer = TIMER:New(destroy,"Red EWR")
|
||||
awacstimer = TIMER:New(destroy,"Red EWR Awacs")
|
||||
|
||||
nhqtimer = TIMER:New(createhq)
|
||||
newrtimer = TIMER:New(createewr)
|
||||
|
||||
-- slow down
|
||||
hqtimer:Start(300) -- 5 min
|
||||
ewrtimer:Start(360) -- 6 min
|
||||
awacstimer:Start(420) -- 7 min
|
||||
|
||||
--speed up
|
||||
nhqtimer:Start(600) -- 10 min
|
||||
newrtimer:Start(660) -- 11 min
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user