Merge pull request #318 from FlightControl-Master/master-missions-rework

Master missions rework
This commit is contained in:
Sven Van de Velde 2017-03-18 14:43:41 +01:00 committed by GitHub
commit fe3ffae01c
201 changed files with 326 additions and 324 deletions

View File

@ -17,12 +17,12 @@
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )

View File

@ -17,15 +17,15 @@
-- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa.
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
local PatrolZones = {}

View File

@ -22,15 +22,15 @@
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
@ -44,3 +44,4 @@ function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
Patrol:__Start( 5 )
end

View File

@ -20,26 +20,26 @@
-- 6. Ensure that you see the AI patrol in one of the two zones ...
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
-- Create the first polygon zone ...
local PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" )
local PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 )
PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" )
PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 )
-- Create the second polygon zone ...
local PatrolZoneGroup2 = GROUP:FindByName( "PatrolZone2" )
local PatrolZone2 = ZONE_POLYGON:New( "PatrolZone2", PatrolZoneGroup2 )
PatrolZoneGroup2 = GROUP:FindByName( "PatrolZone2" )
PatrolZone2 = ZONE_POLYGON:New( "PatrolZone2", PatrolZoneGroup2 )
-- Now, create an array of these zones ...
local PatrolZoneArray = { PatrolZone1, PatrolZone2 }
PatrolZoneArray = { PatrolZone1, PatrolZone2 }
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )

View File

@ -19,19 +19,19 @@
-- 2. Play with the InitCleanUp API of the SPAWN class, extende the amount of seconds to find the optimal setting.
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
-- Create the first polygon zone ...
local PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" )
local PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 )
PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" )
PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 )
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )

View File

@ -26,7 +26,7 @@
-- This zone array will be used in the AI_BALANCER to randomize the patrol
-- zone that each spawned group will patrol
local RedPatrolZone = {}
RedPatrolZone = {}
RedPatrolZone[1] = ZONE:New( "RedPatrolZone1" )
RedPatrolZone[2] = ZONE:New( "RedPatrolZone2" )
RedPatrolZone[3] = ZONE:New( "RedPatrolZone3" )
@ -40,7 +40,7 @@ RedPatrolZone[6] = ZONE:New( "RedPatrolZone6" )
-- with replacing any CLIENT created aircraft in the mission that a human
-- player does not take.
local RU_PlanesSpawn = {}
RU_PlanesSpawn = {}
RU_PlanesSpawn[1] = SPAWN:New( "RU CAP Anapa AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[2] = SPAWN:New( "RU CAP Beslan AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[3] = SPAWN:New( "RU CAP Gelendzhik AB" ):InitCleanUp( 45 )
@ -62,7 +62,7 @@ RU_PlanesSpawn[11] = SPAWN:New( "RU CAP Novorossiysk AB" ):InitCleanUp( 45 )
-- The code here does not need to be changed. Only an addition in the mission editor. An example
-- of this can be found on the USA side at Sochi AB.
local RU_PlanesClientSet = {}
RU_PlanesClientSet = {}
RU_PlanesClientSet[1] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Anapa AB")
RU_PlanesClientSet[2] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Beslan AB")
RU_PlanesClientSet[3] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Gelendzhik AB")
@ -84,7 +84,7 @@ RU_PlanesClientSet[11] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Novorossiysk
-- of them are included to pick randomly.
local RU_AI_Balancer = {}
RU_AI_Balancer = {}
for i=1, 11 do
RU_AI_Balancer[i] = AI_BALANCER:New(RU_PlanesClientSet[i], RU_PlanesSpawn[i])
@ -113,7 +113,7 @@ end
-- leader.
-- Create the Blue Patrol Zone Array
local BluePatrolZone = {}
BluePatrolZone = {}
BluePatrolZone[1] = ZONE:New( "BluePatrolZone1")
BluePatrolZone[2] = ZONE:New( "BluePatrolZone2")
BluePatrolZone[3] = ZONE:New( "BluePatrolZone3")
@ -123,7 +123,7 @@ BluePatrolZone[6] = ZONE:New( "BluePatrolZone6")
--United States CAP Aircraft (these are used as templates for AI)
local US_PlanesSpawn = {}
US_PlanesSpawn = {}
US_PlanesSpawn[1] = SPAWN:New( "US CAP Batumi AB" ):InitCleanUp( 45 )
US_PlanesSpawn[2] = SPAWN:New( "US CAP Gudauta AB" ):InitCleanUp( 45 )
US_PlanesSpawn[3] = SPAWN:New( "US CAP Kobuleti AB" ):InitCleanUp( 45 )
@ -137,7 +137,7 @@ US_PlanesSpawn[10] = SPAWN:New( "US CAP Tbilisi AB" ):InitCleanUp( 45 )
--United States Client Aircraft (via AI_BALANCER, AI will replace these if no human players are in the slot)
local US_PlanesClientSet = {}
US_PlanesClientSet = {}
US_PlanesClientSet[1] = SET_CLIENT:New():FilterPrefixes("US CLIENT Batumi AB")
US_PlanesClientSet[2] = SET_CLIENT:New():FilterPrefixes("US CLIENT Gudauta AB")
US_PlanesClientSet[3] = SET_CLIENT:New():FilterPrefixes("US CLIENT Kobuleti AB")
@ -149,7 +149,7 @@ US_PlanesClientSet[8] = SET_CLIENT:New():FilterPrefixes("US CLIENT Sukhumi AB")
US_PlanesClientSet[9] = SET_CLIENT:New():FilterPrefixes("US CLIENT Vaziani AB")
US_PlanesClientSet[10] = SET_CLIENT:New():FilterPrefixes("US CLIENT Tbilisi AB")
local US_AI_Balancer = {}
US_AI_Balancer = {}
for i=1, 10 do
US_AI_Balancer[i] = AI_BALANCER:New( US_PlanesClientSet[i], US_PlanesSpawn[i] )
@ -160,4 +160,4 @@ for i=1, 10 do
Patrol:SetControllable( AIGroup )
Patrol:Start()
end
end
end

View File

@ -16,7 +16,7 @@ local CapPlane = GROUP:FindByName( "Plane" )
local PatrolZone = ZONE:New( "Patrol Zone" )
local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
AICapZone:SetControllable( CapPlane )

View File

@ -15,11 +15,11 @@
-- 3. After engage, observe that the Su-27 returns to the PatrolZone.
-- 4. If you want, you can wait until the Su-27 is out of fuel and will land.
local CapPlane = GROUP:FindByName( "Plane" )
CapPlane = GROUP:FindByName( "Plane" )
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
AICapZone:SetControllable( CapPlane )
AICapZone:SetEngageRange( 20000 ) -- Set the Engage Range to 20.000 meters. The AI won't engage when the enemy is beyond 20.000 meters.

View File

@ -16,15 +16,15 @@
-- 4. If you want, you can wait until the Su-27 is out of fuel and will land.
local CapPlane = GROUP:FindByName( "Plane" )
CapPlane = GROUP:FindByName( "Plane" )
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
local EngageZoneGroup = GROUP:FindByName( "Engage Zone" )
EngageZoneGroup = GROUP:FindByName( "Engage Zone" )
local CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup )
CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup )
AICapZone:SetControllable( CapPlane )
AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone.

View File

@ -17,15 +17,15 @@
-- 4. When it engages, it will abort the engagement after 1 minute.
local CapPlane = GROUP:FindByName( "Plane" )
CapPlane = GROUP:FindByName( "Plane" )
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
local EngageZoneGroup = GROUP:FindByName( "Engage Zone" )
EngageZoneGroup = GROUP:FindByName( "Engage Zone" )
local CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup )
CapEngageZone = ZONE_POLYGON:New( "Engage Zone", EngageZoneGroup )
AICapZone:SetControllable( CapPlane )
AICapZone:SetEngageZone( CapEngageZone ) -- Set the Engage Zone. The AI will only engage when the bogeys are within the CapEngageZone.
@ -39,4 +39,5 @@ end
function AICapZone:OnAfterAbort(Controllable,From,Event,To)
BASE:E("MISSION ABORTED! Returning to Patrol Zone!")
MESSAGE:New("MISSION ABORTED! Returning to Patrol Zone!",30,"ALERT!")
end
end

View File

@ -13,13 +13,13 @@
-- 2. It should return to base when out of fuel.
--
local CapSpawn = SPAWN:New( "Plane" ):InitLimit(1,2):InitRepeatOnLanding()
CapSpawn = SPAWN:New( "Plane" ):InitLimit(1,2):InitRepeatOnLanding()
local CapGroup = CapSpawn:Spawn()
CapGroup = CapSpawn:Spawn()
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
local AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
AICapZone = AI_CAP_ZONE:New( PatrolZone, 500, 1000, 500, 600 )
AICapZone:SetControllable( CapGroup )

View File

@ -24,24 +24,24 @@
-- Create a local variable (in this case called CASEngagementZone) and
-- using the ZONE function find the pre-defined zone called "Engagement Zone"
-- currently on the map and assign it to this variable
local CASEngagementZone = ZONE:New( "Engagement Zone" )
CASEngagementZone = ZONE:New( "Engagement Zone" )
-- Create a local variable (in this case called CASPlane) and
-- using the GROUP function find the aircraft group called "Plane" and assign to this variable
local CASPlane = GROUP:FindByName( "Plane" )
CASPlane = GROUP:FindByName( "Plane" )
-- Create a local Variable (in this cased called PatrolZone and
-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
-- Create and object (in this case called AICasZone) and
-- using the functions AI_CAS_ZONE assign the parameters that define this object
-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone)
local AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
-- Create an object (in this case called Targets) and
-- using the GROUP function find the group labeled "Targets" and assign it to this object
local Targets = GROUP:FindByName("Targets")
Targets = GROUP:FindByName("Targets")
-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function

View File

@ -25,24 +25,24 @@
-- Create a local variable (in this case called CASEngagementZone) and
-- using the ZONE function find the pre-defined zone called "Engagement Zone"
-- currently on the map and assign it to this variable
local CASEngagementZone = ZONE:New( "Engagement Zone" )
CASEngagementZone = ZONE:New( "Engagement Zone" )
-- Create a local variable (in this case called CASPlane) and
-- using the GROUP function find the aircraft group called "Plane" and assign to this variable
local CASPlane = GROUP:FindByName( "Plane" )
CASPlane = GROUP:FindByName( "Plane" )
-- Create a local Variable (in this cased called PatrolZone and
-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
-- Create and object (in this case called AICasZone) and
-- using the functions AI_CAS_ZONE assign the parameters that define this object
-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone)
local AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
-- Create an object (in this case called Targets) and
-- using the GROUP function find the group labeled "Targets" and assign it to this object
local Targets = GROUP:FindByName("Targets")
Targets = GROUP:FindByName("Targets")
-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function

View File

@ -26,24 +26,24 @@
-- Create a local variable (in this case called CASEngagementZone) and
-- using the ZONE function find the pre-defined zone called "Engagement Zone"
-- currently on the map and assign it to this variable
local CASEngagementZone = ZONE:New( "Engagement Zone" )
CASEngagementZone = ZONE:New( "Engagement Zone" )
-- Create a local variable (in this case called CASPlane) and
-- using the GROUP function find the aircraft group called "Plane" and assign to this variable
local CASPlane = GROUP:FindByName( "Plane" )
CASPlane = GROUP:FindByName( "Plane" )
-- Create a local Variable (in this cased called PatrolZone and
-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
-- Create and object (in this case called AICasZone) and
-- using the functions AI_CAS_ZONE assign the parameters that define this object
-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone)
local AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
-- Create an object (in this case called Targets) and
-- using the GROUP function find the group labeled "Targets" and assign it to this object
local Targets = GROUP:FindByName("Targets")
Targets = GROUP:FindByName("Targets")
-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function

View File

@ -24,24 +24,24 @@
-- Create a local variable (in this case called CASEngagementZone) and
-- using the ZONE function find the pre-defined zone called "Engagement Zone"
-- currently on the map and assign it to this variable
local CASEngagementZone = ZONE:New( "Engagement Zone" )
CASEngagementZone = ZONE:New( "Engagement Zone" )
-- Create a local variable (in this case called CASPlane) and
-- using the GROUP function find the aircraft group called "Plane" and assign to this variable
local CASPlane = GROUP:FindByName( "Plane" )
CASPlane = GROUP:FindByName( "Plane" )
-- Create a local Variable (in this cased called PatrolZone and
-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
-- Create and object (in this case called AICasZone) and
-- using the functions AI_CAS_ZONE assign the parameters that define this object
-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone)
local AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
-- Create an object (in this case called Targets) and
-- using the GROUP function find the group labeled "Targets" and assign it to this object
local Targets = GROUP:FindByName("Targets")
Targets = GROUP:FindByName("Targets")
-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function

View File

@ -28,24 +28,24 @@
-- Create a local variable (in this case called CASEngagementZone) and
-- using the ZONE function find the pre-defined zone called "Engagement Zone"
-- currently on the map and assign it to this variable
local CASEngagementZone = ZONE:New( "Engagement Zone" )
CASEngagementZone = ZONE:New( "Engagement Zone" )
-- Create a local variable (in this case called CASPlane) and
-- using the GROUP function find the aircraft group called "Plane" and assign to this variable
local CASPlane = GROUP:FindByName( "Plane" )
CASPlane = GROUP:FindByName( "Plane" )
-- Create a local Variable (in this cased called PatrolZone and
-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
-- Create and object (in this case called AICasZone) and
-- using the functions AI_CAS_ZONE assign the parameters that define this object
-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone)
local AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
-- Create an object (in this case called Targets) and
-- using the GROUP function find the group labeled "Targets" and assign it to this object
local Targets = GROUP:FindByName("Targets")
Targets = GROUP:FindByName("Targets")
-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function

View File

@ -26,24 +26,24 @@
-- Create a local variable (in this case called CASEngagementZone) and
-- using the ZONE function find the pre-defined zone called "Engagement Zone"
-- currently on the map and assign it to this variable
local CASEngagementZone = ZONE:New( "Engagement Zone" )
CASEngagementZone = ZONE:New( "Engagement Zone" )
-- Create a local variable (in this case called CASPlane) and
-- using the GROUP function find the aircraft group called "Plane" and assign to this variable
local CASPlane = GROUP:FindByName( "Helicopter" )
CASPlane = GROUP:FindByName( "Helicopter" )
-- Create a local Variable (in this cased called PatrolZone and
-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
-- Create and object (in this case called AICasZone) and
-- using the functions AI_CAS_ZONE assign the parameters that define this object
-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone)
local AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
-- Create an object (in this case called Targets) and
-- using the GROUP function find the group labeled "Targets" and assign it to this object
local Targets = GROUP:FindByName("Targets")
Targets = GROUP:FindByName("Targets")
-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function

View File

@ -25,24 +25,24 @@
-- Create a local variable (in this case called CASEngagementZone) and
-- using the ZONE function find the pre-defined zone called "Engagement Zone"
-- currently on the map and assign it to this variable
local CASEngagementZone = ZONE:New( "Engagement Zone" )
CASEngagementZone = ZONE:New( "Engagement Zone" )
-- Create a local variable (in this case called CASPlane) and
-- using the GROUP function find the aircraft group called "Plane" and assign to this variable
local CASPlane = GROUP:FindByName( "Helicopter" )
CASPlane = GROUP:FindByName( "Helicopter" )
-- Create a local Variable (in this cased called PatrolZone and
-- using the ZONE function find the pre-defined zone called "Patrol Zone" and assign it to this variable
local PatrolZone = ZONE:New( "Patrol Zone" )
PatrolZone = ZONE:New( "Patrol Zone" )
-- Create and object (in this case called AICasZone) and
-- using the functions AI_CAS_ZONE assign the parameters that define this object
-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone)
local AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
AICasZone = AI_CAS_ZONE:New( PatrolZone, 500, 1000, 500, 600, CASEngagementZone )
-- Create an object (in this case called Targets) and
-- using the GROUP function find the group labeled "Targets" and assign it to this object
local Targets = GROUP:FindByName("Targets")
Targets = GROUP:FindByName("Targets")
-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function

View File

@ -28,26 +28,26 @@
-- Create a local variable (in this case called CASEngagementZone) and
-- using the ZONE function find the pre-defined zone called "Engagement Zone"
-- currently on the map and assign it to this variable
local CASEngagementZone = ZONE:New( "Engagement Zone" )
CASEngagementZone = ZONE:New( "Engagement Zone" )
-- Create a local variables (in this case called CASPlane and CASHelicopters) and
-- using the GROUP function find the aircraft group called "Plane" and "Helicopter" and assign to these variables
local CASPlane = GROUP:FindByName( "Plane" )
local CASHelicopter = GROUP:FindByName( "Helicopter" )
CASPlane = GROUP:FindByName( "Plane" )
CASHelicopter = GROUP:FindByName( "Helicopter" )
-- Create two patrol zones, one for the Planes and one for the Helicopters.
local PatrolZonePlanes = ZONE:New( "Patrol Zone Planes" )
local PatrolZoneHelicopters = ZONE:New( "Patrol Zone Helicopters" )
PatrolZonePlanes = ZONE:New( "Patrol Zone Planes" )
PatrolZoneHelicopters = ZONE:New( "Patrol Zone Helicopters" )
-- Create and object (in this case called AICasZone) and
-- using the functions AI_CAS_ZONE assign the parameters that define this object
-- (in this case PatrolZone, 500, 1000, 500, 600, CASEngagementZone)
local AICasZonePlanes = AI_CAS_ZONE:New( PatrolZonePlanes, 400, 500, 500, 2500, CASEngagementZone )
local AICasZoneHelicopters = AI_CAS_ZONE:New( PatrolZoneHelicopters, 100, 250, 300, 1000, CASEngagementZone )
AICasZonePlanes = AI_CAS_ZONE:New( PatrolZonePlanes, 400, 500, 500, 2500, CASEngagementZone )
AICasZoneHelicopters = AI_CAS_ZONE:New( PatrolZoneHelicopters, 100, 250, 300, 1000, CASEngagementZone )
-- Create an object (in this case called Targets) and
-- using the GROUP function find the group labeled "Targets" and assign it to this object
local Targets = GROUP:FindByName("Targets")
Targets = GROUP:FindByName("Targets")
-- Tell the program to use the object (in this case called CASPlane) as the group to use in the CAS function

View File

@ -1,8 +1,8 @@
local CargoEngineer = UNIT:FindByName( "Engineer" )
local InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
CargoEngineer = UNIT:FindByName( "Engineer" )
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
local CargoCarrier = UNIT:FindByName( "Carrier" )
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.

View File

@ -1,8 +1,8 @@
local CargoEngineer = UNIT:FindByName( "Engineer" )
local InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
CargoEngineer = UNIT:FindByName( "Engineer" )
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
local CargoCarrier = UNIT:FindByName( "Carrier" )
CargoCarrier = UNIT:FindByName( "Carrier" )
-- This will Load immediately the Cargo into the Carrier, regardless where the Cargo is.
InfantryCargo:Load( CargoCarrier )

View File

@ -1,10 +1,10 @@
local CargoEngineer = UNIT:FindByName( "Engineer" )
local InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
CargoEngineer = UNIT:FindByName( "Engineer" )
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
local CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" )
CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" )
local CargoCarrierTo = UNIT:FindByName( "CarrierTo" )
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.

View File

@ -1,13 +1,13 @@
local CargoSet = SET_BASE:New()
CargoSet = SET_BASE:New()
CargoSet:Add( "Engineer1", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer1" ), "Engineers", "Engineer", 81, 2000, 25 ) )
CargoSet:Add( "Engineer2", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer2" ), "Engineers", "Engineer", 64, 2000, 25 ) )
CargoSet:Add( "Engineer3", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer3" ), "Engineers", "Engineer", 72, 2000, 25 ) )
CargoSet:Add( "Engineer4", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer4" ), "Engineers", "Engineer", 69, 2000, 25 ) )
local InfantryCargo = AI_CARGO_GROUPED:New( CargoSet, "Engineers", "Engineers", 2000, 25 )
InfantryCargo = AI_CARGO_GROUPED:New( CargoSet, "Engineers", "Engineers", 2000, 25 )
local CargoCarrier = UNIT:FindByName( "Carrier" )
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.

View File

@ -1,13 +1,13 @@
local CargoSet = SET_BASE:New()
CargoSet = SET_BASE:New()
CargoSet:Add( "Engineer1", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer1" ), "Engineers", "Engineer", 81, 2000, 25 ) )
CargoSet:Add( "Engineer2", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer2" ), "Engineers", "Engineer", 64, 2000, 25 ) )
CargoSet:Add( "Engineer3", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer3" ), "Engineers", "Engineer", 72, 2000, 25 ) )
CargoSet:Add( "Engineer4", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer4" ), "Engineers", "Engineer", 69, 2000, 25 ) )
local InfantryCargo = AI_CARGO_GROUPED:New( CargoSet, "Engineers", "Engineers", 2000, 25 )
InfantryCargo = AI_CARGO_GROUPED:New( CargoSet, "Engineers", "Engineers", 2000, 25 )
local CargoCarrier = UNIT:FindByName( "Carrier" )
CargoCarrier = UNIT:FindByName( "Carrier" )
-- This will Load immediately the Cargo into the Carrier, regardless where the Cargo is.
InfantryCargo:Load( CargoCarrier )

View File

@ -1,15 +1,15 @@
local CargoSet = SET_BASE:New()
CargoSet = SET_BASE:New()
CargoSet:Add( "Engineer1", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer1" ), "Engineers", "Engineer", 81, 2000, 25 ) )
CargoSet:Add( "Engineer2", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer2" ), "Engineers", "Engineer", 64, 2000, 25 ) )
CargoSet:Add( "Engineer3", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer3" ), "Engineers", "Engineer", 72, 2000, 25 ) )
CargoSet:Add( "Engineer4", AI_CARGO_UNIT:New( UNIT:FindByName( "Engineer4" ), "Engineers", "Engineer", 69, 2000, 25 ) )
local InfantryCargo = AI_CARGO_GROUPED:New( CargoSet, "Engineers", "Engineers", 2000, 25 )
InfantryCargo = AI_CARGO_GROUPED:New( CargoSet, "Engineers", "Engineers", 2000, 25 )
local CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" )
CargoCarrierFrom = UNIT:FindByName( "CarrierFrom" )
local CargoCarrierTo = UNIT:FindByName( "CarrierTo" )
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.

View File

@ -1,8 +1,8 @@
local DeliveryUnit = UNIT:FindByName( "Delivery" )
local Letter = AI_CARGO_PACKAGE:New( DeliveryUnit, "Letter", "Secret Orders", "0.3", 2000, 25 )
DeliveryUnit = UNIT:FindByName( "Delivery" )
Letter = AI_CARGO_PACKAGE:New( DeliveryUnit, "Letter", "Secret Orders", "0.3", 2000, 25 )
local CargoCarrier = UNIT:FindByName( "Carrier" )
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.

View File

@ -1,8 +1,8 @@
local CargoEngineer = UNIT:FindByName( "Engineer" )
local InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
CargoEngineer = UNIT:FindByName( "Engineer" )
InfantryCargo = AI_CARGO_UNIT:New( CargoEngineer, "Engineer", "Engineer Sven", "81", 2000, 25 )
local CargoCarrier = UNIT:FindByName( "Carrier" )
CargoCarrier = UNIT:FindByName( "Carrier" )
-- This will Load the Cargo into the Carrier, regardless where the Cargo is.
InfantryCargo:Load( CargoCarrier )

View File

@ -17,8 +17,8 @@
-- 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.
local FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
local FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
FACDetection:__Start( 5 )

View File

@ -16,16 +16,16 @@
-- 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.
local RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
local RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
local HQ = GROUP:FindByName( "HQ" )
HQ = GROUP:FindByName( "HQ" )
local CC = COMMANDCENTER:New( HQ, "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
local RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
local RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance.
RecceDetection1:Start()
@ -53,4 +53,4 @@ function RecceDetection2:OnAfterDetect(From,Event,To)
local DetectionReport = RecceDetection2:DetectedReportDetailed()
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" )
end
end

View File

@ -1,9 +1,9 @@
local FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
local FACDetection = DETECTION_AREAS:New( FACSetGroup, 1000, 250 )
local SeadClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart()
local DestroyClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart()
FACDetection = DETECTION_AREAS:New( FACSetGroup, 1000, 250 )
SeadClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart()
DestroyClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterStart()
local FACReporting = FAC_REPORTING:New( FACClientSet, FACDetection )
FACReporting = FAC_REPORTING:New( FACClientSet, FACDetection )

View File

@ -16,18 +16,18 @@
-- 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.
local RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
local RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
local HQ = GROUP:FindByName( "HQ" )
HQ = GROUP:FindByName( "HQ" )
local CC = COMMANDCENTER:New( HQ, "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
local RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
local RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
local ForestZone = ZONE_POLYGON:New( "ForestZone", GROUP:FindByName( "ForestZone" ) )
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.

View File

@ -16,13 +16,13 @@
-- 1. Observe the detection reporting of both the Recce.
-- 2. Eventually all units should be detected by both Recce.
local RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
local HQ = GROUP:FindByName( "HQ" )
HQ = GROUP:FindByName( "HQ" )
local CC = COMMANDCENTER:New( HQ, "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
local RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
RecceDetection:Start()

View File

@ -18,13 +18,13 @@
-- 1. Observe the detection reporting of both the Recce.
-- 2. Eventually all units should be detected by both Recce.
local RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
local HQ = GROUP:FindByName( "HQ" )
HQ = GROUP:FindByName( "HQ" )
local CC = COMMANDCENTER:New( HQ, "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
local RecceDetection = DETECTION_TYPES:New( RecceSetGroup )
RecceDetection = DETECTION_TYPES:New( RecceSetGroup )
RecceDetection:Start()

View File

@ -16,17 +16,17 @@
-- 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.
local RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
local RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
local HQ = GROUP:FindByName( "HQ" )
HQ = GROUP:FindByName( "HQ" )
local CC = COMMANDCENTER:New( HQ, "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
local RecceDetection1 = DETECTION_AREAS:New( RecceSetGroup1, 1000 )
RecceDetection1 = DETECTION_AREAS:New( RecceSetGroup1, 1000 )
RecceDetection1:BoundDetectedZones()
local RecceDetection2 = DETECTION_AREAS:New( RecceSetGroup2, 1000 )
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()

View File

@ -21,9 +21,9 @@
-- 5. While driving in between the areas, it will have a separate area.
-- 6. Observe the correct removal or relocation of the ZONEs.
local FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC Group" ):FilterStart()
local FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
FACDetection = DETECTION_AREAS:New( FACSetGroup, 150, 250 ):BoundDetectedZones():SmokeDetectedUnits()
FACDetection:__Start( 5 )

View File

@ -16,14 +16,14 @@
-- 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.
local RecceSetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Recce" ):FilterStart()
local ArtillerySetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Artillery" ):FilterStart()
RecceSetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Recce" ):FilterStart()
ArtillerySetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Artillery" ):FilterStart()
local HQ = GROUP:FindByName( "HQ" )
HQ = GROUP:FindByName( "HQ" )
local CC = COMMANDCENTER:New( HQ, "HQ" )
CC = COMMANDCENTER:New( HQ, "HQ" )
local RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
RecceDetection:SetDetectionInterval( 5 )
RecceDetection:Start()

View File

@ -17,9 +17,9 @@
-- 2. Observe the smoking of the units detected
-- 3. Observe the areas being flexibly changed very detection run.
local FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart()
FACSetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart()
local FACDetection = DETECTION_AREAS:New( FACSetGroup, 2000, 250 ):BoundDetectedZones():SmokeDetectedUnits()
FACDetection = DETECTION_AREAS:New( FACSetGroup, 2000, 250 ):BoundDetectedZones():SmokeDetectedUnits()
FACDetection:__Start( 5 )

View File

@ -13,7 +13,7 @@
-- 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.
local Plane = UNIT:FindByName( "Plane" )
Plane = UNIT:FindByName( "Plane" )
Plane:HandleEvent( EVENTS.Shot )

View File

@ -13,9 +13,9 @@
-- 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.
local Plane = UNIT:FindByName( "Plane" )
Plane = UNIT:FindByName( "Plane" )
local Tank = UNIT:FindByName( "Tank" )
Tank = UNIT:FindByName( "Tank" )
Plane:HandleEvent( EVENTS.Hit )
Tank:HandleEvent( EVENTS.Hit )

View File

@ -13,9 +13,9 @@
-- 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.
local PlaneAI = UNIT:FindByName( "PlaneAI" )
PlaneAI = UNIT:FindByName( "PlaneAI" )
local PlaneHuman = UNIT:FindByName( "PlaneHuman" )
PlaneHuman = UNIT:FindByName( "PlaneHuman" )
PlaneAI:HandleEvent( EVENTS.Takeoff )
PlaneHuman:HandleEvent( EVENTS.Takeoff )

View File

@ -15,10 +15,10 @@
-- 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".
local PlaneAI = UNIT:FindByName( "PlaneAI" )
PlaneAI = UNIT:FindByName( "PlaneAI" )
-- Create a SPAWN object to spawn a new plane once the hold one lands.
local SpawnPlane = SPAWN:New( "SpawnPlaneAI" )
SpawnPlane = SPAWN:New( "SpawnPlaneAI" )
-- Declare a new variable that will hold the new spawned SpawnPlaneAI
local NewPlane

View File

@ -15,7 +15,7 @@
-- 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".
local PlaneHuman = UNIT:FindByName( "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 )

View File

@ -15,7 +15,7 @@
-- 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.
local PlaneGroup = GROUP:FindByName( "Group Plane A" )
PlaneGroup = GROUP:FindByName( "Group Plane A" )
PlaneGroup:HandleEvent( EVENTS.Shot )

View File

@ -15,7 +15,7 @@
-- 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.
local TanksGroup = GROUP:FindByName( "Group Tanks A" )
TanksGroup = GROUP:FindByName( "Group Tanks A" )
TanksGroup:HandleEvent( EVENTS.Hit )

View File

@ -13,10 +13,10 @@
-- 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.
local CC = COMMANDCENTER:New( UNIT:FindByName( "HQ" ), "HQ" )
CC = COMMANDCENTER:New( UNIT:FindByName( "HQ" ), "HQ" )
local EventHandler1 = EVENTHANDLER:New()
local EventHandler2 = EVENTHANDLER:New()
EventHandler1 = EVENTHANDLER:New()
EventHandler2 = EVENTHANDLER:New()
EventHandler1:HandleEvent( EVENTS.Hit )
EventHandler2:HandleEvent( EVENTS.Hit )

Some files were not shown because too many files have changed in this diff Show More