Next step of folder restructure

This commit is contained in:
kaltokri
2024-01-01 22:40:31 +01:00
parent b95cb6fd83
commit ccbc7dc549
898 changed files with 17060 additions and 258791 deletions

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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, 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, 250, 250 )
LargeFormation:__Start( 1 )

View File

@@ -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 )

View File

@@ -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()

View File

@@ -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 )

View File

@@ -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()

View File

@@ -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

View File

@@ -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 )

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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 )

View File

@@ -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()

View File

@@ -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

View File

@@ -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" )

View File

@@ -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" )

View File

@@ -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" )

View File

@@ -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" )

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