mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2026-08-23 12:09:37 +00:00
Updated Moose.lua
This commit is contained in:
+80
-80
@@ -1,80 +1,80 @@
|
|||||||
-- This test mission models the behaviour of the AI_PATROL_ZONE class.
|
-- This test mission models the behaviour of the AI_PATROL_ZONE class.
|
||||||
--
|
--
|
||||||
-- It creates a 2 AI_PATROL_ZONE objects with the name Patrol1 and Patrol2.
|
-- It creates a 2 AI_PATROL_ZONE objects with the name Patrol1 and Patrol2.
|
||||||
-- Patrol1 will govern a GROUP object to patrol the zone defined by PatrolZone1, within 3000 meters and 6000 meters, within a speed of 400 and 600 km/h.
|
-- Patrol1 will govern a GROUP object to patrol the zone defined by PatrolZone1, within 3000 meters and 6000 meters, within a speed of 400 and 600 km/h.
|
||||||
-- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 60 secondes, before returning to base.
|
-- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 60 secondes, before returning to base.
|
||||||
--
|
--
|
||||||
-- Patrol2 will goven a GROUP object to patrol the zone defined by PatrolZone2, within 600 meters and 1000 meters, within a speed of 300 and 400 km/h.
|
-- Patrol2 will goven a GROUP object to patrol the zone defined by PatrolZone2, within 600 meters and 1000 meters, within a speed of 300 and 400 km/h.
|
||||||
-- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 0 secondes, before returning to base.
|
-- When the GROUP object that is assigned to Patrol has fuel below 20%, the GROUP object will orbit for 0 secondes, before returning to base.
|
||||||
--
|
--
|
||||||
-- The Patrol1 and Patrol2 object have 2 state transition functions defined, which customize the default behaviour of the RTB state.
|
-- The Patrol1 and Patrol2 object have 2 state transition functions defined, which customize the default behaviour of the RTB state.
|
||||||
-- When Patrol1 goes RTB, it will create a new GROUP object, that will be assigned to Patrol2.
|
-- When Patrol1 goes RTB, it will create a new GROUP object, that will be assigned to Patrol2.
|
||||||
-- When Patrol2 goes RTB, it will create a new GROUP object, that will be assgined to Patrol1.
|
-- When Patrol2 goes RTB, it will create a new GROUP object, that will be assgined to Patrol1.
|
||||||
--
|
--
|
||||||
-- In this way, the Patrol1 and Patrol2 objects are fluctuating the patrol pattern from PatrolZone1 and PatrolZone2 :-)
|
-- In this way, the Patrol1 and Patrol2 objects are fluctuating the patrol pattern from PatrolZone1 and PatrolZone2 :-)
|
||||||
|
|
||||||
|
|
||||||
PatrolZoneGroup1 = GROUP:FindByName( "Patrol Zone 1" )
|
PatrolZoneGroup1 = GROUP:FindByName( "Patrol Zone 1" )
|
||||||
PatrolZone1 = ZONE_POLYGON:New( "Patrol Zone 1", PatrolZoneGroup1 )
|
PatrolZone1 = ZONE_POLYGON:New( "Patrol Zone 1", PatrolZoneGroup1 )
|
||||||
|
|
||||||
PatrolZoneGroup2 = GROUP:FindByName( "Patrol Zone 2" )
|
PatrolZoneGroup2 = GROUP:FindByName( "Patrol Zone 2" )
|
||||||
PatrolZone2 = ZONE_POLYGON:New( "Patrol Zone 2", PatrolZoneGroup2 )
|
PatrolZone2 = ZONE_POLYGON:New( "Patrol Zone 2", PatrolZoneGroup2 )
|
||||||
|
|
||||||
PatrolSpawn = SPAWN:New( "Patrol Group" )
|
PatrolSpawn = SPAWN:New( "Patrol Group" )
|
||||||
PatrolGroup = PatrolSpawn:Spawn()
|
PatrolGroup = PatrolSpawn:Spawn()
|
||||||
|
|
||||||
Patrol1 = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 )
|
Patrol1 = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 )
|
||||||
Patrol1:ManageFuel( 0.2, 60 )
|
Patrol1:ManageFuel( 0.2, 60 )
|
||||||
Patrol1:SetControllable( PatrolGroup )
|
Patrol1:SetControllable( PatrolGroup )
|
||||||
Patrol1:__Start( 5 )
|
Patrol1:__Start( 5 )
|
||||||
|
|
||||||
Patrol2 = AI_PATROL_ZONE:New( PatrolZone2, 600, 1000, 300, 400 )
|
Patrol2 = AI_PATROL_ZONE:New( PatrolZone2, 600, 1000, 300, 400 )
|
||||||
Patrol2:ManageFuel( 0.2, 0 )
|
Patrol2:ManageFuel( 0.2, 0 )
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||||
-- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
-- @return #boolean If false is returned, then the OnAfter state transition function will not be called.
|
-- @return #boolean If false is returned, then the OnAfter state transition function will not be called.
|
||||||
function Patrol1:OnLeaveRTB( AIGroup )
|
function Patrol1:OnLeaveRTB( AIGroup )
|
||||||
AIGroup:MessageToRed( "Returning to base", 20 )
|
AIGroup:MessageToRed( "Returning to base", 20 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||||
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function Patrol1:OnAfterRTB( AIGroup )
|
function Patrol1:OnAfterRTB( AIGroup )
|
||||||
local NewGroup = PatrolSpawn:Spawn()
|
local NewGroup = PatrolSpawn:Spawn()
|
||||||
Patrol2:SetControllable( NewGroup )
|
Patrol2:SetControllable( NewGroup )
|
||||||
Patrol2:__Start( 1 )
|
Patrol2:__Start( 1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol1** object
|
||||||
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function Patrol1:OnEnterPatrol( AIGroup )
|
function Patrol1:OnEnterPatrol( AIGroup )
|
||||||
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone1:GetName() , 20 )
|
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone1:GetName() , 20 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||||
-- @param #AI_PATROL_ZONE self
|
-- @param #AI_PATROL_ZONE self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
-- @return #boolean If false is returned, then the OnEnter state transition function will not be called.
|
-- @return #boolean If false is returned, then the OnEnter state transition function will not be called.
|
||||||
function Patrol2:OnBeforeRTB( AIGroup )
|
function Patrol2:OnBeforeRTB( AIGroup )
|
||||||
AIGroup:MessageToRed( "Returning to base", 20 )
|
AIGroup:MessageToRed( "Returning to base", 20 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||||
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function Patrol2:OnEnterRTB( AIGroup )
|
function Patrol2:OnEnterRTB( AIGroup )
|
||||||
local NewGroup = PatrolSpawn:Spawn()
|
local NewGroup = PatrolSpawn:Spawn()
|
||||||
Patrol1:SetControllable( NewGroup )
|
Patrol1:SetControllable( NewGroup )
|
||||||
Patrol1:__Start( 1 )
|
Patrol1:__Start( 1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
--- State transition function for the PROCESS\_PATROLZONE **Patrol2** object
|
||||||
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
-- @param Process_PatrolCore.Zone#AI_PATROL_ZONE self
|
||||||
-- @param Wrapper.Group#GROUP AIGroup
|
-- @param Wrapper.Group#GROUP AIGroup
|
||||||
function Patrol2:OnEnterPatrol( AIGroup )
|
function Patrol2:OnEnterPatrol( AIGroup )
|
||||||
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone2:GetName() , 20 )
|
AIGroup:MessageToRed( "Patrolling in zone " .. PatrolZone2:GetName() , 20 )
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
--- Simple function scheduling
|
--- Simple function scheduling
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 12 Dec 2016
|
-- Date Created: 12 Dec 2016
|
||||||
--
|
--
|
||||||
-- # Situation
|
-- # Situation
|
||||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||||
-- Create a new SCHEDULER object.
|
-- Create a new SCHEDULER object.
|
||||||
-- Check the DCS.log.
|
-- Check the DCS.log.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. The log should contain a "Hello World" line that is fired off 10 seconds after mission start.
|
-- 1. The log should contain a "Hello World" line that is fired off 10 seconds after mission start.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- # Status: TESTED - 12 Dec 2016
|
-- # Status: TESTED - 12 Dec 2016
|
||||||
|
|
||||||
local TestScheduler = SCHEDULER:New( nil,
|
local TestScheduler = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
BASE:E( "Hello World 1")
|
BASE:E( "Hello World 1")
|
||||||
end, {}, 1
|
end, {}, 1
|
||||||
)
|
)
|
||||||
|
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
BASE:E( "Hello World 2")
|
BASE:E( "Hello World 2")
|
||||||
end, {}, 2
|
end, {}, 2
|
||||||
)
|
)
|
||||||
|
|
||||||
collectgarbage()
|
collectgarbage()
|
||||||
|
|
||||||
|
|||||||
+33
-33
@@ -1,34 +1,34 @@
|
|||||||
--- Simple Object Scheduling
|
--- Simple Object Scheduling
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 12 Dec 2016
|
-- Date Created: 12 Dec 2016
|
||||||
--
|
--
|
||||||
-- # Situation
|
-- # Situation
|
||||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||||
-- Create a new SCHEDULER object.
|
-- Create a new SCHEDULER object.
|
||||||
-- Check the DCS.log.
|
-- Check the DCS.log.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Tracing of a scheduler in an Object.
|
-- 1. Tracing of a scheduler in an Object.
|
||||||
-- The log should contain a "Hello World" line of the object, that is fired off 1 seconds after mission start.
|
-- The log should contain a "Hello World" line of the object, that is fired off 1 seconds after mission start.
|
||||||
--
|
--
|
||||||
-- # Status: TESTED - 12 Dec 2016
|
-- # Status: TESTED - 12 Dec 2016
|
||||||
|
|
||||||
local TEST_BASE = {
|
local TEST_BASE = {
|
||||||
ClassName = "TEST_BASE",
|
ClassName = "TEST_BASE",
|
||||||
}
|
}
|
||||||
|
|
||||||
function TEST_BASE:New( Message )
|
function TEST_BASE:New( Message )
|
||||||
self = BASE:Inherit( self, BASE:New() )
|
self = BASE:Inherit( self, BASE:New() )
|
||||||
|
|
||||||
local TestScheduler = SCHEDULER:New( self,
|
local TestScheduler = SCHEDULER:New( self,
|
||||||
function( Object, Message )
|
function( Object, Message )
|
||||||
Object:E( Message )
|
Object:E( Message )
|
||||||
end, { Message }, 1
|
end, { Message }, 1
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
local Test = TEST_BASE:New( "Hello World" )
|
local Test = TEST_BASE:New( "Hello World" )
|
||||||
+23
-23
@@ -1,24 +1,24 @@
|
|||||||
--- Simple repeat scheduling of a function.
|
--- Simple repeat scheduling of a function.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 13 Dec 2016
|
-- Date Created: 13 Dec 2016
|
||||||
--
|
--
|
||||||
-- # Situation
|
-- # Situation
|
||||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||||
-- Create a new SCHEDULER object.
|
-- Create a new SCHEDULER object.
|
||||||
-- Check the DCS.log.
|
-- Check the DCS.log.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. The log should contain "Hello World Repeat" lines that is fired off 1 second after mission start and is repeated every 1 seconds.
|
-- 1. The log should contain "Hello World Repeat" lines that is fired off 1 second after mission start and is repeated every 1 seconds.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- # Status: TESTED - 13 Dec 2016
|
-- # Status: TESTED - 13 Dec 2016
|
||||||
|
|
||||||
local TestScheduler = SCHEDULER:New( nil,
|
local TestScheduler = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
BASE:E( "Hello World Repeat")
|
BASE:E( "Hello World Repeat")
|
||||||
end, {}, 1, 1
|
end, {}, 1, 1
|
||||||
)
|
)
|
||||||
+44
-44
@@ -1,44 +1,44 @@
|
|||||||
--- Object Repeat Scheduling.
|
--- Object Repeat Scheduling.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 13 Dec 2016
|
-- Date Created: 13 Dec 2016
|
||||||
--
|
--
|
||||||
-- # Situation
|
-- # Situation
|
||||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||||
-- Create a new SCHEDULER object.
|
-- Create a new SCHEDULER object.
|
||||||
-- Check the DCS.log.
|
-- Check the DCS.log.
|
||||||
--
|
--
|
||||||
-- Three Test objects are created.
|
-- Three Test objects are created.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1".
|
-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1".
|
||||||
-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute.
|
-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute.
|
||||||
-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute.
|
-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute.
|
||||||
--
|
--
|
||||||
-- # Status: TESTED - 13 Dec 2016
|
-- # Status: TESTED - 13 Dec 2016
|
||||||
|
|
||||||
local TEST_BASE = {
|
local TEST_BASE = {
|
||||||
ClassName = "TEST_BASE",
|
ClassName = "TEST_BASE",
|
||||||
}
|
}
|
||||||
|
|
||||||
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
|
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
|
||||||
self = BASE:Inherit( self, BASE:New() )
|
self = BASE:Inherit( self, BASE:New() )
|
||||||
|
|
||||||
self.TestScheduler = SCHEDULER:New( self,
|
self.TestScheduler = SCHEDULER:New( self,
|
||||||
function( Object, Message )
|
function( Object, Message )
|
||||||
Object:E( Message )
|
Object:E( Message )
|
||||||
end, { Message }, Start, Repeat, Randomize, Stop
|
end, { Message }, Start, Repeat, Randomize, Stop
|
||||||
)
|
)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
|
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 )
|
local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 )
|
||||||
|
|
||||||
local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 )
|
local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 )
|
||||||
|
|||||||
+40
-40
@@ -1,41 +1,41 @@
|
|||||||
--- Simple repeat scheduling of a function.
|
--- Simple repeat scheduling of a function.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 14 Dec 2016
|
-- Date Created: 14 Dec 2016
|
||||||
--
|
--
|
||||||
-- # Situation
|
-- # Situation
|
||||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||||
-- Create a new SCHEDULER object.
|
-- Create a new SCHEDULER object.
|
||||||
-- Check the DCS.log.
|
-- Check the DCS.log.
|
||||||
--
|
--
|
||||||
-- Start a schedule called TestScheduler. TestScheduler will repeat the words "Hello World Repeat" every second in the log.
|
-- Start a schedule called TestScheduler. TestScheduler will repeat the words "Hello World Repeat" every second in the log.
|
||||||
-- After 10 seconds, TestScheduler will stop the scheduler.
|
-- After 10 seconds, TestScheduler will stop the scheduler.
|
||||||
-- After 20 seconds, TestScheduler will restart the scheduler.
|
-- After 20 seconds, TestScheduler will restart the scheduler.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Check that the "Hello World Repeat" lines are consistent with the scheduling timing. They should stop showing after 10 seconds, and restart after 20 seconds.
|
-- 1. Check that the "Hello World Repeat" lines are consistent with the scheduling timing. They should stop showing after 10 seconds, and restart after 20 seconds.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- # Status: TESTED - 14 Dec 2016
|
-- # Status: TESTED - 14 Dec 2016
|
||||||
|
|
||||||
local TestScheduler = SCHEDULER:New( nil,
|
local TestScheduler = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
BASE:E( timer.getTime() .. " - Hello World Repeat")
|
BASE:E( timer.getTime() .. " - Hello World Repeat")
|
||||||
end, {}, 1, 1
|
end, {}, 1, 1
|
||||||
)
|
)
|
||||||
|
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
TestScheduler:Stop()
|
TestScheduler:Stop()
|
||||||
end, {}, 10
|
end, {}, 10
|
||||||
)
|
)
|
||||||
|
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
TestScheduler:Start()
|
TestScheduler:Start()
|
||||||
end, {}, 20
|
end, {}, 20
|
||||||
)
|
)
|
||||||
|
|
||||||
+59
-59
@@ -1,60 +1,60 @@
|
|||||||
--- No Object Scheduling because of garbage collect and Object nillification.
|
--- No Object Scheduling because of garbage collect and Object nillification.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 12 Dec 2016
|
-- Date Created: 12 Dec 2016
|
||||||
--
|
--
|
||||||
-- # Situation
|
-- # Situation
|
||||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||||
-- Create a new SCHEDULER object.
|
-- Create a new SCHEDULER object.
|
||||||
-- Check the DCS.log.
|
-- Check the DCS.log.
|
||||||
--
|
--
|
||||||
-- A Test object is created.
|
-- A Test object is created.
|
||||||
-- It is nillified directly after the Schedule has been planned.
|
-- It is nillified directly after the Schedule has been planned.
|
||||||
-- There should be no schedule fired.
|
-- There should be no schedule fired.
|
||||||
-- The Test object should be garbage collected!
|
-- The Test object should be garbage collected!
|
||||||
--
|
--
|
||||||
-- THIS IS A VERY IMPORTANT TEST!
|
-- THIS IS A VERY IMPORTANT TEST!
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. No schedule should be fired! The destructors of the Test object should be shown.
|
-- 1. No schedule should be fired! The destructors of the Test object should be shown.
|
||||||
-- 2. Commend the nillification of the Test object in the source, and test again.
|
-- 2. Commend the nillification of the Test object in the source, and test again.
|
||||||
-- The schedule should now be fired and Hello World should be logged through the Test object.
|
-- The schedule should now be fired and Hello World should be logged through the Test object.
|
||||||
--
|
--
|
||||||
-- # Status: STARTED - 12 Dec 2016
|
-- # Status: STARTED - 12 Dec 2016
|
||||||
|
|
||||||
local TEST_BASE = {
|
local TEST_BASE = {
|
||||||
ClassName = "TEST_BASE",
|
ClassName = "TEST_BASE",
|
||||||
}
|
}
|
||||||
|
|
||||||
function TEST_BASE:New( Message )
|
function TEST_BASE:New( Message )
|
||||||
self = BASE:Inherit( self, BASE:New() )
|
self = BASE:Inherit( self, BASE:New() )
|
||||||
|
|
||||||
self.TestScheduler = SCHEDULER:New( self,
|
self.TestScheduler = SCHEDULER:New( self,
|
||||||
function( Object, Message )
|
function( Object, Message )
|
||||||
Object:E( Message )
|
Object:E( Message )
|
||||||
end, { Message }, 1
|
end, { Message }, 1
|
||||||
)
|
)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
local Test1 = TEST_BASE:New( "Hello World Test 1" )
|
local Test1 = TEST_BASE:New( "Hello World Test 1" )
|
||||||
Test1 = nil
|
Test1 = nil
|
||||||
BASE:E( Test1 )
|
BASE:E( Test1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
local Test2 = TEST_BASE:New( "Hello World Test 2" )
|
local Test2 = TEST_BASE:New( "Hello World Test 2" )
|
||||||
BASE:E( Test2 )
|
BASE:E( Test2 )
|
||||||
|
|
||||||
local Test3 = TEST_BASE:New( "Hello World Test 3" )
|
local Test3 = TEST_BASE:New( "Hello World Test 3" )
|
||||||
Test3 = nil
|
Test3 = nil
|
||||||
BASE:E( Test3 )
|
BASE:E( Test3 )
|
||||||
|
|
||||||
collectgarbage()
|
collectgarbage()
|
||||||
|
|
||||||
BASE:E( "Collect Garbage executed." )
|
BASE:E( "Collect Garbage executed." )
|
||||||
BASE:E( "You should only see a Hello Worlld message for Test 2!" )
|
BASE:E( "You should only see a Hello Worlld message for Test 2!" )
|
||||||
BASE:E( "Check if Test 1 and Test 3 are garbage collected!" )
|
BASE:E( "Check if Test 1 and Test 3 are garbage collected!" )
|
||||||
+80
-80
@@ -1,80 +1,80 @@
|
|||||||
--- Object Repeat Scheduling.
|
--- Object Repeat Scheduling.
|
||||||
--
|
--
|
||||||
-- ===
|
-- ===
|
||||||
--
|
--
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 13 Dec 2016
|
-- Date Created: 13 Dec 2016
|
||||||
--
|
--
|
||||||
-- # Situation
|
-- # Situation
|
||||||
-- Three objects Test1, Test2, Test 3 are created with schedule a function.
|
-- Three objects Test1, Test2, Test 3 are created with schedule a function.
|
||||||
-- After 15 seconds, Test1 is nillified and Garbage Collect is done.
|
-- After 15 seconds, Test1 is nillified and Garbage Collect is done.
|
||||||
-- After 30 seconds, Test2 is nillified and Garbage Collect is done.
|
-- After 30 seconds, Test2 is nillified and Garbage Collect is done.
|
||||||
-- After 45 seconds, Test3 is nillified and Garbage Collect is done.
|
-- After 45 seconds, Test3 is nillified and Garbage Collect is done.
|
||||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||||
-- Create a new SCHEDULER object.
|
-- Create a new SCHEDULER object.
|
||||||
-- Check the DCS.log.
|
-- Check the DCS.log.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- Three Test objects are created.
|
-- Three Test objects are created.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1".
|
-- 1. Object Test1 should start after 1 seconds showing every second "Hello World Repeat 1".
|
||||||
-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute.
|
-- 2. Object Test2 should start after 2 seconds showing every 2 seconds "Hello World Repeat 2" and stop after one minute.
|
||||||
-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute.
|
-- 3. Object Test3 should start after 10 seconds showing with a 10 seconds randomized interval of 10 seconds "Hello World Repeat 3" and stop after one minute.
|
||||||
-- 4. After 15 seconds, Test1 should stop working. No "Hello World Repeat 1" may be shown after 15 seconds.
|
-- 4. After 15 seconds, Test1 should stop working. No "Hello World Repeat 1" may be shown after 15 seconds.
|
||||||
-- 5. After 30 seconds, Test2 should stop working. No "Hello World Repeat 2" may be shown after 30 seconds.
|
-- 5. After 30 seconds, Test2 should stop working. No "Hello World Repeat 2" may be shown after 30 seconds.
|
||||||
-- 6. After 45 seconds, Test3 should stop working. No "Hello World Repeat 3" may be shown after 45 seconds.
|
-- 6. After 45 seconds, Test3 should stop working. No "Hello World Repeat 3" may be shown after 45 seconds.
|
||||||
--
|
--
|
||||||
-- # Status: TESTED - 13 Dec 2016
|
-- # Status: TESTED - 13 Dec 2016
|
||||||
|
|
||||||
local TEST_BASE = {
|
local TEST_BASE = {
|
||||||
ClassName = "TEST_BASE",
|
ClassName = "TEST_BASE",
|
||||||
}
|
}
|
||||||
|
|
||||||
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
|
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
|
||||||
self = BASE:Inherit( self, BASE:New() )
|
self = BASE:Inherit( self, BASE:New() )
|
||||||
|
|
||||||
self.TestScheduler = SCHEDULER:New( self,
|
self.TestScheduler = SCHEDULER:New( self,
|
||||||
function( Object, Message )
|
function( Object, Message )
|
||||||
Object:E( Message )
|
Object:E( Message )
|
||||||
end, { Message }, Start, Repeat, Randomize, Stop
|
end, { Message }, Start, Repeat, Randomize, Stop
|
||||||
)
|
)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
|
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
|
||||||
|
|
||||||
-- Nillify Test1 after 15 seconds and garbage collect.
|
-- Nillify Test1 after 15 seconds and garbage collect.
|
||||||
local Nil1 = SCHEDULER:New( nil,
|
local Nil1 = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
BASE:E( "Nillify Test1 and Garbage Collect" )
|
BASE:E( "Nillify Test1 and Garbage Collect" )
|
||||||
Test1 = nil
|
Test1 = nil
|
||||||
collectgarbage()
|
collectgarbage()
|
||||||
end, {}, 15 )
|
end, {}, 15 )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 )
|
local Test2 = TEST_BASE:New( "Hello World Repeat 2", 2, 2, 0, 60 )
|
||||||
|
|
||||||
|
|
||||||
local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 )
|
local Test3 = TEST_BASE:New( "Hello World Repeat 3", 10, 10, 1.0, 60 )
|
||||||
|
|
||||||
-- Nillify Test2 after 30 seconds and garbage collect.
|
-- Nillify Test2 after 30 seconds and garbage collect.
|
||||||
local Nil2 = SCHEDULER:New( nil,
|
local Nil2 = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
BASE:E( "Nillify Test2 and Garbage Collect" )
|
BASE:E( "Nillify Test2 and Garbage Collect" )
|
||||||
Test2 = nil
|
Test2 = nil
|
||||||
collectgarbage()
|
collectgarbage()
|
||||||
end, {}, 30 )
|
end, {}, 30 )
|
||||||
|
|
||||||
-- Nillify Test3 after 45 seconds and garbage collect.
|
-- Nillify Test3 after 45 seconds and garbage collect.
|
||||||
local Nil3 = SCHEDULER:New( nil,
|
local Nil3 = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
BASE:E( "Nillify Test3 and Garbage Collect" )
|
BASE:E( "Nillify Test3 and Garbage Collect" )
|
||||||
Test3 = nil
|
Test3 = nil
|
||||||
collectgarbage()
|
collectgarbage()
|
||||||
end, {}, 45 )
|
end, {}, 45 )
|
||||||
|
|
||||||
collectgarbage()
|
collectgarbage()
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
|
|
||||||
BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart()
|
BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart()
|
||||||
|
|
||||||
RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart()
|
RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart()
|
||||||
|
|
||||||
RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart()
|
RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart()
|
||||||
|
|
||||||
BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart()
|
BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart()
|
||||||
|
|
||||||
BlueAirbaseSet:Flush()
|
BlueAirbaseSet:Flush()
|
||||||
|
|
||||||
RedAirbaseSet:Flush()
|
RedAirbaseSet:Flush()
|
||||||
|
|
||||||
RedAirbaseHelipadSet:Flush()
|
RedAirbaseHelipadSet:Flush()
|
||||||
|
|
||||||
BlueAirbaseShipSet:Flush()
|
BlueAirbaseShipSet:Flush()
|
||||||
+34
-34
@@ -1,34 +1,34 @@
|
|||||||
---
|
---
|
||||||
-- Name: SET-102 - Test SET_GROUP object against ZONE
|
-- Name: SET-102 - Test SET_GROUP object against ZONE
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 31 Mar 2017
|
-- Date Created: 31 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE has been defined, and the SET_GROUP object is checked against the zone.
|
-- A ZONE has been defined, and the SET_GROUP object is checked against the zone.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone.
|
-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone.
|
||||||
-- 2. Observe the results of the functions.
|
-- 2. Observe the results of the functions.
|
||||||
|
|
||||||
|
|
||||||
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
|
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
|
||||||
|
|
||||||
Zone = ZONE:New( "Zone" )
|
Zone = ZONE:New( "Zone" )
|
||||||
|
|
||||||
SetGroupObject:ForEachGroupCompletelyInZone( Zone,
|
SetGroupObject:ForEachGroupCompletelyInZone( Zone,
|
||||||
function( GroupObject )
|
function( GroupObject )
|
||||||
GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } )
|
GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } )
|
||||||
end )
|
end )
|
||||||
|
|
||||||
SetGroupObject:ForEachGroupPartlyInZone( Zone,
|
SetGroupObject:ForEachGroupPartlyInZone( Zone,
|
||||||
function( GroupObject )
|
function( GroupObject )
|
||||||
GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } )
|
GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } )
|
||||||
end )
|
end )
|
||||||
|
|
||||||
SetGroupObject:ForEachGroupNotInZone( Zone,
|
SetGroupObject:ForEachGroupNotInZone( Zone,
|
||||||
function( GroupObject )
|
function( GroupObject )
|
||||||
GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } )
|
GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } )
|
||||||
end )
|
end )
|
||||||
|
|
||||||
|
|||||||
+24
-24
@@ -1,24 +1,24 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-103 - Test if GROUP object is in ZONE
|
-- Name: ZON-103 - Test if GROUP object is in ZONE
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 31 Mar 2017
|
-- Date Created: 31 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE has been defined, and it is checked if a GROUP object is within the zone.
|
-- A ZONE has been defined, and it is checked if a GROUP object is within the zone.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone.
|
-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone.
|
||||||
-- 2. Observe the results of the functions.
|
-- 2. Observe the results of the functions.
|
||||||
|
|
||||||
|
|
||||||
GroupObject = GROUP:FindByName( "Group Object" )
|
GroupObject = GROUP:FindByName( "Group Object" )
|
||||||
|
|
||||||
Zone = ZONE:New( "Zone" )
|
Zone = ZONE:New( "Zone" )
|
||||||
|
|
||||||
|
|
||||||
Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } )
|
Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } )
|
||||||
Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } )
|
Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } )
|
||||||
Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } )
|
Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } )
|
||||||
|
|
||||||
|
|||||||
+17
-17
@@ -1,17 +1,17 @@
|
|||||||
---
|
---
|
||||||
-- Name: SET-103 - Test SET_GROUP players added and deleted
|
-- Name: SET-103 - Test SET_GROUP players added and deleted
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 31 Mar 2017
|
-- Date Created: 31 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Multiple groups of ground vehicles have been defined.
|
-- Multiple groups of ground vehicles have been defined.
|
||||||
-- There are collected in a SET_GROUP.
|
-- There are collected in a SET_GROUP.
|
||||||
-- A human player is jumping into the seat on one of these vehicles of the SET_GROUP.
|
-- A human player is jumping into the seat on one of these vehicles of the SET_GROUP.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the player added and deleted from the SET_GROUP depending on the behaviour.
|
-- 1. Observe the player added and deleted from the SET_GROUP depending on the behaviour.
|
||||||
|
|
||||||
|
|
||||||
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
|
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
SetClient = SET_CLIENT:New():FilterCoalitions("blue"):FilterCategories("plane"):FilterCountries("USA"):FilterStart()
|
SetClient = SET_CLIENT:New():FilterCoalitions("blue"):FilterCategories("plane"):FilterCountries("USA"):FilterStart()
|
||||||
|
|
||||||
|
|||||||
@@ -1,163 +1,163 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SetVehicles = SET_GROUP:New()
|
SetVehicles = SET_GROUP:New()
|
||||||
|
|
||||||
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
||||||
|
|
||||||
SetVehicles:ForEachGroup(
|
SetVehicles:ForEachGroup(
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeGreen()
|
UnitAction:SmokeGreen()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SetBluePlanesGroup = SET_GROUP:New()
|
SetBluePlanesGroup = SET_GROUP:New()
|
||||||
:FilterCoalitions( "blue" )
|
:FilterCoalitions( "blue" )
|
||||||
:FilterCategories( "plane" )
|
:FilterCategories( "plane" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
SetNorthKoreaGroup = SET_GROUP:New()
|
SetNorthKoreaGroup = SET_GROUP:New()
|
||||||
:FilterCountries( "RUSSIA" )
|
:FilterCountries( "RUSSIA" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
SetSAMGroup = SET_GROUP:New()
|
SetSAMGroup = SET_GROUP:New()
|
||||||
:FilterPrefixes( "SAM" )
|
:FilterPrefixes( "SAM" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
:SetIteratorIntervals( 5, 10 )
|
:SetIteratorIntervals( 5, 10 )
|
||||||
|
|
||||||
SetGroundGroup = SET_GROUP:New()
|
SetGroundGroup = SET_GROUP:New()
|
||||||
:FilterCategories( "ground" )
|
:FilterCategories( "ground" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
SetGroundGroup:Flush()
|
SetGroundGroup:Flush()
|
||||||
|
|
||||||
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
|
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
|
||||||
GroupUS_Plane = SpawnUS_Plane:Spawn()
|
GroupUS_Plane = SpawnUS_Plane:Spawn()
|
||||||
|
|
||||||
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
|
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
|
||||||
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
|
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
|
||||||
|
|
||||||
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
|
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
|
||||||
GroupUS_Ship = SpawnUS_Ship:Spawn()
|
GroupUS_Ship = SpawnUS_Ship:Spawn()
|
||||||
|
|
||||||
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
|
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
|
||||||
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
|
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
|
||||||
|
|
||||||
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
|
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
|
||||||
GroupRU_Ship = SpawnRU_Ship:Spawn()
|
GroupRU_Ship = SpawnRU_Ship:Spawn()
|
||||||
|
|
||||||
SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
|
SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
|
||||||
SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
|
SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
|
||||||
|
|
||||||
for i = 1, 30 do
|
for i = 1, 30 do
|
||||||
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||||
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||||
end
|
end
|
||||||
|
|
||||||
SetVehicleCompletely = SET_GROUP:New()
|
SetVehicleCompletely = SET_GROUP:New()
|
||||||
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
|
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
SetVehiclePartly = SET_GROUP:New()
|
SetVehiclePartly = SET_GROUP:New()
|
||||||
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
|
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
SetVehicleNot = SET_GROUP:New()
|
SetVehicleNot = SET_GROUP:New()
|
||||||
:FilterPrefixes( "Spawn Vehicle Zone Not" )
|
:FilterPrefixes( "Spawn Vehicle Zone Not" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4)
|
Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4)
|
||||||
Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 )
|
Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 )
|
||||||
Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
|
Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
|
||||||
for i = 1, 30 do
|
for i = 1, 30 do
|
||||||
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
|
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
|
||||||
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
|
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
|
||||||
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
|
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
|
||||||
end
|
end
|
||||||
|
|
||||||
--DBBlue:TraceDatabase()
|
--DBBlue:TraceDatabase()
|
||||||
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
|
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
|
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
|
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
|
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
|
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
|
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
|
||||||
--
|
--
|
||||||
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
|
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
||||||
|
|
||||||
SetBluePlanesGroup:ForEachGroup(
|
SetBluePlanesGroup:ForEachGroup(
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetNorthKoreaGroup:ForEachGroup(
|
SetNorthKoreaGroup:ForEachGroup(
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeRed()
|
UnitAction:SmokeRed()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetSAMGroup:ForEachGroup(
|
SetSAMGroup:ForEachGroup(
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeOrange()
|
UnitAction:SmokeOrange()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
|
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
|
||||||
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
|
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
|
||||||
GroupZoneNot = GROUP:FindByName( "Zone Not" )
|
GroupZoneNot = GROUP:FindByName( "Zone Not" )
|
||||||
|
|
||||||
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
|
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
|
||||||
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
|
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
|
||||||
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
|
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
|
||||||
|
|
||||||
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1,163 +1,163 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SetVehicles = SET_GROUP:New()
|
SetVehicles = SET_GROUP:New()
|
||||||
|
|
||||||
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
||||||
|
|
||||||
SetVehicles:ForEachGroup(
|
SetVehicles:ForEachGroup(
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeGreen()
|
UnitAction:SmokeGreen()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SetBluePlanesGroup = SET_GROUP:New()
|
SetBluePlanesGroup = SET_GROUP:New()
|
||||||
:FilterCoalitions( "blue" )
|
:FilterCoalitions( "blue" )
|
||||||
:FilterCategories( "plane" )
|
:FilterCategories( "plane" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
SetNorthKoreaGroup = SET_GROUP:New()
|
SetNorthKoreaGroup = SET_GROUP:New()
|
||||||
:FilterCountries( "RUSSIA" )
|
:FilterCountries( "RUSSIA" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
SetSAMGroup = SET_GROUP:New()
|
SetSAMGroup = SET_GROUP:New()
|
||||||
:FilterPrefixes( "SAM" )
|
:FilterPrefixes( "SAM" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
:SetIteratorIntervals( 5, 10 )
|
:SetIteratorIntervals( 5, 10 )
|
||||||
|
|
||||||
SetGroundGroup = SET_GROUP:New()
|
SetGroundGroup = SET_GROUP:New()
|
||||||
:FilterCategories( "ground" )
|
:FilterCategories( "ground" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
SetGroundGroup:Flush()
|
SetGroundGroup:Flush()
|
||||||
|
|
||||||
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
|
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
|
||||||
GroupUS_Plane = SpawnUS_Plane:Spawn()
|
GroupUS_Plane = SpawnUS_Plane:Spawn()
|
||||||
|
|
||||||
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
|
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
|
||||||
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
|
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
|
||||||
|
|
||||||
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
|
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
|
||||||
GroupUS_Ship = SpawnUS_Ship:Spawn()
|
GroupUS_Ship = SpawnUS_Ship:Spawn()
|
||||||
|
|
||||||
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
|
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
|
||||||
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
|
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
|
||||||
|
|
||||||
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
|
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
|
||||||
GroupRU_Ship = SpawnRU_Ship:Spawn()
|
GroupRU_Ship = SpawnRU_Ship:Spawn()
|
||||||
|
|
||||||
SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
|
SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
|
||||||
SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
|
SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
|
||||||
|
|
||||||
for i = 1, 30 do
|
for i = 1, 30 do
|
||||||
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||||
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||||
end
|
end
|
||||||
|
|
||||||
SetVehicleCompletely = SET_GROUP:New()
|
SetVehicleCompletely = SET_GROUP:New()
|
||||||
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
|
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
SetVehiclePartly = SET_GROUP:New()
|
SetVehiclePartly = SET_GROUP:New()
|
||||||
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
|
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
SetVehicleNot = SET_GROUP:New()
|
SetVehicleNot = SET_GROUP:New()
|
||||||
:FilterPrefixes( "Spawn Vehicle Zone Not" )
|
:FilterPrefixes( "Spawn Vehicle Zone Not" )
|
||||||
:FilterStart()
|
:FilterStart()
|
||||||
|
|
||||||
Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4)
|
Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4)
|
||||||
Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 )
|
Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 )
|
||||||
Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
|
Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
|
||||||
for i = 1, 30 do
|
for i = 1, 30 do
|
||||||
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
|
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
|
||||||
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
|
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
|
||||||
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
|
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
|
||||||
end
|
end
|
||||||
|
|
||||||
--DBBlue:TraceDatabase()
|
--DBBlue:TraceDatabase()
|
||||||
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
|
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
|
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
|
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
|
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
|
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
|
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
|
||||||
--
|
--
|
||||||
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
|
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
|
||||||
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
||||||
|
|
||||||
SetBluePlanesGroup:ForEachGroup(
|
SetBluePlanesGroup:ForEachGroup(
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetNorthKoreaGroup:ForEachGroup(
|
SetNorthKoreaGroup:ForEachGroup(
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeRed()
|
UnitAction:SmokeRed()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetSAMGroup:ForEachGroup(
|
SetSAMGroup:ForEachGroup(
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeOrange()
|
UnitAction:SmokeOrange()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
|
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
|
||||||
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
|
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
|
||||||
GroupZoneNot = GROUP:FindByName( "Zone Not" )
|
GroupZoneNot = GROUP:FindByName( "Zone Not" )
|
||||||
|
|
||||||
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
|
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
|
||||||
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
|
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
|
||||||
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
|
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
|
||||||
|
|
||||||
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
||||||
--- @param Wrapper.Group#GROUP MooseGroup
|
--- @param Wrapper.Group#GROUP MooseGroup
|
||||||
function( MooseGroup )
|
function( MooseGroup )
|
||||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||||
UnitAction:SmokeBlue()
|
UnitAction:SmokeBlue()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
+8
-8
@@ -1,8 +1,8 @@
|
|||||||
-- The mission contains templates, which are late activated groups. Only the active groups should be included.
|
-- The mission contains templates, which are late activated groups. Only the active groups should be included.
|
||||||
-- It should count 3 groups in DCS.log.
|
-- It should count 3 groups in DCS.log.
|
||||||
|
|
||||||
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
|
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
|
||||||
SetGroup:Flush()
|
SetGroup:Flush()
|
||||||
SetGroup:I( { Count = SetGroup:Count() } )
|
SetGroup:I( { Count = SetGroup:Count() } )
|
||||||
|
|
||||||
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()
|
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()
|
||||||
|
|||||||
+8
-8
@@ -1,8 +1,8 @@
|
|||||||
-- The mission contains templates, which are late activated groups. All groups should be included.
|
-- The mission contains templates, which are late activated groups. All groups should be included.
|
||||||
-- It should count 7 groups in DCS.log.
|
-- It should count 7 groups in DCS.log.
|
||||||
|
|
||||||
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||||
SetGroup:Flush()
|
SetGroup:Flush()
|
||||||
SetGroup:I( { Count = SetGroup:Count() } )
|
SetGroup:I( { Count = SetGroup:Count() } )
|
||||||
|
|
||||||
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()
|
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||||
|
|
||||||
SetUnit:Flush()
|
SetUnit:Flush()
|
||||||
|
|
||||||
SetUnit:I(SetUnit:Count())
|
SetUnit:I(SetUnit:Count())
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||||
SetUnit:Flush()
|
SetUnit:Flush()
|
||||||
SetUnit:I( { Count = SetUnit:Count() } )
|
SetUnit:I( { Count = SetUnit:Count() } )
|
||||||
|
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||||
SetUnit:Flush()
|
SetUnit:Flush()
|
||||||
SetUnit:I( { Count = SetUnit:Count() } )
|
SetUnit:I( { Count = SetUnit:Count() } )
|
||||||
end, {}, 60 )
|
end, {}, 60 )
|
||||||
|
|
||||||
|
|||||||
+15
-15
@@ -1,16 +1,16 @@
|
|||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||||
SetUnit:Flush()
|
SetUnit:Flush()
|
||||||
SetUnit:I( { Count = SetUnit:Count() } )
|
SetUnit:I( { Count = SetUnit:Count() } )
|
||||||
end, {}, 0, 30 )
|
end, {}, 0, 30 )
|
||||||
|
|
||||||
GroupPlanes = GROUP:FindByName( "Planes #001" )
|
GroupPlanes = GROUP:FindByName( "Planes #001" )
|
||||||
|
|
||||||
GroupPlanes:HandleEvent( EVENTS.EngineShutdown )
|
GroupPlanes:HandleEvent( EVENTS.EngineShutdown )
|
||||||
|
|
||||||
function GroupPlanes:OnEventEngineShutdown( EventData )
|
function GroupPlanes:OnEventEngineShutdown( EventData )
|
||||||
|
|
||||||
EventData.IniUnit:Destroy()
|
EventData.IniUnit:Destroy()
|
||||||
|
|
||||||
end
|
end
|
||||||
+8
-8
@@ -1,8 +1,8 @@
|
|||||||
-- The mission contains templates, which are late activated groups. Only the active units should be included.
|
-- The mission contains templates, which are late activated groups. Only the active units should be included.
|
||||||
-- It should count 24 units in DCS.log.
|
-- It should count 24 units in DCS.log.
|
||||||
|
|
||||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
|
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
|
||||||
SetUnit:Flush()
|
SetUnit:Flush()
|
||||||
SetUnit:I( { Count = SetUnit:Count() } )
|
SetUnit:I( { Count = SetUnit:Count() } )
|
||||||
|
|
||||||
MESSAGE:NewType( "There are " .. SetUnit:Count() .. " units in the SetUnit.", MESSAGE.Type.Information ):ToAll()
|
MESSAGE:NewType( "There are " .. SetUnit:Count() .. " units in the SetUnit.", MESSAGE.Type.Information ):ToAll()
|
||||||
|
|||||||
+22
-22
@@ -1,22 +1,22 @@
|
|||||||
-- Name: SPA-011 - Ground Ops - Simple Spawning
|
-- Name: SPA-011 - Ground Ops - Simple Spawning
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 10 Jan 2017
|
-- Date Created: 10 Jan 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn a ground vehicle.
|
-- At Gudauta spawn a ground vehicle.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicle is spawned.
|
-- 1. Observe that the ground vehicle is spawned.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Spawn a gound vehicle...
|
-- Spawn a gound vehicle...
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+26
-26
@@ -1,26 +1,26 @@
|
|||||||
-- Name: SPA-012 - Ground Ops - Multiple Spawns
|
-- Name: SPA-012 - Ground Ops - Multiple Spawns
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 10 Jan 2017
|
-- Date Created: 10 Jan 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles.
|
-- At Gudauta spawn multiple ground vehicles.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Spawn a gound vehicle...
|
-- Spawn a gound vehicle...
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||||
Spawn_Group_2 = Spawn_Vehicle_1:Spawn()
|
Spawn_Group_2 = Spawn_Vehicle_1:Spawn()
|
||||||
Spawn_Group_3 = Spawn_Vehicle_1:Spawn()
|
Spawn_Group_3 = Spawn_Vehicle_1:Spawn()
|
||||||
Spawn_Group_4 = Spawn_Vehicle_1:Spawn()
|
Spawn_Group_4 = Spawn_Vehicle_1:Spawn()
|
||||||
Spawn_Group_5 = Spawn_Vehicle_1:Spawn()
|
Spawn_Group_5 = Spawn_Vehicle_1:Spawn()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+22
-22
@@ -1,22 +1,22 @@
|
|||||||
-- Name: SPA-013 - Ground Ops - Scheduled Spawns
|
-- Name: SPA-013 - Ground Ops - Scheduled Spawns
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 10 Jan 2017
|
-- Date Created: 10 Jan 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+21
-21
@@ -1,21 +1,21 @@
|
|||||||
-- Name: SPA-014 - Ground Ops - Scheduled Spawns Limited
|
-- Name: SPA-014 - Ground Ops - Scheduled Spawns Limited
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 10 Jan 2017
|
-- Date Created: 10 Jan 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||||
-- 3. There should not be more than 5 groups spawned.
|
-- 3. There should not be more than 5 groups spawned.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 5, 0 ):SpawnScheduled( 5, .5 )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 5, 0 ):SpawnScheduled( 5, .5 )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+27
-27
@@ -1,27 +1,27 @@
|
|||||||
-- Name: SPA-015 - Ground Ops - Randomize Route
|
-- Name: SPA-015 - Ground Ops - Randomize Route
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 10 Jan 2017
|
-- Date Created: 10 Jan 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||||
-- 3. There should not be more than 5 groups spawned.
|
-- 3. There should not be more than 5 groups spawned.
|
||||||
-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3.
|
-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||||
:InitLimit( 10, 10 )
|
:InitLimit( 10, 10 )
|
||||||
:InitRandomizeRoute( 1, 1, 200 ) -- Randomize route starting from point 1 till point 3, with a radius of 200 meters around each point.
|
:InitRandomizeRoute( 1, 1, 200 ) -- Randomize route starting from point 1 till point 3, with a radius of 200 meters around each point.
|
||||||
:SpawnScheduled( 5, .5 )
|
:SpawnScheduled( 5, .5 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+29
-29
@@ -1,29 +1,29 @@
|
|||||||
-- Name: SPA-016 - Ground Ops - Randomize Zones
|
-- Name: SPA-016 - Ground Ops - Randomize Zones
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 10 Jan 2017
|
-- Date Created: 10 Jan 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||||
-- 3. There should not be more than 5 groups spawned.
|
-- 3. There should not be more than 5 groups spawned.
|
||||||
-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3.
|
-- 4. Observe that the route that the vehicles follow is randomized starting from point 1 till point 3.
|
||||||
-- 5. Observe that the position where the units are spawned, is randomized according the zones.
|
-- 5. Observe that the position where the units are spawned, is randomized according the zones.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Create a zone table of the 2 zones.
|
-- Create a zone table of the 2 zones.
|
||||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||||
|
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||||
:InitLimit( 10, 10 )
|
:InitLimit( 10, 10 )
|
||||||
:InitRandomizeRoute( 1, 1, 200 )
|
:InitRandomizeRoute( 1, 1, 200 )
|
||||||
:InitRandomizeZones( ZoneTable )
|
:InitRandomizeZones( ZoneTable )
|
||||||
:SpawnScheduled( 5, .5 )
|
:SpawnScheduled( 5, .5 )
|
||||||
|
|
||||||
|
|||||||
+31
-31
@@ -1,31 +1,31 @@
|
|||||||
-- Name: SPA-017 - Ground Ops - Set AI inactive while spawning
|
-- Name: SPA-017 - Ground Ops - Set AI inactive while spawning
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 24 Jan 2017
|
-- Date Created: 24 Jan 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
-- But set the AI inactive when spawning.
|
-- But set the AI inactive when spawning.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||||
-- 3. There should not be more than 5 groups spawned.
|
-- 3. There should not be more than 5 groups spawned.
|
||||||
-- 4. Observe that the AI is inactivated, and thus, the vehicles aren't moving.
|
-- 4. Observe that the AI is inactivated, and thus, the vehicles aren't moving.
|
||||||
-- 5. Observe that the position where the units are spawned, is randomized in the zones perimeters.
|
-- 5. Observe that the position where the units are spawned, is randomized in the zones perimeters.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Create a zone table of the 2 zones.
|
-- Create a zone table of the 2 zones.
|
||||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||||
|
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||||
:InitLimit( 10, 10 )
|
:InitLimit( 10, 10 )
|
||||||
:InitRandomizeRoute( 1, 1, 200 )
|
:InitRandomizeRoute( 1, 1, 200 )
|
||||||
:InitRandomizeZones( ZoneTable )
|
:InitRandomizeZones( ZoneTable )
|
||||||
:InitAIOnOff( false ) -- This will disable the AI. You can also use :InitAIOff(). Set AI On (for those groups with AI Off in the ME), with :InitAIOn().
|
:InitAIOnOff( false ) -- This will disable the AI. You can also use :InitAIOff(). Set AI On (for those groups with AI Off in the ME), with :InitAIOn().
|
||||||
:SpawnScheduled( 5, .5 )
|
:SpawnScheduled( 5, .5 )
|
||||||
|
|
||||||
|
|||||||
+28
-28
@@ -1,28 +1,28 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-018 - Ground Ops - Randomize Templates
|
-- Name: SPA-018 - Ground Ops - Randomize Templates
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 10 Jan 2017
|
-- Date Created: 10 Jan 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned with randomized templates.
|
-- 1. Observe that the ground vehicles are spawned with randomized templates.
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Create a zone table of the 2 zones.
|
-- Create a zone table of the 2 zones.
|
||||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||||
|
|
||||||
TemplateTable = { "A", "B", "C" }
|
TemplateTable = { "A", "B", "C" }
|
||||||
|
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||||
:InitLimit( 10, 10 )
|
:InitLimit( 10, 10 )
|
||||||
:InitRandomizeRoute( 1, 1, 200 )
|
:InitRandomizeRoute( 1, 1, 200 )
|
||||||
:InitRandomizeTemplate( TemplateTable )
|
:InitRandomizeTemplate( TemplateTable )
|
||||||
--:InitRandomizeZones( ZoneTable )
|
--:InitRandomizeZones( ZoneTable )
|
||||||
:SpawnScheduled( 5, .5 )
|
:SpawnScheduled( 5, .5 )
|
||||||
|
|
||||||
|
|||||||
+27
-27
@@ -1,27 +1,27 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-019 - Ground Ops - Randomize Templates with Waypoints
|
-- Name: SPA-019 - Ground Ops - Randomize Templates with Waypoints
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 24 Feb 2017
|
-- Date Created: 24 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned with randomized templates.
|
-- 1. Observe that the ground vehicles are spawned with randomized templates.
|
||||||
-- 2. Observe that the ground vehicles are spread around the spawning area and are not stacked upon each other.
|
-- 2. Observe that the ground vehicles are spread around the spawning area and are not stacked upon each other.
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Create a zone table of the 2 zones.
|
-- Create a zone table of the 2 zones.
|
||||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||||
|
|
||||||
TemplateTable = { "A", "B", "C" }
|
TemplateTable = { "A", "B", "C" }
|
||||||
|
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||||
:InitLimit( 10, 10 )
|
:InitLimit( 10, 10 )
|
||||||
:InitRandomizeTemplate( TemplateTable )
|
:InitRandomizeTemplate( TemplateTable )
|
||||||
:SpawnScheduled( 5, .5 )
|
:SpawnScheduled( 5, .5 )
|
||||||
|
|
||||||
|
|||||||
+29
-29
@@ -1,29 +1,29 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-020 - Ground Ops - Randomize Templates in Random Zones without Waypoints
|
-- Name: SPA-020 - Ground Ops - Randomize Templates in Random Zones without Waypoints
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 24 Feb 2017
|
-- Date Created: 24 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned with randomized templates.
|
-- 1. Observe that the ground vehicles are spawned with randomized templates.
|
||||||
-- 2. Observe that the ground vehicles are spread around the spawning area and are not stacked upon each other.
|
-- 2. Observe that the ground vehicles are spread around the spawning area and are not stacked upon each other.
|
||||||
-- 3. Observe that the ground vehicles are spread over the random zones, and that the initial templates formations are kept.
|
-- 3. Observe that the ground vehicles are spread over the random zones, and that the initial templates formations are kept.
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Create a zone table of the 2 zones.
|
-- Create a zone table of the 2 zones.
|
||||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||||
|
|
||||||
TemplateTable = { "A", "B", "C" }
|
TemplateTable = { "A", "B", "C" }
|
||||||
|
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||||
:InitLimit( 100, 10 )
|
:InitLimit( 100, 10 )
|
||||||
:InitRandomizeTemplate( TemplateTable )
|
:InitRandomizeTemplate( TemplateTable )
|
||||||
:InitRandomizeZones( ZoneTable )
|
:InitRandomizeZones( ZoneTable )
|
||||||
:SpawnScheduled( 5, .5 )
|
:SpawnScheduled( 5, .5 )
|
||||||
|
|
||||||
|
|||||||
+27
-27
@@ -1,27 +1,27 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names
|
-- Name: SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 14 Mar 2017
|
-- Date Created: 14 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||||
-- 3. There should not be more than 5 groups spawned.
|
-- 3. There should not be more than 5 groups spawned.
|
||||||
-- 4. Observe the unit names, they should have the name as defined within the ME.
|
-- 4. Observe the unit names, they should have the name as defined within the ME.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
Spawn_Vehicle_1 = SPAWN
|
Spawn_Vehicle_1 = SPAWN
|
||||||
:New( "Spawn Vehicle 1" )
|
:New( "Spawn Vehicle 1" )
|
||||||
:InitKeepUnitNames()
|
:InitKeepUnitNames()
|
||||||
:InitLimit( 5, 10 )
|
:InitLimit( 5, 10 )
|
||||||
:SpawnScheduled( 5, .5 )
|
:SpawnScheduled( 5, .5 )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+23
-23
@@ -1,23 +1,23 @@
|
|||||||
-- Name: SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval
|
-- Name: SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 18 Mar 2017
|
-- Date Created: 18 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
-- The vehicle should respawn when killed.
|
-- The vehicle should respawn when killed.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 1, 0 ):SpawnScheduled( 30, .5 )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 1, 0 ):SpawnScheduled( 30, .5 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+26
-26
@@ -1,26 +1,26 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-023 - Ground Ops - SpawnStart and SpawnStop
|
-- Name: SPA-023 - Ground Ops - SpawnStart and SpawnStop
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 10 Jan 2017
|
-- Date Created: 10 Jan 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||||
-- The schedule is immediately stopped and started.
|
-- The schedule is immediately stopped and started.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
-- 2. The vehicles should spawn according the scheduler parameters.
|
-- 2. The vehicles should spawn according the scheduler parameters.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ):SpawnScheduleStop()
|
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ):SpawnScheduleStop()
|
||||||
|
|
||||||
Spawn_Vehicle:SpawnScheduleStart()
|
Spawn_Vehicle:SpawnScheduleStart()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+27
-27
@@ -1,27 +1,27 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-024 - Ground Ops - Arrays
|
-- Name: SPA-024 - Ground Ops - Arrays
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 19 Jul 2017
|
-- Date Created: 19 Jul 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in an array.
|
-- At Gudauta spawn multiple ground vehicles, in an array.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
-- 2. The vehicles should spawn according the array parameters.
|
-- 2. The vehicles should spawn according the array parameters.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
Spawn_Vehicle = SPAWN
|
Spawn_Vehicle = SPAWN
|
||||||
:New( "Spawn Vehicles" )
|
:New( "Spawn Vehicles" )
|
||||||
:InitLimit( 12, 60 )
|
:InitLimit( 12, 60 )
|
||||||
:InitArray( 90, 10, 10, 10 )
|
:InitArray( 90, 10, 10, 10 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-024 - Ground Ops - Arrays
|
-- Name: SPA-024 - Ground Ops - Arrays
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 19 Jul 2017
|
-- Date Created: 19 Jul 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn multiple ground vehicles, in an array.
|
-- At Gudauta spawn multiple ground vehicles, in an array.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||||
-- 2. The vehicles should spawn according the array parameters.
|
-- 2. The vehicles should spawn according the array parameters.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
Spawn_Vehicle = SPAWN
|
Spawn_Vehicle = SPAWN
|
||||||
:New( "Spawn Vehicles" )
|
:New( "Spawn Vehicles" )
|
||||||
:InitLimit( 12, 60 )
|
:InitLimit( 12, 60 )
|
||||||
:InitArray( 90, 10, 10, 10 )
|
:InitArray( 90, 10, 10, 10 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+22
-22
@@ -1,22 +1,22 @@
|
|||||||
-- Name: SPA-025 - Ground Ops - Spawn Hidden
|
-- Name: SPA-025 - Ground Ops - Spawn Hidden
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 06 Sep 2017
|
-- Date Created: 06 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn a ground vehicle, hidden
|
-- At Gudauta spawn a ground vehicle, hidden
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the ground vehicle is spawned and his hidden.
|
-- 1. Observe that the ground vehicle is spawned and his hidden.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Spawn a gound vehicle...
|
-- Spawn a gound vehicle...
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+26
-26
@@ -1,26 +1,26 @@
|
|||||||
-- Name: SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden
|
-- Name: SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 06 Sep 2017
|
-- Date Created: 06 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn a ground vehicle, hidden, based on a randomized template.
|
-- At Gudauta spawn a ground vehicle, hidden, based on a randomized template.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that a random ground vehicle is spawned and his hidden.
|
-- 1. Observe that a random ground vehicle is spawned and his hidden.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Spawn a gound vehicle...
|
-- Spawn a gound vehicle...
|
||||||
|
|
||||||
Templates = { "A", "B" }
|
Templates = { "A", "B" }
|
||||||
|
|
||||||
Spawn_Vehicle_1 = SPAWN:New( "Vehicle" )
|
Spawn_Vehicle_1 = SPAWN:New( "Vehicle" )
|
||||||
Spawn_Vehicle_1:InitRandomizeTemplate( Templates )
|
Spawn_Vehicle_1:InitRandomizeTemplate( Templates )
|
||||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+25
-25
@@ -1,25 +1,25 @@
|
|||||||
-- Name: SPA-027 - Ground Ops - Respawning After Destroy
|
-- Name: SPA-027 - Ground Ops - Respawning After Destroy
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 10 Dec 2017
|
-- Date Created: 10 Dec 2017
|
||||||
--
|
--
|
||||||
-- At Gudauta spawns ground vehicle, in a scheduled fashion.
|
-- At Gudauta spawns ground vehicle, in a scheduled fashion.
|
||||||
-- There can only be a maximum of 2 grond vehicles alive.
|
-- There can only be a maximum of 2 grond vehicles alive.
|
||||||
-- When a ground vehicle is destroyed, a new one needs to be spawned at a different location in the zone.
|
-- When a ground vehicle is destroyed, a new one needs to be spawned at a different location in the zone.
|
||||||
-- Until that one is also destroyed.
|
-- Until that one is also destroyed.
|
||||||
--
|
--
|
||||||
-- Red is attacking the spawned blue vehicles.
|
-- Red is attacking the spawned blue vehicles.
|
||||||
-- Once blue is destroyed, a new blue needs to spawn.
|
-- Once blue is destroyed, a new blue needs to spawn.
|
||||||
-- Until all 10 blue vehicles are spawned.
|
-- Until all 10 blue vehicles are spawned.
|
||||||
-- The position of blue is randomized in the zone.
|
-- The position of blue is randomized in the zone.
|
||||||
-- Blue has ROE hold weapons.
|
-- Blue has ROE hold weapons.
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
BlueVehicleSpawn = SPAWN
|
BlueVehicleSpawn = SPAWN
|
||||||
:New( "Tank" )
|
:New( "Tank" )
|
||||||
:InitLimit( 2, 10 )
|
:InitLimit( 2, 10 )
|
||||||
:InitRandomizePosition( true, 200, 50 )
|
:InitRandomizePosition( true, 200, 50 )
|
||||||
:SpawnScheduled( 5, .5 )
|
:SpawnScheduled( 5, .5 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -1,8 +1,8 @@
|
|||||||
-- Tests Kutaisi
|
-- Tests Kutaisi
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Tests the CleanUp functionality.
|
-- Tests the CleanUp functionality.
|
||||||
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
|
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
|
||||||
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
|
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
|
||||||
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):InitLimit( 3, 100 ):InitRandomizeRoute( 1, 1, 1000 ):InitCleanUp( 60 ):SpawnScheduled( 10, 0 )
|
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):InitLimit( 3, 100 ):InitRandomizeRoute( 1, 1, 1000 ):InitCleanUp( 60 ):SpawnScheduled( 10, 0 )
|
||||||
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):InitLimit( 3, 100 ):InitRandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
|
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):InitLimit( 3, 100 ):InitRandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
---
|
---
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Limited scheduled spawning of groups...
|
-- Limited scheduled spawning of groups...
|
||||||
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 )
|
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 )
|
||||||
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 )
|
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 30, 0 )
|
||||||
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 90, 0 )
|
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 90, 0 )
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Tests Sukhumi
|
-- Tests Sukhumi
|
||||||
-- -------------
|
-- -------------
|
||||||
-- Limited scheduled spawning of groups with destruction...
|
-- Limited scheduled spawning of groups with destruction...
|
||||||
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )
|
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )
|
||||||
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )
|
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )
|
||||||
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )
|
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled Destroy" ):InitLimit( 4, 20 ):SpawnScheduled( 10, 0 )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+35
-35
@@ -1,35 +1,35 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-120 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
|
-- Name: SPA-120 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 05 Feb 2017
|
-- Date Created: 05 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- One airplane and one helicopter will be spawned.
|
-- One airplane and one helicopter will be spawned.
|
||||||
-- Only one airplane and one helicopter can be alive at the same time.
|
-- Only one airplane and one helicopter can be alive at the same time.
|
||||||
-- Upon landing, the airplane and helicopter will respawn at Kutaisi.
|
-- Upon landing, the airplane and helicopter will respawn at Kutaisi.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the spawning of the airplane and helicopter
|
-- 1. Observe the spawning of the airplane and helicopter
|
||||||
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
||||||
-- 3. Upon landing, the planes should respawn.
|
-- 3. Upon landing, the planes should respawn.
|
||||||
-- 5. The plane should respawn itself when the air unit has parked at the ramp or has landed.
|
-- 5. The plane should respawn itself when the air unit has parked at the ramp or has landed.
|
||||||
|
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|
||||||
-- Declare SPAWN objects
|
-- Declare SPAWN objects
|
||||||
Spawn_Plane = SPAWN:New("Plane"):InitLimit( 2, 0 )
|
Spawn_Plane = SPAWN:New("Plane"):InitLimit( 2, 0 )
|
||||||
|
|
||||||
-- Choose repeat functionality
|
-- Choose repeat functionality
|
||||||
|
|
||||||
-- Repeat on ... (when landed on the airport)
|
-- Repeat on ... (when landed on the airport)
|
||||||
Spawn_Plane:InitRepeatOnEngineShutDown()
|
Spawn_Plane:InitRepeatOnEngineShutDown()
|
||||||
|
|
||||||
-- Now SPAWN the GROUPs
|
-- Now SPAWN the GROUPs
|
||||||
Spawn_Plane:SpawnScheduled(30,0)
|
Spawn_Plane:SpawnScheduled(30,0)
|
||||||
|
|
||||||
-- Now run the mission and observe the behaviour.
|
-- Now run the mission and observe the behaviour.
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
+51
-51
@@ -1,51 +1,51 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
|
-- Name: SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 05 Feb 2017
|
-- Date Created: 05 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Multiple airplanes will be spawned at a scheduled interval.
|
-- Multiple airplanes will be spawned at a scheduled interval.
|
||||||
-- There is a limit on how many airplanes can be alive at the same time.
|
-- There is a limit on how many airplanes can be alive at the same time.
|
||||||
-- Upon landing, the airplanes will respawn at Kutaisi.
|
-- Upon landing, the airplanes will respawn at Kutaisi.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the spawning of the airplanes
|
-- 1. Observe the spawning of the airplanes
|
||||||
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
||||||
-- 3. Upon landing, the planes should respawn.
|
-- 3. Upon landing, the planes should respawn.
|
||||||
-- 4. The KA-50 and the C-101EB should respawn itself directly when landed.
|
-- 4. The KA-50 and the C-101EB should respawn itself directly when landed.
|
||||||
-- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp.
|
-- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp.
|
||||||
|
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|
||||||
-- Declare SPAWN objects
|
-- Declare SPAWN objects
|
||||||
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
|
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
|
||||||
Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 2, 10 )
|
Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 2, 10 )
|
||||||
Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 2, 10 )
|
Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 2, 10 )
|
||||||
Spawn_A_10C = SPAWN:New("A-10C")
|
Spawn_A_10C = SPAWN:New("A-10C")
|
||||||
:InitLimit( 2, 10 )
|
:InitLimit( 2, 10 )
|
||||||
|
|
||||||
-- Choose repeat functionality
|
-- Choose repeat functionality
|
||||||
|
|
||||||
-- Repeat on landing
|
-- Repeat on landing
|
||||||
Spawn_KA_50:InitRepeatOnLanding()
|
Spawn_KA_50:InitRepeatOnLanding()
|
||||||
Spawn_KA_50:InitDelayOff()
|
Spawn_KA_50:InitDelayOff()
|
||||||
|
|
||||||
Spawn_C_101EB:InitRepeatOnLanding()
|
Spawn_C_101EB:InitRepeatOnLanding()
|
||||||
Spawn_C_101EB:InitDelayOff()
|
Spawn_C_101EB:InitDelayOff()
|
||||||
|
|
||||||
-- Repeat on enging shutdown (when landed on the airport)
|
-- Repeat on enging shutdown (when landed on the airport)
|
||||||
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
|
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
|
||||||
Spawn_A_10C:InitRepeatOnEngineShutDown()
|
Spawn_A_10C:InitRepeatOnEngineShutDown()
|
||||||
|
|
||||||
-- Now SPAWN the GROUPs
|
-- Now SPAWN the GROUPs
|
||||||
Spawn_KA_50:SpawnScheduled(180,0)
|
Spawn_KA_50:SpawnScheduled(180,0)
|
||||||
Spawn_C_101EB:SpawnScheduled(180,0)
|
Spawn_C_101EB:SpawnScheduled(180,0)
|
||||||
Spawn_MI_8MTV2:SpawnScheduled(180,0)
|
Spawn_MI_8MTV2:SpawnScheduled(180,0)
|
||||||
Spawn_A_10C:SpawnScheduled(180,0)
|
Spawn_A_10C:SpawnScheduled(180,0)
|
||||||
|
|
||||||
-- Now run the mission and observe the behaviour.
|
-- Now run the mission and observe the behaviour.
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
+47
-47
@@ -1,47 +1,47 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-122 - Air Ops - OnLand test for Scheduled Spawns
|
-- Name: SPA-122 - Air Ops - OnLand test for Scheduled Spawns
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 21 Mar 2017
|
-- Date Created: 21 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- An airplane is spawned at a scheduled interval.
|
-- An airplane is spawned at a scheduled interval.
|
||||||
-- There is a limit on how many airplanes can be alive at the same time.
|
-- There is a limit on how many airplanes can be alive at the same time.
|
||||||
-- Upon landing, the airplane will respawn in the air.
|
-- Upon landing, the airplane will respawn in the air.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the spawning of the airplanes
|
-- 1. Observe the spawning of the airplanes
|
||||||
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
||||||
-- 3. Upon landing, the planes should respawn.
|
-- 3. Upon landing, the planes should respawn.
|
||||||
-- 4. The KA-50 and the C-101EB should respawn itself directly when landed.
|
-- 4. The KA-50 and the C-101EB should respawn itself directly when landed.
|
||||||
-- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp.
|
-- 5. the MI-8MTV2 and the A-10C should respawn itself when the air unit has parked at the ramp.
|
||||||
|
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|
||||||
-- Declare SPAWN objects
|
-- Declare SPAWN objects
|
||||||
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 1, 0 )
|
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 1, 0 )
|
||||||
Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 1, 0 )
|
Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 1, 0 )
|
||||||
Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 1, 0 )
|
Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 1, 0 )
|
||||||
Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 1, 0 )
|
Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 1, 0 )
|
||||||
|
|
||||||
-- Choose repeat functionality
|
-- Choose repeat functionality
|
||||||
|
|
||||||
-- Repeat on landing
|
-- Repeat on landing
|
||||||
Spawn_KA_50:InitRepeatOnLanding()
|
Spawn_KA_50:InitRepeatOnLanding()
|
||||||
Spawn_C_101EB:InitRepeatOnLanding()
|
Spawn_C_101EB:InitRepeatOnLanding()
|
||||||
|
|
||||||
-- Repeat on enging shutdown (when landed on the airport)
|
-- Repeat on enging shutdown (when landed on the airport)
|
||||||
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
|
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
|
||||||
Spawn_A_10C:InitRepeatOnEngineShutDown()
|
Spawn_A_10C:InitRepeatOnEngineShutDown()
|
||||||
|
|
||||||
-- Now SPAWN the GROUPs
|
-- Now SPAWN the GROUPs
|
||||||
Spawn_KA_50:SpawnScheduled(30,0)
|
Spawn_KA_50:SpawnScheduled(30,0)
|
||||||
Spawn_C_101EB:SpawnScheduled(30,0)
|
Spawn_C_101EB:SpawnScheduled(30,0)
|
||||||
Spawn_MI_8MTV2:SpawnScheduled(30,0)
|
Spawn_MI_8MTV2:SpawnScheduled(30,0)
|
||||||
Spawn_A_10C:SpawnScheduled(30,0)
|
Spawn_A_10C:SpawnScheduled(30,0)
|
||||||
|
|
||||||
-- Now run the mission and observe the behaviour.
|
-- Now run the mission and observe the behaviour.
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
+28
-28
@@ -1,28 +1,28 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-123 - Air Ops - Repeat on Landing and InitCleanUp
|
-- Name: SPA-123 - Air Ops - Repeat on Landing and InitCleanUp
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 15 Sep 2018
|
-- Date Created: 15 Sep 2018
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Helicpters spawn and are lightly shot until the crash land, but don't really destroy.
|
-- Helicpters spawn and are lightly shot until the crash land, but don't really destroy.
|
||||||
-- The should be respawned after a while.
|
-- The should be respawned after a while.
|
||||||
-- No performance overhead should be noticed.
|
-- No performance overhead should be noticed.
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|
||||||
-- Declare SPAWN objects
|
-- Declare SPAWN objects
|
||||||
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
|
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
|
||||||
:InitLimit( 2, 0 )
|
:InitLimit( 2, 0 )
|
||||||
|
|
||||||
-- Choose repeat functionality
|
-- Choose repeat functionality
|
||||||
|
|
||||||
-- Repeat on landing
|
-- Repeat on landing
|
||||||
Spawn_KA_50:InitRepeatOnLanding()
|
Spawn_KA_50:InitRepeatOnLanding()
|
||||||
Spawn_KA_50:InitDelayOff()
|
Spawn_KA_50:InitDelayOff()
|
||||||
Spawn_KA_50:InitCleanUp( 300 )
|
Spawn_KA_50:InitCleanUp( 300 )
|
||||||
Spawn_KA_50:SpawnScheduled( 180, 0.2 )
|
Spawn_KA_50:SpawnScheduled( 180, 0.2 )
|
||||||
|
|
||||||
-- Now run the mission and observe the behaviour.
|
-- Now run the mission and observe the behaviour.
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,47 +1,47 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-130 - Uncontrolled Spawning
|
-- Name: SPA-130 - Uncontrolled Spawning
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 04 Feb 2017
|
-- Date Created: 04 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A plane will be spawned Uncontrolled and later one will be spawned Controlled.
|
-- A plane will be spawned Uncontrolled and later one will be spawned Controlled.
|
||||||
-- Only the Controlled plane will move, the other will remain idle at the parking spot.
|
-- Only the Controlled plane will move, the other will remain idle at the parking spot.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the spawning of the UnControlled Plane.
|
-- 1. Observe the spawning of the UnControlled Plane.
|
||||||
-- 2. Observe the spawning of the Controlled Plane.
|
-- 2. Observe the spawning of the Controlled Plane.
|
||||||
|
|
||||||
|
|
||||||
-- Create the SPAWN object looking for the group (template) "Plane".
|
-- Create the SPAWN object looking for the group (template) "Plane".
|
||||||
SpawnPlane = SPAWN:New( "Plane" )
|
SpawnPlane = SPAWN:New( "Plane" )
|
||||||
|
|
||||||
-- Set the spawn mode to UnControlled.
|
-- Set the spawn mode to UnControlled.
|
||||||
SpawnPlane:InitUnControlled( true )
|
SpawnPlane:InitUnControlled( true )
|
||||||
|
|
||||||
-- Spawn the UnControlled Group
|
-- Spawn the UnControlled Group
|
||||||
UnControlledPlane = SpawnPlane:Spawn()
|
UnControlledPlane = SpawnPlane:Spawn()
|
||||||
|
|
||||||
-- Set the spawn mode back to Controlled.
|
-- Set the spawn mode back to Controlled.
|
||||||
SpawnPlane:InitUnControlled( false )
|
SpawnPlane:InitUnControlled( false )
|
||||||
|
|
||||||
ControlledPlane = SpawnPlane:Spawn()
|
ControlledPlane = SpawnPlane:Spawn()
|
||||||
|
|
||||||
-- Now, let's create a menu option at a player slot plane...
|
-- Now, let's create a menu option at a player slot plane...
|
||||||
-- We can only create the menu option if the player has joined the slot ...
|
-- We can only create the menu option if the player has joined the slot ...
|
||||||
PlayerPlane = CLIENT:FindByName( "PlayerPlane", "Select Menu item to activate UnControlled plane" )
|
PlayerPlane = CLIENT:FindByName( "PlayerPlane", "Select Menu item to activate UnControlled plane" )
|
||||||
|
|
||||||
PlayerPlane:Alive(
|
PlayerPlane:Alive(
|
||||||
function( Client, SpawnPlane )
|
function( Client, SpawnPlane )
|
||||||
|
|
||||||
--- @param Functional.Spawn#SPAWN SpawnPlane
|
--- @param Functional.Spawn#SPAWN SpawnPlane
|
||||||
local function ActivatePlane( SpawnPlane )
|
local function ActivatePlane( SpawnPlane )
|
||||||
SpawnPlane:InitUnControlled( false )
|
SpawnPlane:InitUnControlled( false )
|
||||||
SpawnPlane:ReSpawn( 1 )
|
SpawnPlane:ReSpawn( 1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
local Menu = MENU_CLIENT_COMMAND:New( Client, "Select to activate UnControlled plane", nil, ActivatePlane, SpawnPlane )
|
local Menu = MENU_CLIENT_COMMAND:New( Client, "Select to activate UnControlled plane", nil, ActivatePlane, SpawnPlane )
|
||||||
end
|
end
|
||||||
, SpawnPlane
|
, SpawnPlane
|
||||||
)
|
)
|
||||||
+11
-11
@@ -1,11 +1,11 @@
|
|||||||
-- Name: SPA-131 - Air Ops - SpawnAtAirbase
|
-- Name: SPA-131 - Air Ops - SpawnAtAirbase
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 14 Sep 2017
|
-- Date Created: 14 Sep 2017
|
||||||
--
|
--
|
||||||
Spawn_Plane = SPAWN:New( "Plane" )
|
Spawn_Plane = SPAWN:New( "Plane" )
|
||||||
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Cold )
|
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Cold )
|
||||||
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Hot )
|
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Hot )
|
||||||
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Runway )
|
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Runway )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
-- Tests Gudauta
|
-- Tests Gudauta
|
||||||
-- --------------
|
-- --------------
|
||||||
-- Limited and scheduled spawning of groups, with RandomizeTemplate ...
|
-- Limited and scheduled spawning of groups, with RandomizeTemplate ...
|
||||||
|
|
||||||
Templates = { "Template1", "Template2", "Template3", "Template4" }
|
Templates = { "Template1", "Template2", "Template3", "Template4" }
|
||||||
|
|
||||||
Spawn_Ground1 = SPAWN:New( "Spawn Vehicle1" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 )
|
Spawn_Ground1 = SPAWN:New( "Spawn Vehicle1" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 )
|
||||||
Spawn_Ground2 = SPAWN:New( "Spawn Vehicle2" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 )
|
Spawn_Ground2 = SPAWN:New( "Spawn Vehicle2" ):InitLimit( 4, 20 ):InitRandomizeTemplate(Templates):SpawnScheduled( 15, 0 )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,51 +1,51 @@
|
|||||||
-- This test will create 3 different zones of different types.
|
-- This test will create 3 different zones of different types.
|
||||||
-- 100 groups of 1 unit will be spawned.
|
-- 100 groups of 1 unit will be spawned.
|
||||||
-- The test is about testing the zone randomization, and the place where the units are created.
|
-- The test is about testing the zone randomization, and the place where the units are created.
|
||||||
|
|
||||||
local Iterations = 100
|
local Iterations = 100
|
||||||
local Iteration = 1
|
local Iteration = 1
|
||||||
|
|
||||||
-- The PolygonGroup route defines zone 1
|
-- The PolygonGroup route defines zone 1
|
||||||
local ZonePolygonGroup = GROUP:FindByName( "ZonePolygon" )
|
local ZonePolygonGroup = GROUP:FindByName( "ZonePolygon" )
|
||||||
|
|
||||||
-- The ZoneUnit defines zone 4.
|
-- The ZoneUnit defines zone 4.
|
||||||
local ZoneUnit = UNIT:FindByName( "ZoneUnit" )
|
local ZoneUnit = UNIT:FindByName( "ZoneUnit" )
|
||||||
|
|
||||||
-- The ZoneGroup defines zone 5
|
-- The ZoneGroup defines zone 5
|
||||||
local ZoneGroup = GROUP:FindByName( "ZoneGroup" )
|
local ZoneGroup = GROUP:FindByName( "ZoneGroup" )
|
||||||
|
|
||||||
-- This is the array that models the different zones types.
|
-- This is the array that models the different zones types.
|
||||||
-- The selection of the zones is done by taking into account the probability of the zone.
|
-- The selection of the zones is done by taking into account the probability of the zone.
|
||||||
-- The zone probabibility is 0 = 0%, 1 = 100%
|
-- The zone probabibility is 0 = 0%, 1 = 100%
|
||||||
-- The default value of the probability is 1.
|
-- The default value of the probability is 1.
|
||||||
-- Note that the SetZoneProbability is a method, that returns the self object of the zone,
|
-- Note that the SetZoneProbability is a method, that returns the self object of the zone,
|
||||||
-- allowing to use the method within the zone array declaration!
|
-- allowing to use the method within the zone array declaration!
|
||||||
local SpawnZones = {
|
local SpawnZones = {
|
||||||
ZONE_POLYGON:New( "Zone 1", ZonePolygonGroup ):SetZoneProbability( 0.8 ),
|
ZONE_POLYGON:New( "Zone 1", ZonePolygonGroup ):SetZoneProbability( 0.8 ),
|
||||||
ZONE_RADIUS:New( "Zone 2", ZONE:New( "GroundZone2" ):GetVec2(), 5000 ):SetZoneProbability( 0.2 ),
|
ZONE_RADIUS:New( "Zone 2", ZONE:New( "GroundZone2" ):GetVec2(), 5000 ):SetZoneProbability( 0.2 ),
|
||||||
ZONE:New( "GroundZone3" ):SetZoneProbability( 0.2 ),
|
ZONE:New( "GroundZone3" ):SetZoneProbability( 0.2 ),
|
||||||
ZONE_UNIT:New( "Zone 4", ZoneUnit, 5000 ):SetZoneProbability( 0.6 ),
|
ZONE_UNIT:New( "Zone 4", ZoneUnit, 5000 ):SetZoneProbability( 0.6 ),
|
||||||
ZONE_GROUP:New( "Zone 5", ZoneGroup, 5000 ):SetZoneProbability( 0.4 ),
|
ZONE_GROUP:New( "Zone 5", ZoneGroup, 5000 ):SetZoneProbability( 0.4 ),
|
||||||
}
|
}
|
||||||
|
|
||||||
HeightLimit = 500
|
HeightLimit = 500
|
||||||
|
|
||||||
SpawnGrounds = SPAWN
|
SpawnGrounds = SPAWN
|
||||||
:New("Ground")
|
:New("Ground")
|
||||||
:InitLimit( 100, 100 )
|
:InitLimit( 100, 100 )
|
||||||
-- This method will randomize the selection of the zones for each spawned Group during initialization,
|
-- This method will randomize the selection of the zones for each spawned Group during initialization,
|
||||||
-- taking into account the probability factors.
|
-- taking into account the probability factors.
|
||||||
-- When you explore the code behind this method, you'll see that the GetZoneMaybe() method is used to select "maybe" the zone.
|
-- When you explore the code behind this method, you'll see that the GetZoneMaybe() method is used to select "maybe" the zone.
|
||||||
:InitRandomizeZones( SpawnZones )
|
:InitRandomizeZones( SpawnZones )
|
||||||
|
|
||||||
--- Spawns these groups slowly.
|
--- Spawns these groups slowly.
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
|
|
||||||
function( Interation, Iterations )
|
function( Interation, Iterations )
|
||||||
do
|
do
|
||||||
-- Spawn Ground
|
-- Spawn Ground
|
||||||
SpawnGrounds:Spawn()
|
SpawnGrounds:Spawn()
|
||||||
end
|
end
|
||||||
|
|
||||||
end, {}, 0, 1, 0
|
end, {}, 0, 1, 0
|
||||||
)
|
)
|
||||||
|
|||||||
+52
-52
@@ -1,52 +1,52 @@
|
|||||||
|
|
||||||
local Iterations = 10
|
local Iterations = 10
|
||||||
local Iteration = 1
|
local Iteration = 1
|
||||||
|
|
||||||
GroundStatics = { "GroundStatic1", "GroundStatic2", "GroundStatic3" }
|
GroundStatics = { "GroundStatic1", "GroundStatic2", "GroundStatic3" }
|
||||||
AirplaneStatics = { "AirplaneStatic1", "AirplaneStatic2", "AirplaneStatic3" }
|
AirplaneStatics = { "AirplaneStatic1", "AirplaneStatic2", "AirplaneStatic3" }
|
||||||
HelicopterStatics = { "HelicopterStatic1", "HelicopterStatic2", "HelicopterStatic3" }
|
HelicopterStatics = { "HelicopterStatic1", "HelicopterStatic2", "HelicopterStatic3" }
|
||||||
ShipStatics = { "ShipStatic1", "ShipStatic2", "ShipStatic3" }
|
ShipStatics = { "ShipStatic1", "ShipStatic2", "ShipStatic3" }
|
||||||
|
|
||||||
HeightLimit = 500
|
HeightLimit = 500
|
||||||
|
|
||||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||||
|
|
||||||
--- Spawns these groups slowly.
|
--- Spawns these groups slowly.
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
|
|
||||||
function( Interation, Iterations )
|
function( Interation, Iterations )
|
||||||
do
|
do
|
||||||
-- Spawn Ground
|
-- Spawn Ground
|
||||||
local StaticName = GroundStatics[ math.random( 1, 3 ) ]
|
local StaticName = GroundStatics[ math.random( 1, 3 ) ]
|
||||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||||
SpawnGrounds:SpawnFromUnit( SpawnStatic )
|
SpawnGrounds:SpawnFromUnit( SpawnStatic )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Airplanes
|
-- Spawn Airplanes
|
||||||
local StaticName = AirplaneStatics[ math.random( 1, 3 ) ]
|
local StaticName = AirplaneStatics[ math.random( 1, 3 ) ]
|
||||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||||
SpawnAirplanes:SpawnFromUnit( SpawnStatic )
|
SpawnAirplanes:SpawnFromUnit( SpawnStatic )
|
||||||
SpawnAirplanes:SpawnFromUnit( SpawnStatic, 2000, 4000 )
|
SpawnAirplanes:SpawnFromUnit( SpawnStatic, 2000, 4000 )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Helicopters
|
-- Spawn Helicopters
|
||||||
local StaticName = HelicopterStatics[ math.random( 1, 3 ) ]
|
local StaticName = HelicopterStatics[ math.random( 1, 3 ) ]
|
||||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||||
SpawnHelicopters:SpawnFromUnit( SpawnStatic )
|
SpawnHelicopters:SpawnFromUnit( SpawnStatic )
|
||||||
SpawnHelicopters:SpawnFromUnit( SpawnStatic, 200, 500 ) -- Spawn between 200 and 500 meters.
|
SpawnHelicopters:SpawnFromUnit( SpawnStatic, 200, 500 ) -- Spawn between 200 and 500 meters.
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Ships
|
-- Spawn Ships
|
||||||
local StaticName = ShipStatics[ math.random( 1, 3 ) ]
|
local StaticName = ShipStatics[ math.random( 1, 3 ) ]
|
||||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||||
SpawnShips:SpawnFromUnit( SpawnStatic )
|
SpawnShips:SpawnFromUnit( SpawnStatic )
|
||||||
end
|
end
|
||||||
|
|
||||||
end, {}, 0, 15, 0.5
|
end, {}, 0, 15, 0.5
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
|
|
||||||
local Iterations = 10
|
local Iterations = 10
|
||||||
local Iteration = 1
|
local Iteration = 1
|
||||||
|
|
||||||
GroundUnits = { "GroundUnit1", "GroundUnit2", "GroundUnit3" }
|
GroundUnits = { "GroundUnit1", "GroundUnit2", "GroundUnit3" }
|
||||||
AirplaneUnits = { "AirplaneUnit1", "AirplaneUnit2", "AirplaneUnit3" }
|
AirplaneUnits = { "AirplaneUnit1", "AirplaneUnit2", "AirplaneUnit3" }
|
||||||
HelicopterUnits = { "HelicopterUnit1", "HelicopterUnit2", "HelicopterUnit3" }
|
HelicopterUnits = { "HelicopterUnit1", "HelicopterUnit2", "HelicopterUnit3" }
|
||||||
ShipUnits = { "ShipUnit1", "ShipUnit2", "ShipUnit3" }
|
ShipUnits = { "ShipUnit1", "ShipUnit2", "ShipUnit3" }
|
||||||
|
|
||||||
HeightLimit = 500
|
HeightLimit = 500
|
||||||
|
|
||||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 10, 3 )
|
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 10, 3 )
|
||||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
||||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
||||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
||||||
|
|
||||||
--- Spawns these groups slowly.
|
--- Spawns these groups slowly.
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
|
|
||||||
function( Interation, Iterations )
|
function( Interation, Iterations )
|
||||||
do
|
do
|
||||||
-- Spawn Ground
|
-- Spawn Ground
|
||||||
local UnitName = GroundUnits[ math.random( 1, 3 ) ]
|
local UnitName = GroundUnits[ math.random( 1, 3 ) ]
|
||||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||||
SpawnGrounds:SpawnFromUnit( SpawnUnit )
|
SpawnGrounds:SpawnFromUnit( SpawnUnit )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Airplanes
|
-- Spawn Airplanes
|
||||||
local UnitName = AirplaneUnits[ math.random( 1, 3 ) ]
|
local UnitName = AirplaneUnits[ math.random( 1, 3 ) ]
|
||||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||||
SpawnAirplanes:SpawnFromUnit( SpawnUnit )
|
SpawnAirplanes:SpawnFromUnit( SpawnUnit )
|
||||||
SpawnAirplanes:SpawnFromUnit( SpawnUnit, 200, 500 )
|
SpawnAirplanes:SpawnFromUnit( SpawnUnit, 200, 500 )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Helicopters
|
-- Spawn Helicopters
|
||||||
local UnitName = HelicopterUnits[ math.random( 1, 3 ) ]
|
local UnitName = HelicopterUnits[ math.random( 1, 3 ) ]
|
||||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||||
SpawnHelicopters:SpawnFromUnit( SpawnUnit )
|
SpawnHelicopters:SpawnFromUnit( SpawnUnit )
|
||||||
SpawnHelicopters:SpawnFromUnit( SpawnUnit, 500, 2000 )
|
SpawnHelicopters:SpawnFromUnit( SpawnUnit, 500, 2000 )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Ships
|
-- Spawn Ships
|
||||||
local UnitName = ShipUnits[ math.random( 1, 3 ) ]
|
local UnitName = ShipUnits[ math.random( 1, 3 ) ]
|
||||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||||
SpawnShips:SpawnFromUnit( SpawnUnit )
|
SpawnShips:SpawnFromUnit( SpawnUnit )
|
||||||
end
|
end
|
||||||
|
|
||||||
end, {}, 0, 15, 0.5
|
end, {}, 0, 15, 0.5
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,61 +1,61 @@
|
|||||||
|
|
||||||
local Iterations = 10
|
local Iterations = 10
|
||||||
local Iteration = 1
|
local Iteration = 1
|
||||||
|
|
||||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||||
|
|
||||||
HeightLimit = 500
|
HeightLimit = 500
|
||||||
|
|
||||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 )
|
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 )
|
||||||
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
||||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
||||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
||||||
|
|
||||||
--- Spawns these groups slowly.
|
--- Spawns these groups slowly.
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
|
|
||||||
function( Interation, Iterations )
|
function( Interation, Iterations )
|
||||||
do
|
do
|
||||||
-- Spawn Ground
|
-- Spawn Ground
|
||||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnGrounds:SpawnFromVec2( SpawnVec3:GetVec2() )
|
SpawnGrounds:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Ground Randomize
|
-- Spawn Ground Randomize
|
||||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnRandomizeGrounds:SpawnFromVec2( SpawnVec3:GetVec2() )
|
SpawnRandomizeGrounds:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Airplanes
|
-- Spawn Airplanes
|
||||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2() )
|
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||||
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2(), 200, 500 )
|
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2(), 200, 500 )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Helicopters
|
-- Spawn Helicopters
|
||||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2() )
|
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||||
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2(), 2000, 4000 )
|
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2(), 2000, 4000 )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Ships
|
-- Spawn Ships
|
||||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnShips:SpawnFromVec2( SpawnVec3:GetVec2() )
|
SpawnShips:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||||
end
|
end
|
||||||
|
|
||||||
end, {}, 0, 15, 0.5
|
end, {}, 0, 15, 0.5
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,59 +1,59 @@
|
|||||||
|
|
||||||
local Iterations = 10
|
local Iterations = 10
|
||||||
local Iteration = 1
|
local Iteration = 1
|
||||||
|
|
||||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||||
|
|
||||||
HeightLimit = 500
|
HeightLimit = 500
|
||||||
|
|
||||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 )
|
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 )
|
||||||
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
||||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
||||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
||||||
|
|
||||||
--- Spawns these groups slowly.
|
--- Spawns these groups slowly.
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
|
|
||||||
function( Interation, Iterations )
|
function( Interation, Iterations )
|
||||||
do
|
do
|
||||||
-- Spawn Ground
|
-- Spawn Ground
|
||||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Ground Randomize
|
-- Spawn Ground Randomize
|
||||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Airplanes
|
-- Spawn Airplanes
|
||||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Helicopters
|
-- Spawn Helicopters
|
||||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Ships
|
-- Spawn Ships
|
||||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
end, {}, 0, 15, 0.5
|
end, {}, 0, 15, 0.5
|
||||||
)
|
)
|
||||||
|
|||||||
+73
-73
@@ -1,73 +1,73 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition
|
-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 14 Mar 2017
|
-- Date Created: 14 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points.
|
-- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points.
|
||||||
-- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions.
|
-- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the random positioning of the groups. There should be no scattering of units.
|
-- 1. Observe the random positioning of the groups. There should be no scattering of units.
|
||||||
--
|
--
|
||||||
|
|
||||||
local Iterations = 10
|
local Iterations = 10
|
||||||
local Iteration = 1
|
local Iteration = 1
|
||||||
|
|
||||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||||
|
|
||||||
HeightLimit = 500
|
HeightLimit = 500
|
||||||
|
|
||||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||||
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||||
|
|
||||||
--- Spawns these groups slowly.
|
--- Spawns these groups slowly.
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
|
|
||||||
function( Interation, Iterations )
|
function( Interation, Iterations )
|
||||||
do
|
do
|
||||||
-- Spawn Ground
|
-- Spawn Ground
|
||||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Ground Randomize
|
-- Spawn Ground Randomize
|
||||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Airplanes
|
-- Spawn Airplanes
|
||||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Helicopters
|
-- Spawn Helicopters
|
||||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Ships
|
-- Spawn Ships
|
||||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
end, {}, 0, 15, 0.5
|
end, {}, 0, 15, 0.5
|
||||||
)
|
)
|
||||||
|
|||||||
+73
-73
@@ -1,73 +1,73 @@
|
|||||||
---
|
---
|
||||||
-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition
|
-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 14 Mar 2017
|
-- Date Created: 14 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points.
|
-- Ground troops, Airplanes, Helicopters and Ships are spawning from Vec3 points.
|
||||||
-- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions.
|
-- The API InitRandomizePosition is tested here, ensure that groups are replaced within a 900 to 1000 zone band at random positions.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the random positioning of the groups. There should be no scattering of units.
|
-- 1. Observe the random positioning of the groups. There should be no scattering of units.
|
||||||
--
|
--
|
||||||
|
|
||||||
local Iterations = 10
|
local Iterations = 10
|
||||||
local Iteration = 1
|
local Iteration = 1
|
||||||
|
|
||||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||||
|
|
||||||
HeightLimit = 500
|
HeightLimit = 500
|
||||||
|
|
||||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||||
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||||
|
|
||||||
--- Spawns these groups slowly.
|
--- Spawns these groups slowly.
|
||||||
SCHEDULER:New( nil,
|
SCHEDULER:New( nil,
|
||||||
|
|
||||||
function( Interation, Iterations )
|
function( Interation, Iterations )
|
||||||
do
|
do
|
||||||
-- Spawn Ground
|
-- Spawn Ground
|
||||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Ground Randomize
|
-- Spawn Ground Randomize
|
||||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Airplanes
|
-- Spawn Airplanes
|
||||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Helicopters
|
-- Spawn Helicopters
|
||||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
-- Spawn Ships
|
-- Spawn Ships
|
||||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||||
end
|
end
|
||||||
|
|
||||||
end, {}, 0, 15, 0.5
|
end, {}, 0, 15, 0.5
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
--- Name: SPS-100 - Simple Spawning
|
--- Name: SPS-100 - Simple Spawning
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 09 Apr 2017
|
-- Date Created: 09 Apr 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- At Gudauta spawn a static.
|
-- At Gudauta spawn a static.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe that the static is spawned.
|
-- 1. Observe that the static is spawned.
|
||||||
|
|
||||||
|
|
||||||
local ZonePosition = ZONE:New( "Position" )
|
local ZonePosition = ZONE:New( "Position" )
|
||||||
|
|
||||||
local SpawnBuilding = SPAWNSTATIC:NewFromStatic( "Building", country.id.GERMANY )
|
local SpawnBuilding = SPAWNSTATIC:NewFromStatic( "Building", country.id.GERMANY )
|
||||||
local SpawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY )
|
local SpawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY )
|
||||||
|
|
||||||
local ZonePointVec2 = ZonePosition:GetPointVec2()
|
local ZonePointVec2 = ZonePosition:GetPointVec2()
|
||||||
|
|
||||||
local Building = SpawnBuilding:SpawnFromZone( ZonePosition, 0 )
|
local Building = SpawnBuilding:SpawnFromZone( ZonePosition, 0 )
|
||||||
|
|
||||||
for Heading = 0, 360,60 do
|
for Heading = 0, 360,60 do
|
||||||
local Radial = Heading * ( math.pi*2 ) / 360
|
local Radial = Heading * ( math.pi*2 ) / 360
|
||||||
local x = ZonePointVec2:GetLat() + math.cos( Radial ) * 150
|
local x = ZonePointVec2:GetLat() + math.cos( Radial ) * 150
|
||||||
local y = ZonePointVec2:GetLon() + math.sin( Radial ) * 150
|
local y = ZonePointVec2:GetLon() + math.sin( Radial ) * 150
|
||||||
SpawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 )
|
SpawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,62 +1,62 @@
|
|||||||
---
|
---
|
||||||
-- FARPS
|
-- FARPS
|
||||||
-- This demo shows how to dynamically spawn FARPs into a mission.
|
-- This demo shows how to dynamically spawn FARPs into a mission.
|
||||||
--
|
--
|
||||||
-- We spawn two FARPS in a zone near Batumi.
|
-- We spawn two FARPS in a zone near Batumi.
|
||||||
-- The first FARP is names "FARP Berlin" and the second "FARP London".
|
-- The first FARP is names "FARP Berlin" and the second "FARP London".
|
||||||
-- We put coloured smoke on the spawned objects to mark them.
|
-- We put coloured smoke on the spawned objects to mark them.
|
||||||
--
|
--
|
||||||
-- The data is taken from "template" FARPS. Note that if the same
|
-- The data is taken from "template" FARPS. Note that if the same
|
||||||
-- name as the template is used, the original object is despawned
|
-- name as the template is used, the original object is despawned
|
||||||
-- automatically when the new object is spawned.
|
-- automatically when the new object is spawned.
|
||||||
--
|
--
|
||||||
-- As FARPS in DCS are strange creatures, which are hybrids of groups
|
-- As FARPS in DCS are strange creatures, which are hybrids of groups
|
||||||
-- and statics, the function :InitFARP is necessary.
|
-- and statics, the function :InitFARP is necessary.
|
||||||
---
|
---
|
||||||
|
|
||||||
-- Zone near Batumi on land.
|
-- Zone near Batumi on land.
|
||||||
local ZoneSpawn=ZONE:FindByName("Spawn Land")
|
local ZoneSpawn=ZONE:FindByName("Spawn Land")
|
||||||
|
|
||||||
|
|
||||||
-- Create a SPAWNSTATIC object from a template static FARP object.
|
-- Create a SPAWNSTATIC object from a template static FARP object.
|
||||||
local SpawnStaticFarp=SPAWNSTATIC:NewFromStatic("Static FARP Template-1", country.id.GERMANY)
|
local SpawnStaticFarp=SPAWNSTATIC:NewFromStatic("Static FARP Template-1", country.id.GERMANY)
|
||||||
|
|
||||||
|
|
||||||
-- Spawning FARPS is special in DCS. Therefore, we need to specify that this is a FARP. We also set the callsign and the frequency.
|
-- Spawning FARPS is special in DCS. Therefore, we need to specify that this is a FARP. We also set the callsign and the frequency.
|
||||||
SpawnStaticFarp:InitFARP(CALLSIGN.FARP.Berlin, 130.000, 0)
|
SpawnStaticFarp:InitFARP(CALLSIGN.FARP.Berlin, 130.000, 0)
|
||||||
|
|
||||||
-- Spawn FARP with heading 90°. It's name will be "Farp Berlin".
|
-- Spawn FARP with heading 90°. It's name will be "Farp Berlin".
|
||||||
local FarpBerlin=SpawnStaticFarp:SpawnFromZone(ZoneSpawn, 90, "FARP Berlin")
|
local FarpBerlin=SpawnStaticFarp:SpawnFromZone(ZoneSpawn, 90, "FARP Berlin")
|
||||||
|
|
||||||
-- Smoke static green.
|
-- Smoke static green.
|
||||||
FarpBerlin:GetCoordinate():SmokeGreen()
|
FarpBerlin:GetCoordinate():SmokeGreen()
|
||||||
|
|
||||||
|
|
||||||
-- The second FAPR gets callsign London and used radio frequency 131 MHz.
|
-- The second FAPR gets callsign London and used radio frequency 131 MHz.
|
||||||
SpawnStaticFarp:InitFARP(CALLSIGN.FARP.London, 131.000, 0)
|
SpawnStaticFarp:InitFARP(CALLSIGN.FARP.London, 131.000, 0)
|
||||||
|
|
||||||
-- We set the country to UK.
|
-- We set the country to UK.
|
||||||
SpawnStaticFarp:InitCountry(country.id.UK)
|
SpawnStaticFarp:InitCountry(country.id.UK)
|
||||||
|
|
||||||
-- Spawn the FARP at a random location inside the zone.
|
-- Spawn the FARP at a random location inside the zone.
|
||||||
local FarpLondon=SpawnStaticFarp:SpawnFromCoordinate(ZoneSpawn:GetRandomCoordinate(), nil, "Farp London")
|
local FarpLondon=SpawnStaticFarp:SpawnFromCoordinate(ZoneSpawn:GetRandomCoordinate(), nil, "Farp London")
|
||||||
|
|
||||||
-- Put red smoke at FARP London.
|
-- Put red smoke at FARP London.
|
||||||
FarpLondon:GetCoordinate():SmokeRed()
|
FarpLondon:GetCoordinate():SmokeRed()
|
||||||
|
|
||||||
|
|
||||||
-- Function to check if the STATIC/AIRBASE objects can be found.
|
-- Function to check if the STATIC/AIRBASE objects can be found.
|
||||||
local function check()
|
local function check()
|
||||||
|
|
||||||
-- Try to find static.
|
-- Try to find static.
|
||||||
local StaticBerlin=STATIC:FindByName("FARP Berlin")
|
local StaticBerlin=STATIC:FindByName("FARP Berlin")
|
||||||
|
|
||||||
-- Launch red flare.
|
-- Launch red flare.
|
||||||
StaticBerlin:GetCoordinate():FlareRed()
|
StaticBerlin:GetCoordinate():FlareRed()
|
||||||
|
|
||||||
-- Get the airbase object.
|
-- Get the airbase object.
|
||||||
local AirbaseBerlin=AIRBASE:FindByName("FARP Berlin")
|
local AirbaseBerlin=AIRBASE:FindByName("FARP Berlin")
|
||||||
AirbaseBerlin:MarkParkingSpots()
|
AirbaseBerlin:MarkParkingSpots()
|
||||||
|
|
||||||
end
|
end
|
||||||
TIMER:New(check):Start(1)
|
TIMER:New(check):Start(1)
|
||||||
@@ -1,32 +1,32 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-100 - Normal Zone
|
-- Name: ZON-100 - Normal Zone
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 21 Feb 2017
|
-- Date Created: 21 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE has been defined, which boundaries are smoking.
|
-- A ZONE has been defined, which boundaries are smoking.
|
||||||
-- A vehicle is driving through the zone perimeters.
|
-- A vehicle is driving through the zone perimeters.
|
||||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the zone perimeter smoke.
|
-- 1. Observe the zone perimeter smoke.
|
||||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||||
|
|
||||||
|
|
||||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||||
|
|
||||||
ZoneA = ZONE:New( "Zone A" )
|
ZoneA = ZONE:New( "Zone A" )
|
||||||
ZoneA:SmokeZone( SMOKECOLOR.White, 90 )
|
ZoneA:SmokeZone( SMOKECOLOR.White, 90 )
|
||||||
|
|
||||||
Messager = SCHEDULER:New( nil,
|
Messager = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||||
GroupInside:GetUnit(1):SmokeRed()
|
GroupInside:GetUnit(1):SmokeRed()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{}, 0, 1 )
|
{}, 0, 1 )
|
||||||
|
|
||||||
|
|||||||
+43
-43
@@ -1,43 +1,43 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-101 - Normal Zone - Random Point
|
-- Name: ZON-101 - Normal Zone - Random Point
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 18 Feb 2017
|
-- Date Created: 18 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Three zones are defined.
|
-- Three zones are defined.
|
||||||
-- 15 points are smoked in each zone.
|
-- 15 points are smoked in each zone.
|
||||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() API.
|
-- The second 15 points are orange smoked using the GetRandomPointVec2() API.
|
||||||
-- The third 15 points are red smoked using the GetRandomPointVec3() API.
|
-- The third 15 points are red smoked using the GetRandomPointVec3() API.
|
||||||
-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement.
|
-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement.
|
||||||
-- Note: At each zone an vehicle is placed, so you can view the smoking in external view.
|
-- Note: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||||
|
|
||||||
Zone1 = ZONE:New( "Zone 1" )
|
Zone1 = ZONE:New( "Zone 1" )
|
||||||
Zone2 = ZONE:New( "Zone 2" )
|
Zone2 = ZONE:New( "Zone 2" )
|
||||||
Zone3 = ZONE:New( "Zone 3" )
|
Zone3 = ZONE:New( "Zone 3" )
|
||||||
|
|
||||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
|
|
||||||
for i = 1, 15 do
|
for i = 1, 15 do
|
||||||
-- Zone 1
|
-- Zone 1
|
||||||
local Vec2 = Zone1:GetRandomVec2()
|
local Vec2 = Zone1:GetRandomVec2()
|
||||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||||
PointVec2:SmokeBlue()
|
PointVec2:SmokeBlue()
|
||||||
|
|
||||||
-- Zone 2
|
-- Zone 2
|
||||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||||
PointVec2:SmokeOrange()
|
PointVec2:SmokeOrange()
|
||||||
|
|
||||||
-- Zone 3
|
-- Zone 3
|
||||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||||
PointVec3:SmokeRed()
|
PointVec3:SmokeRed()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,32 +1,32 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-100 - Normal Zone
|
-- Name: ZON-100 - Normal Zone
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 21 Feb 2017
|
-- Date Created: 21 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE has been defined, which boundaries are smoking.
|
-- A ZONE has been defined, which boundaries are smoking.
|
||||||
-- A vehicle is driving through the zone perimeters.
|
-- A vehicle is driving through the zone perimeters.
|
||||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the zone perimeter smoke.
|
-- 1. Observe the zone perimeter smoke.
|
||||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||||
|
|
||||||
|
|
||||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||||
|
|
||||||
ZoneA = ZONE:New( "Zone A" )
|
ZoneA = ZONE:New( "Zone A" )
|
||||||
ZoneA:BoundZone( 90 )
|
ZoneA:BoundZone( 90 )
|
||||||
|
|
||||||
Messager = SCHEDULER:New( nil,
|
Messager = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||||
GroupInside:GetUnit(1):SmokeRed()
|
GroupInside:GetUnit(1):SmokeRed()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{}, 0, 1 )
|
{}, 0, 1 )
|
||||||
|
|
||||||
|
|||||||
+34
-34
@@ -1,34 +1,34 @@
|
|||||||
---
|
---
|
||||||
-- Name: SET-102 - Test SET_GROUP object against ZONE
|
-- Name: SET-102 - Test SET_GROUP object against ZONE
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 31 Mar 2017
|
-- Date Created: 31 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE has been defined, and the SET_GROUP object is checked against the zone.
|
-- A ZONE has been defined, and the SET_GROUP object is checked against the zone.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone.
|
-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone.
|
||||||
-- 2. Observe the results of the functions.
|
-- 2. Observe the results of the functions.
|
||||||
|
|
||||||
|
|
||||||
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
|
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
|
||||||
|
|
||||||
Zone = ZONE:New( "Zone" )
|
Zone = ZONE:New( "Zone" )
|
||||||
|
|
||||||
SetGroupObject:ForEachGroupCompletelyInZone( Zone,
|
SetGroupObject:ForEachGroupCompletelyInZone( Zone,
|
||||||
function( GroupObject )
|
function( GroupObject )
|
||||||
GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } )
|
GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } )
|
||||||
end )
|
end )
|
||||||
|
|
||||||
SetGroupObject:ForEachGroupPartlyInZone( Zone,
|
SetGroupObject:ForEachGroupPartlyInZone( Zone,
|
||||||
function( GroupObject )
|
function( GroupObject )
|
||||||
GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } )
|
GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } )
|
||||||
end )
|
end )
|
||||||
|
|
||||||
SetGroupObject:ForEachGroupNotInZone( Zone,
|
SetGroupObject:ForEachGroupNotInZone( Zone,
|
||||||
function( GroupObject )
|
function( GroupObject )
|
||||||
GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } )
|
GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } )
|
||||||
end )
|
end )
|
||||||
|
|
||||||
|
|||||||
+24
-24
@@ -1,24 +1,24 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-103 - Test if GROUP object is in ZONE
|
-- Name: ZON-103 - Test if GROUP object is in ZONE
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 31 Mar 2017
|
-- Date Created: 31 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE has been defined, and it is checked if a GROUP object is within the zone.
|
-- A ZONE has been defined, and it is checked if a GROUP object is within the zone.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone.
|
-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone.
|
||||||
-- 2. Observe the results of the functions.
|
-- 2. Observe the results of the functions.
|
||||||
|
|
||||||
|
|
||||||
GroupObject = GROUP:FindByName( "Group Object" )
|
GroupObject = GROUP:FindByName( "Group Object" )
|
||||||
|
|
||||||
Zone = ZONE:New( "Zone" )
|
Zone = ZONE:New( "Zone" )
|
||||||
|
|
||||||
|
|
||||||
Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } )
|
Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } )
|
||||||
Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } )
|
Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } )
|
||||||
Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } )
|
Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } )
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,34 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-110 - ZONE declared in ME
|
-- Name: ZON-110 - ZONE declared in ME
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 21 May 2018
|
-- Date Created: 21 May 2018
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE has been defined using the Mission Editor, which boundaries are smoking.
|
-- A ZONE has been defined using the Mission Editor, which boundaries are smoking.
|
||||||
-- A vehicle is driving through the zone perimeters.
|
-- A vehicle is driving through the zone perimeters.
|
||||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the zone perimeter smoke.
|
-- 1. Observe the zone perimeter smoke.
|
||||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||||
|
|
||||||
|
|
||||||
GroupInside = GROUP:FindByName( "Test Inside" )
|
GroupInside = GROUP:FindByName( "Test Inside" )
|
||||||
GroupOutside = GROUP:FindByName( "Test Outside" )
|
GroupOutside = GROUP:FindByName( "Test Outside" )
|
||||||
|
|
||||||
-- Now I can find the zone instead of doing ZONE:New, because the ZONE object is already in MOOSE.
|
-- Now I can find the zone instead of doing ZONE:New, because the ZONE object is already in MOOSE.
|
||||||
--ZoneA = ZONE:New( "Zone A" )
|
--ZoneA = ZONE:New( "Zone A" )
|
||||||
ZoneA = ZONE:FindByName( "Zone A" )
|
ZoneA = ZONE:FindByName( "Zone A" )
|
||||||
ZoneA:SmokeZone( SMOKECOLOR.White, 30 )
|
ZoneA:SmokeZone( SMOKECOLOR.White, 30 )
|
||||||
|
|
||||||
Messager = SCHEDULER:New( nil,
|
Messager = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||||
GroupInside:GetUnit(1):SmokeRed()
|
GroupInside:GetUnit(1):SmokeRed()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{}, 0, 1 )
|
{}, 0, 1 )
|
||||||
|
|
||||||
|
|||||||
+21
-21
@@ -1,22 +1,22 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-190 - Return SCENERY objects in Zone
|
-- Name: ZON-190 - Return SCENERY objects in Zone
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 08 Oct 2017
|
-- Date Created: 08 Oct 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|
||||||
Zone = ZONE:New( "Zone" )
|
Zone = ZONE:New( "Zone" )
|
||||||
|
|
||||||
|
|
||||||
Zone:Scan( Object.Category.SCENERY )
|
Zone:Scan( Object.Category.SCENERY )
|
||||||
|
|
||||||
for SceneryTypeName, SceneryData in pairs( Zone:GetScannedScenery() ) do
|
for SceneryTypeName, SceneryData in pairs( Zone:GetScannedScenery() ) do
|
||||||
for SceneryName, SceneryObject in pairs( SceneryData ) do
|
for SceneryName, SceneryObject in pairs( SceneryData ) do
|
||||||
local SceneryObject = SceneryObject -- Wrapper.Scenery#SCENERY
|
local SceneryObject = SceneryObject -- Wrapper.Scenery#SCENERY
|
||||||
MESSAGE:NewType( "Scenery: " .. SceneryObject:GetTypeName() .. ", Coord LL DMS: " .. SceneryObject:GetCoordinate():ToStringLLDMS(), MESSAGE.Type.Information ):ToAll()
|
MESSAGE:NewType( "Scenery: " .. SceneryObject:GetTypeName() .. ", Coord LL DMS: " .. SceneryObject:GetCoordinate():ToStringLLDMS(), MESSAGE.Type.Information ):ToAll()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1,36 +1,36 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-200 - Group Zone
|
-- Name: ZON-200 - Group Zone
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 21 Feb 2017
|
-- Date Created: 21 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE_GROUP has been defined, which boundaries are smoking.
|
-- A ZONE_GROUP has been defined, which boundaries are smoking.
|
||||||
-- A vehicle is driving through the zone perimeters.
|
-- A vehicle is driving through the zone perimeters.
|
||||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the zone perimeter smoke.
|
-- 1. Observe the zone perimeter smoke.
|
||||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||||
|
|
||||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||||
|
|
||||||
Tank = GROUP:FindByName( "Tank" )
|
Tank = GROUP:FindByName( "Tank" )
|
||||||
ZoneA = ZONE_GROUP:New( "Zone A", Tank, 100 )
|
ZoneA = ZONE_GROUP:New( "Zone A", Tank, 100 )
|
||||||
|
|
||||||
Messager = SCHEDULER:New( nil,
|
Messager = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||||
GroupInside:GetUnit(1):SmokeRed()
|
GroupInside:GetUnit(1):SmokeRed()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{}, 0, 1 )
|
{}, 0, 1 )
|
||||||
|
|
||||||
TankZoneColoring = SCHEDULER:New( nil,
|
TankZoneColoring = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
||||||
end,
|
end,
|
||||||
{}, 0, 5 )
|
{}, 0, 5 )
|
||||||
+43
-43
@@ -1,43 +1,43 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-201 - Group Zone - Random Point
|
-- Name: ZON-201 - Group Zone - Random Point
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 18 Feb 2017
|
-- Date Created: 18 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Three zones are defined.
|
-- Three zones are defined.
|
||||||
-- 15 points are smoked in each zone.
|
-- 15 points are smoked in each zone.
|
||||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() API.
|
-- The second 15 points are orange smoked using the GetRandomPointVec2() API.
|
||||||
-- The third 15 points are red smoked using the GetRandomPointVec3() API.
|
-- The third 15 points are red smoked using the GetRandomPointVec3() API.
|
||||||
-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement.
|
-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement.
|
||||||
-- Note: At each zone an vehicle is placed, so you can view the smoking in external view.
|
-- Note: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||||
|
|
||||||
Zone1 = ZONE_GROUP:New( "Zone 1", GROUP:FindByName( "Zone 1" ), 300 )
|
Zone1 = ZONE_GROUP:New( "Zone 1", GROUP:FindByName( "Zone 1" ), 300 )
|
||||||
Zone2 = ZONE_GROUP:New( "Zone 2", GROUP:FindByName( "Zone 2" ), 300 )
|
Zone2 = ZONE_GROUP:New( "Zone 2", GROUP:FindByName( "Zone 2" ), 300 )
|
||||||
Zone3 = ZONE_GROUP:New( "Zone 3", GROUP:FindByName( "Zone 3" ), 300 )
|
Zone3 = ZONE_GROUP:New( "Zone 3", GROUP:FindByName( "Zone 3" ), 300 )
|
||||||
|
|
||||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
|
|
||||||
for i = 1, 15 do
|
for i = 1, 15 do
|
||||||
-- Zone 1
|
-- Zone 1
|
||||||
local Vec2 = Zone1:GetRandomVec2()
|
local Vec2 = Zone1:GetRandomVec2()
|
||||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||||
PointVec2:SmokeBlue()
|
PointVec2:SmokeBlue()
|
||||||
|
|
||||||
-- Zone 2
|
-- Zone 2
|
||||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||||
PointVec2:SmokeOrange()
|
PointVec2:SmokeOrange()
|
||||||
|
|
||||||
-- Zone 3
|
-- Zone 3
|
||||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||||
PointVec3:SmokeRed()
|
PointVec3:SmokeRed()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,36 +1,36 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-300 - Unit Zone
|
-- Name: ZON-300 - Unit Zone
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 21 Feb 2017
|
-- Date Created: 21 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE_UNIT has been defined, which boundaries are smoking.
|
-- A ZONE_UNIT has been defined, which boundaries are smoking.
|
||||||
-- A vehicle is driving through the zone perimeters.
|
-- A vehicle is driving through the zone perimeters.
|
||||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the zone perimeter smoke.
|
-- 1. Observe the zone perimeter smoke.
|
||||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||||
|
|
||||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||||
|
|
||||||
Tank = UNIT:FindByName( "Tank" )
|
Tank = UNIT:FindByName( "Tank" )
|
||||||
ZoneA = ZONE_UNIT:New( "Zone A", Tank, 100 )
|
ZoneA = ZONE_UNIT:New( "Zone A", Tank, 100 )
|
||||||
|
|
||||||
Messager = SCHEDULER:New( nil,
|
Messager = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||||
GroupInside:GetUnit(1):SmokeRed()
|
GroupInside:GetUnit(1):SmokeRed()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{}, 0, 1 )
|
{}, 0, 1 )
|
||||||
|
|
||||||
TankZoneColoring = SCHEDULER:New( nil,
|
TankZoneColoring = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
||||||
end,
|
end,
|
||||||
{}, 0, 5 )
|
{}, 0, 5 )
|
||||||
+43
-43
@@ -1,43 +1,43 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-301 - Unit Zone - Random Point
|
-- Name: ZON-301 - Unit Zone - Random Point
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 18 Feb 2017
|
-- Date Created: 18 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Three zones are defined.
|
-- Three zones are defined.
|
||||||
-- 15 points are smoked in each zone.
|
-- 15 points are smoked in each zone.
|
||||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() API.
|
-- The second 15 points are orange smoked using the GetRandomPointVec2() API.
|
||||||
-- The third 15 points are red smoked using the GetRandomPointVec3() API.
|
-- The third 15 points are red smoked using the GetRandomPointVec3() API.
|
||||||
-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement.
|
-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement.
|
||||||
-- Note: At each zone an vehicle is placed, so you can view the smoking in external view.
|
-- Note: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||||
|
|
||||||
Zone1 = ZONE_UNIT:New( "Zone 1", UNIT:FindByName( "Zone 1" ), 300 )
|
Zone1 = ZONE_UNIT:New( "Zone 1", UNIT:FindByName( "Zone 1" ), 300 )
|
||||||
Zone2 = ZONE_UNIT:New( "Zone 2", UNIT:FindByName( "Zone 2" ), 300 )
|
Zone2 = ZONE_UNIT:New( "Zone 2", UNIT:FindByName( "Zone 2" ), 300 )
|
||||||
Zone3 = ZONE_UNIT:New( "Zone 3", UNIT:FindByName( "Zone 3" ), 300 )
|
Zone3 = ZONE_UNIT:New( "Zone 3", UNIT:FindByName( "Zone 3" ), 300 )
|
||||||
|
|
||||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
|
|
||||||
for i = 1, 15 do
|
for i = 1, 15 do
|
||||||
-- Zone 1
|
-- Zone 1
|
||||||
local Vec2 = Zone1:GetRandomVec2()
|
local Vec2 = Zone1:GetRandomVec2()
|
||||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||||
PointVec2:SmokeBlue()
|
PointVec2:SmokeBlue()
|
||||||
|
|
||||||
-- Zone 2
|
-- Zone 2
|
||||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||||
PointVec2:SmokeOrange()
|
PointVec2:SmokeOrange()
|
||||||
|
|
||||||
-- Zone 3
|
-- Zone 3
|
||||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||||
PointVec3:SmokeRed()
|
PointVec3:SmokeRed()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,32 +1,32 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-400 - Radius Zone
|
-- Name: ZON-400 - Radius Zone
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 21 Feb 2017
|
-- Date Created: 21 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE_RADIUS has been defined, which boundaries are smoking.
|
-- A ZONE_RADIUS has been defined, which boundaries are smoking.
|
||||||
-- A vehicle is driving through the zone perimeters.
|
-- A vehicle is driving through the zone perimeters.
|
||||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the polygon perimeter smoke.
|
-- 1. Observe the polygon perimeter smoke.
|
||||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||||
|
|
||||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||||
|
|
||||||
House = STATIC:FindByName( "House" )
|
House = STATIC:FindByName( "House" )
|
||||||
ZoneA = ZONE_RADIUS:New( "Zone A", House:GetVec2(), 300 )
|
ZoneA = ZONE_RADIUS:New( "Zone A", House:GetVec2(), 300 )
|
||||||
ZoneA:SmokeZone( SMOKECOLOR.White, 90 )
|
ZoneA:SmokeZone( SMOKECOLOR.White, 90 )
|
||||||
|
|
||||||
Messager = SCHEDULER:New( nil,
|
Messager = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||||
GroupInside:GetUnit(1):SmokeRed()
|
GroupInside:GetUnit(1):SmokeRed()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{}, 0, 1 )
|
{}, 0, 1 )
|
||||||
|
|
||||||
|
|||||||
+48
-48
@@ -1,48 +1,48 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-401 - Radius Zone - Random Point
|
-- Name: ZON-401 - Radius Zone - Random Point
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 18 Feb 2017
|
-- Date Created: 18 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Three zones are defined.
|
-- Three zones are defined.
|
||||||
-- 15 points are smoked in each zone.
|
-- 15 points are smoked in each zone.
|
||||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() API.
|
-- The second 15 points are orange smoked using the GetRandomPointVec2() API.
|
||||||
-- The third 15 points are red smoked using the GetRandomPointVec3() API.
|
-- The third 15 points are red smoked using the GetRandomPointVec3() API.
|
||||||
-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement.
|
-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement.
|
||||||
-- Note: At each zone an vehicle is placed, so you can view the smoking in external view.
|
-- Note: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||||
|
|
||||||
Unit1 = UNIT:FindByName( "Zone 1" )
|
Unit1 = UNIT:FindByName( "Zone 1" )
|
||||||
Unit2 = UNIT:FindByName( "Zone 2" )
|
Unit2 = UNIT:FindByName( "Zone 2" )
|
||||||
Unit3 = UNIT:FindByName( "Zone 3" )
|
Unit3 = UNIT:FindByName( "Zone 3" )
|
||||||
|
|
||||||
|
|
||||||
Zone1 = ZONE_RADIUS:New( "Zone 1", Unit1:GetVec2(), 300 )
|
Zone1 = ZONE_RADIUS:New( "Zone 1", Unit1:GetVec2(), 300 )
|
||||||
Zone2 = ZONE_RADIUS:New( "Zone 2", Unit2:GetVec2(), 300 )
|
Zone2 = ZONE_RADIUS:New( "Zone 2", Unit2:GetVec2(), 300 )
|
||||||
Zone3 = ZONE_RADIUS:New( "Zone 3", Unit3:GetVec2(), 300 )
|
Zone3 = ZONE_RADIUS:New( "Zone 3", Unit3:GetVec2(), 300 )
|
||||||
|
|
||||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||||
|
|
||||||
for i = 1, 15 do
|
for i = 1, 15 do
|
||||||
-- Zone 1
|
-- Zone 1
|
||||||
local Vec2 = Zone1:GetRandomVec2()
|
local Vec2 = Zone1:GetRandomVec2()
|
||||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||||
PointVec2:SmokeBlue()
|
PointVec2:SmokeBlue()
|
||||||
|
|
||||||
-- Zone 2
|
-- Zone 2
|
||||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||||
PointVec2:SmokeOrange()
|
PointVec2:SmokeOrange()
|
||||||
|
|
||||||
-- Zone 3
|
-- Zone 3
|
||||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||||
PointVec3:SmokeRed()
|
PointVec3:SmokeRed()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-500 - Polygon Zone
|
-- Name: ZON-500 - Polygon Zone
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 18 Feb 2017
|
-- Date Created: 18 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE_POLYGON has been defined, which boundaries are smoking.
|
-- A ZONE_POLYGON has been defined, which boundaries are smoking.
|
||||||
-- A vehicle is driving through the zone perimeters.
|
-- A vehicle is driving through the zone perimeters.
|
||||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the polygon perimeter smoke.
|
-- 1. Observe the polygon perimeter smoke.
|
||||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||||
|
|
||||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||||
|
|
||||||
GroupPolygon = GROUP:FindByName( "Polygon A" )
|
GroupPolygon = GROUP:FindByName( "Polygon A" )
|
||||||
|
|
||||||
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
||||||
PolygonZone:SmokeZone( SMOKECOLOR.White, 20 )
|
PolygonZone:SmokeZone( SMOKECOLOR.White, 20 )
|
||||||
|
|
||||||
Messager = SCHEDULER:New( nil,
|
Messager = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||||
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
||||||
GroupInside:GetUnit(1):SmokeRed()
|
GroupInside:GetUnit(1):SmokeRed()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{}, 0, 1 )
|
{}, 0, 1 )
|
||||||
|
|
||||||
|
|||||||
+43
-43
@@ -1,43 +1,43 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-501 - Polygon Zone - Random Point
|
-- Name: ZON-501 - Polygon Zone - Random Point
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 18 Feb 2017
|
-- Date Created: 18 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Three zones are defined.
|
-- Three zones are defined.
|
||||||
-- 15 points are smoked in each zone.
|
-- 15 points are smoked in each zone.
|
||||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() API.
|
-- The second 15 points are orange smoked using the GetRandomPointVec2() API.
|
||||||
-- The third 15 points are red smoked using the GetRandomPointVec3() API.
|
-- The third 15 points are red smoked using the GetRandomPointVec3() API.
|
||||||
-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement.
|
-- Note: The zones perimeters are also smoked in white, so you can observe the random point placement.
|
||||||
-- Note: At each zone an vehicle is placed, so you can view the smoking in external view.
|
-- Note: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||||
|
|
||||||
Zone1 = ZONE_POLYGON:New( "Zone 1", GROUP:FindByName( "Zone 1" ) )
|
Zone1 = ZONE_POLYGON:New( "Zone 1", GROUP:FindByName( "Zone 1" ) )
|
||||||
Zone2 = ZONE_POLYGON:New( "Zone 2", GROUP:FindByName( "Zone 2" ) )
|
Zone2 = ZONE_POLYGON:New( "Zone 2", GROUP:FindByName( "Zone 2" ) )
|
||||||
Zone3 = ZONE_POLYGON:New( "Zone 3", GROUP:FindByName( "Zone 3" ) )
|
Zone3 = ZONE_POLYGON:New( "Zone 3", GROUP:FindByName( "Zone 3" ) )
|
||||||
|
|
||||||
Zone1:SmokeZone( SMOKECOLOR.White, 4 )
|
Zone1:SmokeZone( SMOKECOLOR.White, 4 )
|
||||||
Zone2:SmokeZone( SMOKECOLOR.White, 4 )
|
Zone2:SmokeZone( SMOKECOLOR.White, 4 )
|
||||||
Zone3:SmokeZone( SMOKECOLOR.White, 4 )
|
Zone3:SmokeZone( SMOKECOLOR.White, 4 )
|
||||||
|
|
||||||
for i = 1, 15 do
|
for i = 1, 15 do
|
||||||
-- Zone 1
|
-- Zone 1
|
||||||
local Vec2 = Zone1:GetRandomVec2()
|
local Vec2 = Zone1:GetRandomVec2()
|
||||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||||
PointVec2:SmokeBlue()
|
PointVec2:SmokeBlue()
|
||||||
|
|
||||||
-- Zone 2
|
-- Zone 2
|
||||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||||
PointVec2:SmokeOrange()
|
PointVec2:SmokeOrange()
|
||||||
|
|
||||||
-- Zone 3
|
-- Zone 3
|
||||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||||
PointVec3:SmokeRed()
|
PointVec3:SmokeRed()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-502 - Polygon Zone Boundary
|
-- Name: ZON-502 - Polygon Zone Boundary
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 18 Feb 2017
|
-- Date Created: 18 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE_POLYGON has been defined, which boundaries are tires.
|
-- A ZONE_POLYGON has been defined, which boundaries are tires.
|
||||||
-- A vehicle is driving through the zone perimeters.
|
-- A vehicle is driving through the zone perimeters.
|
||||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the polygon perimeter smoke.
|
-- 1. Observe the polygon perimeter smoke.
|
||||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||||
|
|
||||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||||
|
|
||||||
GroupPolygon = GROUP:FindByName( "Polygon A" )
|
GroupPolygon = GROUP:FindByName( "Polygon A" )
|
||||||
|
|
||||||
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
||||||
PolygonZone:BoundZone()
|
PolygonZone:BoundZone()
|
||||||
|
|
||||||
Messager = SCHEDULER:New( nil,
|
Messager = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||||
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
||||||
GroupInside:GetUnit(1):SmokeRed()
|
GroupInside:GetUnit(1):SmokeRed()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{}, 0, 1 )
|
{}, 0, 1 )
|
||||||
|
|
||||||
|
|||||||
+32
-32
@@ -1,32 +1,32 @@
|
|||||||
---
|
---
|
||||||
-- Name: ZON-510 - ZONE_POLYGON declared in ME
|
-- Name: ZON-510 - ZONE_POLYGON declared in ME
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 21 May 2018
|
-- Date Created: 21 May 2018
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A ZONE_POLYGON has been defined, within the mission editor using ~ZONE_POLYGON in the group name.
|
-- A ZONE_POLYGON has been defined, within the mission editor using ~ZONE_POLYGON in the group name.
|
||||||
-- Its boundaries are smoking.
|
-- Its boundaries are smoking.
|
||||||
-- A vehicle is driving through the zone perimeters.
|
-- A vehicle is driving through the zone perimeters.
|
||||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the polygon perimeter smoke.
|
-- 1. Observe the polygon perimeter smoke.
|
||||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||||
|
|
||||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||||
|
|
||||||
PolygonZone = ZONE_POLYGON:FindByName( "Polygon A" )
|
PolygonZone = ZONE_POLYGON:FindByName( "Polygon A" )
|
||||||
PolygonZone:SmokeZone( SMOKECOLOR.White, 10 )
|
PolygonZone:SmokeZone( SMOKECOLOR.White, 10 )
|
||||||
|
|
||||||
Messager = SCHEDULER:New( nil,
|
Messager = SCHEDULER:New( nil,
|
||||||
function()
|
function()
|
||||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||||
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
||||||
GroupInside:GetUnit(1):SmokeRed()
|
GroupInside:GetUnit(1):SmokeRed()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{}, 0, 1 )
|
{}, 0, 1 )
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
-- Name: RAT-001 - Basic
|
-- Name: RAT-001 - Basic
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn several aircraft at random airports on the map.
|
-- Spawn several aircraft at random airports on the map.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe five Yak-40 aircraft being spawned at random airports of the map and fly to random destination airports.
|
-- 1. Observe five Yak-40 aircraft being spawned at random airports of the map and fly to random destination airports.
|
||||||
-- After the aircraft arrive at their destination they get despawned and then respawned at a new random airport with new random destination.
|
-- After the aircraft arrive at their destination they get despawned and then respawned at a new random airport with new random destination.
|
||||||
|
|
||||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||||
local yak=RAT:New("RAT_Yak")
|
local yak=RAT:New("RAT_Yak")
|
||||||
|
|
||||||
-- Spawn five aircraft.
|
-- Spawn five aircraft.
|
||||||
yak:Spawn(5)
|
yak:Spawn(5)
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
-- Name: RAT-002 - Fixed Departure
|
-- Name: RAT-002 - Fixed Departure
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn several aircraft of the same type at Gudauta and let them travel to random airports on the map.
|
-- Spawn several aircraft of the same type at Gudauta and let them travel to random airports on the map.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe five Yak-40 aircraft being spawned at Gudauta. Destination airport for each aircraft is random.
|
-- 1. Observe five Yak-40 aircraft being spawned at Gudauta. Destination airport for each aircraft is random.
|
||||||
-- After the aircraft arrive at their destination they get despawned and then respawned again at Gudauta. But the next destination is random again.
|
-- After the aircraft arrive at their destination they get despawned and then respawned again at Gudauta. But the next destination is random again.
|
||||||
|
|
||||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||||
local yak=RAT:New("RAT_Yak")
|
local yak=RAT:New("RAT_Yak")
|
||||||
|
|
||||||
-- Set destination airport.
|
-- Set destination airport.
|
||||||
yak:SetDeparture("Gudauta")
|
yak:SetDeparture("Gudauta")
|
||||||
|
|
||||||
-- Spawn five aircraft.
|
-- Spawn five aircraft.
|
||||||
yak:Spawn(5)
|
yak:Spawn(5)
|
||||||
|
|
||||||
|
|||||||
+22
-22
@@ -1,22 +1,22 @@
|
|||||||
-- Name: RAT-003 - Fixed Destination
|
-- Name: RAT-003 - Fixed Destination
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn several aircraft of the same type at random airports and let them all travel to Sochi-Adler.
|
-- Spawn several aircraft of the same type at random airports and let them all travel to Sochi-Adler.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe five Yak-40 aircraft being spawned at random airports. They will all fly to Sochi-Adler.
|
-- 1. Observe five Yak-40 aircraft being spawned at random airports. They will all fly to Sochi-Adler.
|
||||||
-- After the aircraft arrive at their destination they get despawned and then respawned at a random aiport with destination Sochi-Adler.
|
-- After the aircraft arrive at their destination they get despawned and then respawned at a random aiport with destination Sochi-Adler.
|
||||||
|
|
||||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||||
local yak=RAT:New("RAT_Yak")
|
local yak=RAT:New("RAT_Yak")
|
||||||
|
|
||||||
-- Set destination airport.
|
-- Set destination airport.
|
||||||
yak:SetDestination("Sochi-Adler")
|
yak:SetDestination("Sochi-Adler")
|
||||||
|
|
||||||
-- Spawn five aircraft.
|
-- Spawn five aircraft.
|
||||||
yak:Spawn(5)
|
yak:Spawn(5)
|
||||||
|
|
||||||
|
|||||||
+24
-24
@@ -1,25 +1,25 @@
|
|||||||
-- Name: RAT-004 - Fixed Departure and Destination
|
-- Name: RAT-004 - Fixed Departure and Destination
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn several aircraft of the same type at Guadauta or Batumi and make them fly to Gelendzhik or Beslan.
|
-- Spawn several aircraft of the same type at Guadauta or Batumi and make them fly to Gelendzhik or Beslan.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe five Yak-40 aircraft being spawned at Gudauta or Batumi. Their destination will be either Gelendzhik or Beslan.
|
-- 1. Observe five Yak-40 aircraft being spawned at Gudauta or Batumi. Their destination will be either Gelendzhik or Beslan.
|
||||||
-- After the aircraft arrive at their destination they get despawned and then respawned again at one of the defined departure airports.
|
-- After the aircraft arrive at their destination they get despawned and then respawned again at one of the defined departure airports.
|
||||||
-- Then they will travel to one of the defined destinations again.
|
-- Then they will travel to one of the defined destinations again.
|
||||||
|
|
||||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||||
local yak=RAT:New("RAT_Yak")
|
local yak=RAT:New("RAT_Yak")
|
||||||
|
|
||||||
-- Set destination airports. If multiple destinations are specified, they have to be given as a table, i.e. in curly brackets {}.
|
-- Set destination airports. If multiple destinations are specified, they have to be given as a table, i.e. in curly brackets {}.
|
||||||
yak:SetDeparture({"Gudauta", "Batumi"})
|
yak:SetDeparture({"Gudauta", "Batumi"})
|
||||||
|
|
||||||
-- Set destination airports. One of these is chosen randomly as destination.
|
-- Set destination airports. One of these is chosen randomly as destination.
|
||||||
yak:SetDestination({"Gelendzhik", "Beslan"})
|
yak:SetDestination({"Gelendzhik", "Beslan"})
|
||||||
|
|
||||||
-- Spawn five aircraft.
|
-- Spawn five aircraft.
|
||||||
yak:Spawn(5)
|
yak:Spawn(5)
|
||||||
+46
-46
@@ -1,47 +1,47 @@
|
|||||||
-- Name: RAT-005 - Restricted Coalition
|
-- Name: RAT-005 - Restricted Coalition
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn several aircraft of the same type at airports belonging to a certain coalition.
|
-- Spawn several aircraft of the same type at airports belonging to a certain coalition.
|
||||||
-- In the mission editor, we have set Sochi-Adler, Gelendzhik, Batumi, Senaki-Kolkhi and Kutaisi to red.
|
-- In the mission editor, we have set Sochi-Adler, Gelendzhik, Batumi, Senaki-Kolkhi and Kutaisi to red.
|
||||||
-- Likewise, Tbilisi-Lochini, Beslan, Nalchik, Mozdok and Mineralnye-Vody were set to blue.
|
-- Likewise, Tbilisi-Lochini, Beslan, Nalchik, Mozdok and Mineralnye-Vody were set to blue.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe three Yak-40 aircraft being spawned at red airports only. The will also only get destination airports belonging to that coalition.
|
-- 1. Observe three Yak-40 aircraft being spawned at red airports only. The will also only get destination airports belonging to that coalition.
|
||||||
-- 2. Observe three Yak-40 being spawned at blue airports only. The coalition of the aircraft is changed manually.
|
-- 2. Observe three Yak-40 being spawned at blue airports only. The coalition of the aircraft is changed manually.
|
||||||
|
|
||||||
-- Create RAT object. Additionally, to the template group name we give the group an alias to be able to distinguish to another group created from this template.
|
-- Create RAT object. Additionally, to the template group name we give the group an alias to be able to distinguish to another group created from this template.
|
||||||
local yak=RAT:New("RAT_Yak", "Yak Red")
|
local yak=RAT:New("RAT_Yak", "Yak Red")
|
||||||
|
|
||||||
-- This restricts the possible departure and destination airports the airports belonging to the red coalition.
|
-- This restricts the possible departure and destination airports the airports belonging to the red coalition.
|
||||||
-- Here it is important that in the mission editor enough (>2) airports have been set to red! Otherwise there will be no possible departure and/or destination airports.
|
-- Here it is important that in the mission editor enough (>2) airports have been set to red! Otherwise there will be no possible departure and/or destination airports.
|
||||||
yak:SetCoalition("sameonly")
|
yak:SetCoalition("sameonly")
|
||||||
|
|
||||||
-- Explicitly exclude Senaki from possible departures and destinations.
|
-- Explicitly exclude Senaki from possible departures and destinations.
|
||||||
yak:ExcludedAirports("Senaki-Kolkhi")
|
yak:ExcludedAirports("Senaki-Kolkhi")
|
||||||
|
|
||||||
-- Spawn three aircraft.
|
-- Spawn three aircraft.
|
||||||
yak:Spawn(3)
|
yak:Spawn(3)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object. Alias is "Yak Blue". If the same template is used multiple times, it is important to give each RAT object an indiviual name!
|
-- Create RAT object. Alias is "Yak Blue". If the same template is used multiple times, it is important to give each RAT object an indiviual name!
|
||||||
local yakblue=RAT:New("RAT_Yak", "Yak Blue")
|
local yakblue=RAT:New("RAT_Yak", "Yak Blue")
|
||||||
|
|
||||||
-- Change coalition of Yak to blue.
|
-- Change coalition of Yak to blue.
|
||||||
yakblue:SetCoalitionAircraft("blue")
|
yakblue:SetCoalitionAircraft("blue")
|
||||||
|
|
||||||
-- This restricts the possible departure and destination airports the airports belonging to the blue coalition since the coalition is changed manually.
|
-- This restricts the possible departure and destination airports the airports belonging to the blue coalition since the coalition is changed manually.
|
||||||
yakblue:SetCoalition("sameonly")
|
yakblue:SetCoalition("sameonly")
|
||||||
|
|
||||||
-- We also change the livery of these groups. If a table of liveries is given, each spawned group gets a random livery.
|
-- We also change the livery of these groups. If a table of liveries is given, each spawned group gets a random livery.
|
||||||
yakblue:Livery({"Georgian Airlines"})
|
yakblue:Livery({"Georgian Airlines"})
|
||||||
|
|
||||||
-- Explicitly exclude Nalchik from possible departures and destinations.
|
-- Explicitly exclude Nalchik from possible departures and destinations.
|
||||||
yakblue:ExcludedAirports({"Nalchik", "Mozdok"})
|
yakblue:ExcludedAirports({"Nalchik", "Mozdok"})
|
||||||
|
|
||||||
-- Spawn three aircraft.
|
-- Spawn three aircraft.
|
||||||
yakblue:Spawn(3)
|
yakblue:Spawn(3)
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
-- Name: RAT-006 - Continue Journey
|
-- Name: RAT-006 - Continue Journey
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn several aircraft of the same type at Gudauta. Each will get a random destination.
|
-- Spawn several aircraft of the same type at Gudauta. Each will get a random destination.
|
||||||
-- Once the aircraft arrives at its destination, it will be respawned there and continue its journey to another random airport.
|
-- Once the aircraft arrives at its destination, it will be respawned there and continue its journey to another random airport.
|
||||||
-- Note that we do NOT have to set a departure airport.
|
-- Note that we do NOT have to set a departure airport.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe five Yak-40 aircraft being spawned at Gudauta. From there they will hop from airport to airport on the map.
|
-- 1. Observe five Yak-40 aircraft being spawned at Gudauta. From there they will hop from airport to airport on the map.
|
||||||
|
|
||||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||||
local yak=RAT:New("RAT_Yak")
|
local yak=RAT:New("RAT_Yak")
|
||||||
|
|
||||||
-- Set Gudauta as departure airport for all spawned aircraft. (Not required for ContinueJourney() to work.)
|
-- Set Gudauta as departure airport for all spawned aircraft. (Not required for ContinueJourney() to work.)
|
||||||
yak:SetDeparture("Gudauta")
|
yak:SetDeparture("Gudauta")
|
||||||
|
|
||||||
-- This makes aircraft respawn at their destination airport instead of another random airport.
|
-- This makes aircraft respawn at their destination airport instead of another random airport.
|
||||||
yak:ContinueJourney()
|
yak:ContinueJourney()
|
||||||
|
|
||||||
-- Spawn five aircraft.
|
-- Spawn five aircraft.
|
||||||
yak:Spawn(5)
|
yak:Spawn(5)
|
||||||
@@ -1,31 +1,31 @@
|
|||||||
-- Name: RAT-007 - Commute
|
-- Name: RAT-007 - Commute
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn several aircraft of the same type at Mozdok and let them fly to Mineralnye Vody.
|
-- Spawn several aircraft of the same type at Mozdok and let them fly to Mineralnye Vody.
|
||||||
-- Once the aircraft arrives at its destination, it will be respawned there and fly back to Mozdok.
|
-- Once the aircraft arrives at its destination, it will be respawned there and fly back to Mozdok.
|
||||||
-- Note that:
|
-- Note that:
|
||||||
-- We do NOT have to set a departure or destination airports. If we don't, the first departure and destination are random.
|
-- We do NOT have to set a departure or destination airports. If we don't, the first departure and destination are random.
|
||||||
-- Commute() also works for random destination and departure airports. But once they are chosen, aircraft will only commute between those.
|
-- Commute() also works for random destination and departure airports. But once they are chosen, aircraft will only commute between those.
|
||||||
-- Also note that Commute() does NOT work with spawn in air since the departure airport is not defined then.
|
-- Also note that Commute() does NOT work with spawn in air since the departure airport is not defined then.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe two C-17A being spawned at Mozdok and fly back and forth between Mozdok and Mineralnye Vody until the end of time.
|
-- 1. Observe two C-17A being spawned at Mozdok and fly back and forth between Mozdok and Mineralnye Vody until the end of time.
|
||||||
|
|
||||||
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
-- Create RAT object. The only required parameter is the name of the template group in the mission editor.
|
||||||
local c17=RAT:New("RAT_C17")
|
local c17=RAT:New("RAT_C17")
|
||||||
|
|
||||||
-- Set Gudauta as departure airport.
|
-- Set Gudauta as departure airport.
|
||||||
c17:SetDeparture("Mozdok")
|
c17:SetDeparture("Mozdok")
|
||||||
|
|
||||||
-- Set Mineralnye Vody as destination.
|
-- Set Mineralnye Vody as destination.
|
||||||
c17:SetDestination("Mineralnye Vody")
|
c17:SetDestination("Mineralnye Vody")
|
||||||
|
|
||||||
-- This makes aircraft respawn at their destination airport and fly back to its departure. Hence, departure cannot be in air.
|
-- This makes aircraft respawn at their destination airport and fly back to its departure. Hence, departure cannot be in air.
|
||||||
c17:Commute()
|
c17:Commute()
|
||||||
|
|
||||||
-- Spawn two aircraft.
|
-- Spawn two aircraft.
|
||||||
c17:Spawn(2)
|
c17:Spawn(2)
|
||||||
@@ -1,53 +1,53 @@
|
|||||||
-- Name: RAT-008 - Spawn in Air
|
-- Name: RAT-008 - Spawn in Air
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn several aircraft above airports or at zones pre-defined in the mission editor.
|
-- Spawn several aircraft above airports or at zones pre-defined in the mission editor.
|
||||||
-- Note that if takeoff is set to air:
|
-- Note that if takeoff is set to air:
|
||||||
-- Airports are treated like zones with a certain radius.
|
-- Airports are treated like zones with a certain radius.
|
||||||
-- Spawn happens at a random point anywhere within the zone.
|
-- Spawn happens at a random point anywhere within the zone.
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Obsever ten Yak-40 being spawned in air near random airports of the map.
|
-- 1. Obsever ten Yak-40 being spawned in air near random airports of the map.
|
||||||
-- 2. Observe five C-17A being spawned within Zones "RAT Zone West", and "RAT Zone North".
|
-- 2. Observe five C-17A being spawned within Zones "RAT Zone West", and "RAT Zone North".
|
||||||
-- 3. Observe eight IL76 being spawned within RAT Zone North or somewhere near Anapa Vityazevo airport.
|
-- 3. Observe eight IL76 being spawned within RAT Zone North or somewhere near Anapa Vityazevo airport.
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from Yak-40 template.
|
-- Create RAT object from Yak-40 template.
|
||||||
local yak=RAT:New("RAT_YAK")
|
local yak=RAT:New("RAT_YAK")
|
||||||
|
|
||||||
-- Set takeoff type to air.
|
-- Set takeoff type to air.
|
||||||
yak:SetTakeoff("air")
|
yak:SetTakeoff("air")
|
||||||
|
|
||||||
-- Spawn ten Yak-40s.
|
-- Spawn ten Yak-40s.
|
||||||
yak:Spawn(10)
|
yak:Spawn(10)
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from C-17A template.
|
-- Create RAT object from C-17A template.
|
||||||
local c17=RAT:New("RAT_C17")
|
local c17=RAT:New("RAT_C17")
|
||||||
|
|
||||||
-- Set takeoff type to air.
|
-- Set takeoff type to air.
|
||||||
c17:SetTakeoff("air")
|
c17:SetTakeoff("air")
|
||||||
|
|
||||||
-- Set departure zones for C-17.
|
-- Set departure zones for C-17.
|
||||||
c17:SetDeparture({"RAT Zone West", "RAT Zone South"})
|
c17:SetDeparture({"RAT Zone West", "RAT Zone South"})
|
||||||
|
|
||||||
-- Spawn five C-17s.
|
-- Spawn five C-17s.
|
||||||
c17:Spawn(5)
|
c17:Spawn(5)
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from IL76 template.
|
-- Create RAT object from IL76 template.
|
||||||
local il76=RAT:New("RAT_IL76")
|
local il76=RAT:New("RAT_IL76")
|
||||||
|
|
||||||
-- Set takeoff type to air.
|
-- Set takeoff type to air.
|
||||||
il76:SetTakeoff("air")
|
il76:SetTakeoff("air")
|
||||||
|
|
||||||
-- Set departure zones for C-17. You can mix zone names and airport names.
|
-- Set departure zones for C-17. You can mix zone names and airport names.
|
||||||
il76:SetDeparture({"RAT Zone North", "Anapa-Vityazevo"})
|
il76:SetDeparture({"RAT Zone North", "Anapa-Vityazevo"})
|
||||||
|
|
||||||
-- Spawn eight C-17s.
|
-- Spawn eight C-17s.
|
||||||
il76:Spawn(8)
|
il76:Spawn(8)
|
||||||
+46
-46
@@ -1,46 +1,46 @@
|
|||||||
-- Name: RAT-009 - Set Cruise Altitude
|
-- Name: RAT-009 - Set Cruise Altitude
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn several aircraft randomly but make them fly at certain cruise altitudes.
|
-- Spawn several aircraft randomly but make them fly at certain cruise altitudes.
|
||||||
-- In the first example we specify the flight level, i.e. the altitude above sea level in hundreds of meters.
|
-- In the first example we specify the flight level, i.e. the altitude above sea level in hundreds of meters.
|
||||||
-- There are also methods to set the cruise altitude in meters. These are used in the second example.
|
-- There are also methods to set the cruise altitude in meters. These are used in the second example.
|
||||||
--
|
--
|
||||||
-- Note that when setting a lower bound for the cruise altitude, this automatically adjusts the minimum distance to possible destinations, since the aircraft must have enough time to climb to that alt and descent again to the destination.
|
-- Note that when setting a lower bound for the cruise altitude, this automatically adjusts the minimum distance to possible destinations, since the aircraft must have enough time to climb to that alt and descent again to the destination.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet.
|
-- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet.
|
||||||
-- Most aircraft will travel at or near 10,000 ft.
|
-- Most aircraft will travel at or near 10,000 ft.
|
||||||
-- 2. Observe two C-17 being spawned at Tbilisi-Lochini. They will travel to a random destination but the cruise alt is set to be > 5 km.
|
-- 2. Observe two C-17 being spawned at Tbilisi-Lochini. They will travel to a random destination but the cruise alt is set to be > 5 km.
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from Yak-40 template.
|
-- Create RAT object from Yak-40 template.
|
||||||
local yak=RAT:New("RAT_YAK")
|
local yak=RAT:New("RAT_YAK")
|
||||||
|
|
||||||
-- Set the minimum flight level. No aircaft will travel below this altitude.
|
-- Set the minimum flight level. No aircaft will travel below this altitude.
|
||||||
yak:SetFLmin(50)
|
yak:SetFLmin(50)
|
||||||
|
|
||||||
-- Set maximum flight level to 20,000 ft ASL. No aircraft will be assigned a cruise flight level above this altitude.
|
-- Set maximum flight level to 20,000 ft ASL. No aircraft will be assigned a cruise flight level above this altitude.
|
||||||
yak:SetFLmax(200)
|
yak:SetFLmax(200)
|
||||||
|
|
||||||
-- Set cruise flight level to 10,000 ft. The final choise is random between FLmin and FLmax, but morst aircraft will travel at his or near this altitude.
|
-- Set cruise flight level to 10,000 ft. The final choise is random between FLmin and FLmax, but morst aircraft will travel at his or near this altitude.
|
||||||
yak:SetFLcruise(100)
|
yak:SetFLcruise(100)
|
||||||
|
|
||||||
-- Spawn five Yak-40s.
|
-- Spawn five Yak-40s.
|
||||||
yak:Spawn(5)
|
yak:Spawn(5)
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from C-17A template.
|
-- Create RAT object from C-17A template.
|
||||||
local c17=RAT:New("RAT_C17")
|
local c17=RAT:New("RAT_C17")
|
||||||
|
|
||||||
-- Set departure zones for C-17.
|
-- Set departure zones for C-17.
|
||||||
c17:SetDeparture("Tbilisi-Lochini")
|
c17:SetDeparture("Tbilisi-Lochini")
|
||||||
|
|
||||||
-- All aircraft will fly at least at a height of 5 km ASL.
|
-- All aircraft will fly at least at a height of 5 km ASL.
|
||||||
c17:SetMinCruiseAltitude(5000)
|
c17:SetMinCruiseAltitude(5000)
|
||||||
|
|
||||||
-- Spawn two C-17s.
|
-- Spawn two C-17s.
|
||||||
c17:Spawn(2)
|
c17:Spawn(2)
|
||||||
|
|||||||
+66
-66
@@ -1,67 +1,67 @@
|
|||||||
-- Name: RAT-010 - Helo FARP and Ship
|
-- Name: RAT-010 - Helo FARP and Ship
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 23 Sep 2017
|
-- Date Created: 23 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn helos at FARPS or ships.
|
-- Spawn helos at FARPS or ships.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet.
|
-- 1. Obsever five Yak-40 being spawned at random airports. They will travel to a random destination but the cruising altitude will not be below 5,000 feet and not be above 20,000 feet.
|
||||||
|
|
||||||
-- Create RAT object from Huey template.
|
-- Create RAT object from Huey template.
|
||||||
local huey1=RAT:New("RAT_HUEY", "Huey Berlin")
|
local huey1=RAT:New("RAT_HUEY", "Huey Berlin")
|
||||||
|
|
||||||
-- Huey departing from FARP Berlin.
|
-- Huey departing from FARP Berlin.
|
||||||
huey1:SetDeparture({"FARP Berlin"})
|
huey1:SetDeparture({"FARP Berlin"})
|
||||||
|
|
||||||
-- Flying to Normandy.
|
-- Flying to Normandy.
|
||||||
huey1:SetDestination({"Normandy"})
|
huey1:SetDestination({"Normandy"})
|
||||||
|
|
||||||
-- Take-off with engines on.
|
-- Take-off with engines on.
|
||||||
huey1:SetTakeoff("hot")
|
huey1:SetTakeoff("hot")
|
||||||
|
|
||||||
-- Huey will respawn at Normandy and fly back to FARP Berlin.
|
-- Huey will respawn at Normandy and fly back to FARP Berlin.
|
||||||
huey1:Commute()
|
huey1:Commute()
|
||||||
|
|
||||||
-- Huey will be spawned.
|
-- Huey will be spawned.
|
||||||
huey1:Spawn()
|
huey1:Spawn()
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from Huey template.
|
-- Create RAT object from Huey template.
|
||||||
local huey2=RAT:New("RAT_HUEY", "Huey London")
|
local huey2=RAT:New("RAT_HUEY", "Huey London")
|
||||||
|
|
||||||
-- Huey departing from FARP London.
|
-- Huey departing from FARP London.
|
||||||
huey2:SetDeparture({"FARP London"})
|
huey2:SetDeparture({"FARP London"})
|
||||||
|
|
||||||
-- Flying to Normandy.
|
-- Flying to Normandy.
|
||||||
huey2:SetDestination({"Normandy"})
|
huey2:SetDestination({"Normandy"})
|
||||||
|
|
||||||
-- Take-off with engines on.
|
-- Take-off with engines on.
|
||||||
huey2:SetTakeoff("hot")
|
huey2:SetTakeoff("hot")
|
||||||
|
|
||||||
-- Huey will respawn at Normandy and fly back to FARP London.
|
-- Huey will respawn at Normandy and fly back to FARP London.
|
||||||
huey2:Commute()
|
huey2:Commute()
|
||||||
|
|
||||||
-- Huey will be spawned.
|
-- Huey will be spawned.
|
||||||
huey2:Spawn()
|
huey2:Spawn()
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from Huey template.
|
-- Create RAT object from Huey template.
|
||||||
local huey3=RAT:New("RAT_HUEY", "Huey Anapa")
|
local huey3=RAT:New("RAT_HUEY", "Huey Anapa")
|
||||||
|
|
||||||
-- Huey departing from FARP London.
|
-- Huey departing from FARP London.
|
||||||
huey3:SetDeparture({"FARP London", "FARP Berlin", "Anapa-Vityazevo"})
|
huey3:SetDeparture({"FARP London", "FARP Berlin", "Anapa-Vityazevo"})
|
||||||
|
|
||||||
-- Flying to Normandy.
|
-- Flying to Normandy.
|
||||||
huey3:SetDestination({"FARP London", "FARP Berlin", "Anapa-Vityazevo"})
|
huey3:SetDestination({"FARP London", "FARP Berlin", "Anapa-Vityazevo"})
|
||||||
|
|
||||||
-- Take-off with engines on.
|
-- Take-off with engines on.
|
||||||
huey3:SetTakeoff("hot")
|
huey3:SetTakeoff("hot")
|
||||||
|
|
||||||
-- Huey will continue its journey.
|
-- Huey will continue its journey.
|
||||||
huey3:ContinueJourney()
|
huey3:ContinueJourney()
|
||||||
|
|
||||||
-- Huey will be spawned.
|
-- Huey will be spawned.
|
||||||
huey3:Spawn()
|
huey3:Spawn()
|
||||||
@@ -1,43 +1,43 @@
|
|||||||
-- Name: RAT-011 - Carrier Ops
|
-- Name: RAT-011 - Carrier Ops
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- Spawn aircraft flying to and from aircraft carriers
|
-- Spawn aircraft flying to and from aircraft carriers
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe two SU-33 taking of from Novorossiysk and fly to the Kuznetsov.
|
-- 1. Observe two SU-33 taking of from Novorossiysk and fly to the Kuznetsov.
|
||||||
-- 2. Observe two F-14A taking of from the Carl Vinson flying into Batumi.
|
-- 2. Observe two F-14A taking of from the Carl Vinson flying into Batumi.
|
||||||
|
|
||||||
-- Create RAT object from Su-33 template.
|
-- Create RAT object from Su-33 template.
|
||||||
local su33=RAT:New("RAT_SU33")
|
local su33=RAT:New("RAT_SU33")
|
||||||
|
|
||||||
-- Huey departing from FARP Berlin.
|
-- Huey departing from FARP Berlin.
|
||||||
su33:SetDeparture({"Novorossiysk"})
|
su33:SetDeparture({"Novorossiysk"})
|
||||||
|
|
||||||
-- Flying to Normandy.
|
-- Flying to Normandy.
|
||||||
su33:SetDestination({"Kuznetsov"})
|
su33:SetDestination({"Kuznetsov"})
|
||||||
|
|
||||||
-- Take-off with engines on.
|
-- Take-off with engines on.
|
||||||
su33:SetTakeoff("hot")
|
su33:SetTakeoff("hot")
|
||||||
|
|
||||||
-- Spawn two aircraft.
|
-- Spawn two aircraft.
|
||||||
su33:Spawn(2)
|
su33:Spawn(2)
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from Su-33 template.
|
-- Create RAT object from Su-33 template.
|
||||||
local f14=RAT:New("RAT_F14")
|
local f14=RAT:New("RAT_F14")
|
||||||
|
|
||||||
-- Huey departing from FARP Berlin.
|
-- Huey departing from FARP Berlin.
|
||||||
f14:SetDeparture({"Carl Vinson"})
|
f14:SetDeparture({"Carl Vinson"})
|
||||||
|
|
||||||
-- Flying to Normandy.
|
-- Flying to Normandy.
|
||||||
f14:SetDestination({"Batumi"})
|
f14:SetDestination({"Batumi"})
|
||||||
|
|
||||||
-- Take-off with engines on.
|
-- Take-off with engines on.
|
||||||
f14:SetTakeoff("hot")
|
f14:SetTakeoff("hot")
|
||||||
|
|
||||||
-- Spawn two aircraft.
|
-- Spawn two aircraft.
|
||||||
f14:Spawn(2)
|
f14:Spawn(2)
|
||||||
+76
-76
@@ -1,76 +1,76 @@
|
|||||||
---
|
---
|
||||||
-- Name: RAT-010 - Traffic at McCarran International
|
-- Name: RAT-010 - Traffic at McCarran International
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
-- Updated: 10 Oct 2023
|
-- Updated: 10 Oct 2023
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- We want to generate some random air traffic at McCarran International Airport.
|
-- We want to generate some random air traffic at McCarran International Airport.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. KC-135 aircraft are spawned at zones north and east heading to McCarran.
|
-- 1. KC-135 aircraft are spawned at zones north and east heading to McCarran.
|
||||||
-- 2. E-3A aircraft are spawned at McCarran with random destinations.
|
-- 2. E-3A aircraft are spawned at McCarran with random destinations.
|
||||||
-- 3. Yak-40 aircraft are spawned at random airports heading for McCarran.
|
-- 3. Yak-40 aircraft are spawned at random airports heading for McCarran.
|
||||||
-- 3. TF-51D aircraft are spawned at Henderson, Boulder City or Echo Bay heading for McCarran.
|
-- 3. TF-51D aircraft are spawned at Henderson, Boulder City or Echo Bay heading for McCarran.
|
||||||
|
|
||||||
-- Create RAT object from KC-135 template.
|
-- Create RAT object from KC-135 template.
|
||||||
local kc135=RAT:New("RAT_KC135")
|
local kc135=RAT:New("RAT_KC135")
|
||||||
|
|
||||||
kc135:SetCoalition("same")
|
kc135:SetCoalition("same")
|
||||||
|
|
||||||
-- Set departure zones. We need takeoff "air" for that.
|
-- Set departure zones. We need takeoff "air" for that.
|
||||||
kc135:SetDeparture({"RAT Zone North", "RAT Zone East"})
|
kc135:SetDeparture({"RAT Zone North", "RAT Zone East"})
|
||||||
|
|
||||||
-- Set spawn in air.
|
-- Set spawn in air.
|
||||||
kc135:SetTakeoff("air")
|
kc135:SetTakeoff("air")
|
||||||
|
|
||||||
-- Aircraft will fly to McCarran
|
-- Aircraft will fly to McCarran
|
||||||
kc135:SetDestination(AIRBASE.Nevada.McCarran_International_Airport)
|
kc135:SetDestination(AIRBASE.Nevada.McCarran_International_Airport)
|
||||||
|
|
||||||
-- Spawn two aircraft.
|
-- Spawn two aircraft.
|
||||||
kc135:Spawn(2)
|
kc135:Spawn(2)
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from E-3A template.
|
-- Create RAT object from E-3A template.
|
||||||
local e3=RAT:New("RAT_E3")
|
local e3=RAT:New("RAT_E3")
|
||||||
|
|
||||||
e3:SetCoalition("same")
|
e3:SetCoalition("same")
|
||||||
|
|
||||||
-- Aircraft are spawned at McCarran. Destinations are random.
|
-- Aircraft are spawned at McCarran. Destinations are random.
|
||||||
e3:SetDeparture(AIRBASE.Nevada.McCarran_International_Airport)
|
e3:SetDeparture(AIRBASE.Nevada.McCarran_International_Airport)
|
||||||
|
|
||||||
-- Enable respawn after landing with a delay of six minutes.
|
-- Enable respawn after landing with a delay of six minutes.
|
||||||
e3:RespawnAfterLanding(360)
|
e3:RespawnAfterLanding(360)
|
||||||
|
|
||||||
-- Spawn two aircraft.
|
-- Spawn two aircraft.
|
||||||
e3:Spawn(2)
|
e3:Spawn(2)
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from Yak-40 template.
|
-- Create RAT object from Yak-40 template.
|
||||||
local yak=RAT:New("RAT_YAK")
|
local yak=RAT:New("RAT_YAK")
|
||||||
|
|
||||||
-- These are the airports a Yak-40 gets a parking slot.
|
-- These are the airports a Yak-40 gets a parking slot.
|
||||||
yak:SetDeparture({AIRBASE.Nevada.Tonopah_Airport, AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Henderson_Executive_Airport, AIRBASE.Nevada.Nellis_AFB, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Laughlin_Airport})
|
yak:SetDeparture({AIRBASE.Nevada.Tonopah_Airport, AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Henderson_Executive_Airport, AIRBASE.Nevada.Nellis_AFB, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Laughlin_Airport})
|
||||||
|
|
||||||
-- Destination McCarran.
|
-- Destination McCarran.
|
||||||
yak:SetDestination(AIRBASE.Nevada.McCarran_International_Airport)
|
yak:SetDestination(AIRBASE.Nevada.McCarran_International_Airport)
|
||||||
|
|
||||||
-- Spawn eight Yak-40.
|
-- Spawn eight Yak-40.
|
||||||
yak:Spawn(8)
|
yak:Spawn(8)
|
||||||
|
|
||||||
|
|
||||||
-- Create RAT object from E-3A template.
|
-- Create RAT object from E-3A template.
|
||||||
local tf51=RAT:New("RAT_TF51")
|
local tf51=RAT:New("RAT_TF51")
|
||||||
|
|
||||||
tf51:SetCoalition("same")
|
tf51:SetCoalition("same")
|
||||||
|
|
||||||
-- Departure airport will be chosen from this list.
|
-- Departure airport will be chosen from this list.
|
||||||
tf51:SetDeparture({AIRBASE.Nevada.Henderson_Executive_Airport, AIRBASE.Nevada.Boulder_City_Airport, AIRBASE.Nevada.Echo_Bay})
|
tf51:SetDeparture({AIRBASE.Nevada.Henderson_Executive_Airport, AIRBASE.Nevada.Boulder_City_Airport, AIRBASE.Nevada.Echo_Bay})
|
||||||
|
|
||||||
-- All will fly to McCarran.
|
-- All will fly to McCarran.
|
||||||
tf51:SetDestination(AIRBASE.Nevada.McCarran_International_Airport)
|
tf51:SetDestination(AIRBASE.Nevada.McCarran_International_Airport)
|
||||||
|
|
||||||
-- Spawn four TF-51D
|
-- Spawn four TF-51D
|
||||||
tf51:Spawn(4)
|
tf51:Spawn(4)
|
||||||
|
|||||||
+100
-100
@@ -1,101 +1,101 @@
|
|||||||
---
|
---
|
||||||
-- Name: RAT-011 - Traffic at Nellis AFB
|
-- Name: RAT-011 - Traffic at Nellis AFB
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
-- Updated: 10 Oct 2023
|
-- Updated: 10 Oct 2023
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- We want to generate some random air traffic at Nellis AFB.
|
-- We want to generate some random air traffic at Nellis AFB.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. F-15C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech.
|
-- 1. F-15C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech.
|
||||||
-- 2. A-10C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech.
|
-- 2. A-10C are spawned at Nellis with desitation Tonopah, Groom Lake or Creech.
|
||||||
-- 3. F/A-18C are spawned at Tonopah, Groom Lake or Creech and fly to Nellis.
|
-- 3. F/A-18C are spawned at Tonopah, Groom Lake or Creech and fly to Nellis.
|
||||||
-- 4. KC-135 are spawned in air at two zones heading for Nellis.
|
-- 4. KC-135 are spawned in air at two zones heading for Nellis.
|
||||||
|
|
||||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Create RAT object from F-15C template.
|
-- Create RAT object from F-15C template.
|
||||||
local f15=RAT:New("RAT_F15C")
|
local f15=RAT:New("RAT_F15C")
|
||||||
|
|
||||||
-- Departure Nellis.
|
-- Departure Nellis.
|
||||||
f15:SetDeparture(AIRBASE.Nevada.Nellis_AFB)
|
f15:SetDeparture(AIRBASE.Nevada.Nellis_AFB)
|
||||||
f15:SetCoalition("same")
|
f15:SetCoalition("same")
|
||||||
|
|
||||||
-- Destination Tonopah, Groom Lake or Creech.
|
-- Destination Tonopah, Groom Lake or Creech.
|
||||||
f15:SetDestination({AIRBASE.Nevada.Tonopah_Airport, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB})
|
f15:SetDestination({AIRBASE.Nevada.Tonopah_Airport, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB})
|
||||||
|
|
||||||
-- Spawn three flights.
|
-- Spawn three flights.
|
||||||
f15:Spawn(3)
|
f15:Spawn(3)
|
||||||
|
|
||||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
local a10=RAT:New("RAT_A10C")
|
local a10=RAT:New("RAT_A10C")
|
||||||
|
|
||||||
-- Departure Nellis.
|
-- Departure Nellis.
|
||||||
a10:SetDeparture(AIRBASE.Nevada.Nellis_AFB)
|
a10:SetDeparture(AIRBASE.Nevada.Nellis_AFB)
|
||||||
a10:SetCoalition("same")
|
a10:SetCoalition("same")
|
||||||
|
|
||||||
-- Destination Tonopa, Groom Lake or Creech.
|
-- Destination Tonopa, Groom Lake or Creech.
|
||||||
a10:SetDestination({AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB})
|
a10:SetDestination({AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB})
|
||||||
|
|
||||||
-- Spawning will happen 60 seconds after mission start.
|
-- Spawning will happen 60 seconds after mission start.
|
||||||
a10:SetSpawnDelay(60)
|
a10:SetSpawnDelay(60)
|
||||||
|
|
||||||
-- Spawn three flights.
|
-- Spawn three flights.
|
||||||
a10:Spawn(3)
|
a10:Spawn(3)
|
||||||
|
|
||||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Creat RAT object from F/A-18C template.
|
-- Creat RAT object from F/A-18C template.
|
||||||
local f18=RAT:New("RAT_F18C")
|
local f18=RAT:New("RAT_F18C")
|
||||||
f18:SetCoalition("same")
|
f18:SetCoalition("same")
|
||||||
|
|
||||||
-- Departure airports.
|
-- Departure airports.
|
||||||
f18:SetDeparture({AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB})
|
f18:SetDeparture({AIRBASE.Nevada.Tonopah_Test_Range_Airfield, AIRBASE.Nevada.Groom_Lake_AFB, AIRBASE.Nevada.Creech_AFB})
|
||||||
|
|
||||||
-- Destination Nellis.
|
-- Destination Nellis.
|
||||||
f18:SetDestination(AIRBASE.Nevada.Nellis_AFB)
|
f18:SetDestination(AIRBASE.Nevada.Nellis_AFB)
|
||||||
|
|
||||||
-- Spawn three flights.
|
-- Spawn three flights.
|
||||||
f18:Spawn(3)
|
f18:Spawn(3)
|
||||||
|
|
||||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Create RAT object from KC-135 template.
|
-- Create RAT object from KC-135 template.
|
||||||
local kc135=RAT:New("RAT_KC135")
|
local kc135=RAT:New("RAT_KC135")
|
||||||
|
|
||||||
-- Set departure zones. We need takeoff "air" for that.
|
-- Set departure zones. We need takeoff "air" for that.
|
||||||
kc135:SetDeparture({"RAT Zone North", "RAT Zone East"})
|
kc135:SetDeparture({"RAT Zone North", "RAT Zone East"})
|
||||||
|
|
||||||
-- Set spawn in air.
|
-- Set spawn in air.
|
||||||
kc135:SetTakeoff("air")
|
kc135:SetTakeoff("air")
|
||||||
|
|
||||||
-- Aircraft will fly to McCarran
|
-- Aircraft will fly to McCarran
|
||||||
kc135:SetDestination(AIRBASE.Nevada.Nellis_AFB)
|
kc135:SetDestination(AIRBASE.Nevada.Nellis_AFB)
|
||||||
|
|
||||||
-- Spawning of aircraft will happen in 2 minute intervalls.
|
-- Spawning of aircraft will happen in 2 minute intervalls.
|
||||||
kc135:SetSpawnInterval(120)
|
kc135:SetSpawnInterval(120)
|
||||||
|
|
||||||
-- Spawn two aircraft.
|
-- Spawn two aircraft.
|
||||||
kc135:Spawn(2)
|
kc135:Spawn(2)
|
||||||
|
|
||||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Store time at mission start
|
-- Store time at mission start
|
||||||
local T0=timer.getTime()
|
local T0=timer.getTime()
|
||||||
|
|
||||||
-- Send message with current misson time to all coalisions
|
-- Send message with current misson time to all coalisions
|
||||||
local function print_mission_time()
|
local function print_mission_time()
|
||||||
local Tnow=timer.getTime()
|
local Tnow=timer.getTime()
|
||||||
local mission_time=Tnow-T0
|
local mission_time=Tnow-T0
|
||||||
local mission_time_minutes=mission_time/60
|
local mission_time_minutes=mission_time/60
|
||||||
local mission_time_seconds=mission_time%60
|
local mission_time_seconds=mission_time%60
|
||||||
local text=string.format("Mission Time: %i:%02d", mission_time_minutes,mission_time_seconds)
|
local text=string.format("Mission Time: %i:%02d", mission_time_minutes,mission_time_seconds)
|
||||||
MESSAGE:New(text, 5):ToAll()
|
MESSAGE:New(text, 5):ToAll()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Start scheduler to report mission time.
|
-- Start scheduler to report mission time.
|
||||||
local Scheduler_Mission_Time = SCHEDULER:New(nil, print_mission_time, {}, 0, 10)
|
local Scheduler_Mission_Time = SCHEDULER:New(nil, print_mission_time, {}, 0, 10)
|
||||||
@@ -1,85 +1,85 @@
|
|||||||
-- Name: RAT-020 - WWII Scenario
|
-- Name: RAT-020 - WWII Scenario
|
||||||
-- Author: funkyfranky
|
-- Author: funkyfranky
|
||||||
-- Date Created: 16 Sep 2017
|
-- Date Created: 16 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- We want to generate some random air traffic of WWII units in 1944 Normandy.
|
-- We want to generate some random air traffic of WWII units in 1944 Normandy.
|
||||||
-- In the mission editor we have defined a couple of red and blue airfields.
|
-- In the mission editor we have defined a couple of red and blue airfields.
|
||||||
-- Germans are located to the east while the allies hold the western airfiels and those of southern England.
|
-- Germans are located to the east while the allies hold the western airfiels and those of southern England.
|
||||||
-- Note that the default setting of the RAT aircraft is to hold their weapons and to ignore enemy threads.
|
-- Note that the default setting of the RAT aircraft is to hold their weapons and to ignore enemy threads.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Four two-ship flights of Bf-109 get random routes restricted to red airfields.
|
-- 1. Four two-ship flights of Bf-109 get random routes restricted to red airfields.
|
||||||
-- 2. Two two-ship flights of FW-190 similar to the Bf-109s.
|
-- 2. Two two-ship flights of FW-190 similar to the Bf-109s.
|
||||||
-- 3. Three two-ship flights of TF-51 get random routes restricted to blue airfields.
|
-- 3. Three two-ship flights of TF-51 get random routes restricted to blue airfields.
|
||||||
-- 4. Two two-ship flights of Spitfires are set up analogously to the TF-51
|
-- 4. Two two-ship flights of Spitfires are set up analogously to the TF-51
|
||||||
-- 5. One two-ship flight of Spitfires is explicitly ordered to fly back and forth across the channel.
|
-- 5. One two-ship flight of Spitfires is explicitly ordered to fly back and forth across the channel.
|
||||||
|
|
||||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Create RAT object from Bf-109 template.
|
-- Create RAT object from Bf-109 template.
|
||||||
local bf109=RAT:New("RAT_Bf109")
|
local bf109=RAT:New("RAT_Bf109")
|
||||||
|
|
||||||
-- Airports are restricted to red.
|
-- Airports are restricted to red.
|
||||||
bf109:SetCoalition("sameonly")
|
bf109:SetCoalition("sameonly")
|
||||||
|
|
||||||
-- Spawn four Bf-109.
|
-- Spawn four Bf-109.
|
||||||
bf109:Spawn(4)
|
bf109:Spawn(4)
|
||||||
|
|
||||||
-- Create RAT object from FW-190 template.
|
-- Create RAT object from FW-190 template.
|
||||||
local fw190=RAT:New("RAT_Fw190")
|
local fw190=RAT:New("RAT_Fw190")
|
||||||
|
|
||||||
-- Again, airports restricted to red.
|
-- Again, airports restricted to red.
|
||||||
fw190:SetCoalition("sameonly")
|
fw190:SetCoalition("sameonly")
|
||||||
|
|
||||||
-- Spawn two FW-190.
|
-- Spawn two FW-190.
|
||||||
fw190:Spawn(2)
|
fw190:Spawn(2)
|
||||||
|
|
||||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Create RAT object from TF-51 template.
|
-- Create RAT object from TF-51 template.
|
||||||
local tf51=RAT:New("RAT_TF-51")
|
local tf51=RAT:New("RAT_TF-51")
|
||||||
|
|
||||||
-- Allow only blue airports for departure and destination.
|
-- Allow only blue airports for departure and destination.
|
||||||
tf51:SetCoalition("sameonly")
|
tf51:SetCoalition("sameonly")
|
||||||
|
|
||||||
-- We exclude ever airport across the channel.
|
-- We exclude ever airport across the channel.
|
||||||
tf51:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"})
|
tf51:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"})
|
||||||
|
|
||||||
-- Spawn three TF-51.
|
-- Spawn three TF-51.
|
||||||
tf51:Spawn(3)
|
tf51:Spawn(3)
|
||||||
|
|
||||||
|
|
||||||
-- Creat RAT object from Spitfire template.
|
-- Creat RAT object from Spitfire template.
|
||||||
local spit=RAT:New("RAT_Spit")
|
local spit=RAT:New("RAT_Spit")
|
||||||
|
|
||||||
-- Blue airports only.
|
-- Blue airports only.
|
||||||
spit:SetCoalition("sameonly")
|
spit:SetCoalition("sameonly")
|
||||||
|
|
||||||
-- We exclude ever airport across the channel.
|
-- We exclude ever airport across the channel.
|
||||||
spit:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"})
|
spit:ExcludedAirports({"Needs Oar Point", "Funtington", "Tangmere", "Ford", "Chailey"})
|
||||||
|
|
||||||
-- Spawn two two-ship flights.
|
-- Spawn two two-ship flights.
|
||||||
spit:Spawn(2)
|
spit:Spawn(2)
|
||||||
|
|
||||||
-- Create RAT object from Spitfire template.
|
-- Create RAT object from Spitfire template.
|
||||||
-- NOTE that since we have already used this template, we need to give it another name.
|
-- NOTE that since we have already used this template, we need to give it another name.
|
||||||
-- This is done by the second parameter, which is the alias name for RAT aircraft.
|
-- This is done by the second parameter, which is the alias name for RAT aircraft.
|
||||||
-- In particular, this will be the name given in the F10 Menu.
|
-- In particular, this will be the name given in the F10 Menu.
|
||||||
-- IMPORTANT: It is no problem to reuse the same template multiple times. But each template must get its own alias!
|
-- IMPORTANT: It is no problem to reuse the same template multiple times. But each template must get its own alias!
|
||||||
local spit_commute=RAT:New("RAT_Spit", "RAT_Spit_Commute")
|
local spit_commute=RAT:New("RAT_Spit", "RAT_Spit_Commute")
|
||||||
|
|
||||||
-- These Spitfires get the order fly across the channel and to commute between Chailey and Le Molay.
|
-- These Spitfires get the order fly across the channel and to commute between Chailey and Le Molay.
|
||||||
spit_commute:SetDeparture("Chailey")
|
spit_commute:SetDeparture("Chailey")
|
||||||
spit_commute:SetDestination("Le Molay")
|
spit_commute:SetDestination("Le Molay")
|
||||||
spit_commute:Commute()
|
spit_commute:Commute()
|
||||||
|
|
||||||
-- Set another livery for these aircraft.
|
-- Set another livery for these aircraft.
|
||||||
spit_commute:Livery("RAF, No. 126 Squadron, Harrowbeer")
|
spit_commute:Livery("RAF, No. 126 Squadron, Harrowbeer")
|
||||||
|
|
||||||
-- Spawn one two-ship flight.
|
-- Spawn one two-ship flight.
|
||||||
spit_commute:Spawn()
|
spit_commute:Spawn()
|
||||||
|
|
||||||
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-- -----------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -1,38 +1,38 @@
|
|||||||
---
|
---
|
||||||
-- Name: SCO-100 - Scoring Demo
|
-- Name: SCO-100 - Scoring Demo
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 21 Feb 2017
|
-- Date Created: 21 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and units located near the airport, and shoot them.
|
-- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and units located near the airport, and shoot them.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
|
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
|
||||||
|
|
||||||
|
|
||||||
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
||||||
|
|
||||||
CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )
|
CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )
|
||||||
|
|
||||||
Scoring = SCORING:New( "Shooting Range 1" )
|
Scoring = SCORING:New( "Shooting Range 1" )
|
||||||
|
|
||||||
Scoring:SetScaleDestroyScore( 10 )
|
Scoring:SetScaleDestroyScore( 10 )
|
||||||
|
|
||||||
Scoring:SetScaleDestroyPenalty( 40 )
|
Scoring:SetScaleDestroyPenalty( 40 )
|
||||||
|
|
||||||
Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 )
|
Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 )
|
||||||
|
|
||||||
-- Test for zone scores.
|
-- Test for zone scores.
|
||||||
|
|
||||||
-- This one is to test scoring on normal units.
|
-- This one is to test scoring on normal units.
|
||||||
ShootingRangeZone = ZONE:New( "ScoringZone1" )
|
ShootingRangeZone = ZONE:New( "ScoringZone1" )
|
||||||
Scoring:AddZoneScore( ShootingRangeZone, 200 )
|
Scoring:AddZoneScore( ShootingRangeZone, 200 )
|
||||||
|
|
||||||
-- This one is to test scoring on scenery.
|
-- This one is to test scoring on scenery.
|
||||||
-- Note that you can only destroy scenery with heavy weapons.
|
-- Note that you can only destroy scenery with heavy weapons.
|
||||||
SceneryZone = ZONE:New( "ScoringZone2" )
|
SceneryZone = ZONE:New( "ScoringZone2" )
|
||||||
Scoring:AddZoneScore( SceneryZone, 200 )
|
Scoring:AddZoneScore( SceneryZone, 200 )
|
||||||
|
|
||||||
Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 )
|
Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 )
|
||||||
|
|||||||
+21
-21
@@ -1,21 +1,21 @@
|
|||||||
---
|
---
|
||||||
-- Name: SCO-101 - Scoring Client to Client
|
-- Name: SCO-101 - Scoring Client to Client
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 24 Feb 2017
|
-- Date Created: 24 Feb 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A shooting range has been setup to test client to client scoring.
|
-- A shooting range has been setup to test client to client scoring.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the scoring granted to your flight when you hit and kill other clients.
|
-- 1. Observe the scoring granted to your flight when you hit and kill other clients.
|
||||||
|
|
||||||
|
|
||||||
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
||||||
|
|
||||||
CommandCenter = COMMANDCENTER:New( HQ, "Lima" )
|
CommandCenter = COMMANDCENTER:New( HQ, "Lima" )
|
||||||
|
|
||||||
Scoring = SCORING:New( "Detect Demo" )
|
Scoring = SCORING:New( "Detect Demo" )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +1,41 @@
|
|||||||
---
|
---
|
||||||
-- Name: SCO-200 - Telemetry
|
-- Name: SCO-200 - Telemetry
|
||||||
-- Author: FlightControl
|
-- Author: FlightControl
|
||||||
-- Date Created: 24 Sep 2017
|
-- Date Created: 24 Sep 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and objects located near the airport, and shoot them.
|
-- A shooting range has been setup. Fly the Ka-50 or the Su-25T to the statics and objects located near the airport, and shoot them.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
|
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
|
||||||
-- 2. Check the scoring telemetry communicated to the website.
|
-- 2. Check the scoring telemetry communicated to the website.
|
||||||
|
|
||||||
|
|
||||||
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
|
||||||
|
|
||||||
CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )
|
CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )
|
||||||
|
|
||||||
Scoring = SCORING:New( "Shooting Range 1" )
|
Scoring = SCORING:New( "Shooting Range 1" )
|
||||||
|
|
||||||
Scoring:SetTelemetryServer( "96.49.78.227", 5010 )
|
Scoring:SetTelemetryServer( "96.49.78.227", 5010 )
|
||||||
|
|
||||||
Scoring:SetScaleDestroyScore( 10 )
|
Scoring:SetScaleDestroyScore( 10 )
|
||||||
|
|
||||||
Scoring:SetScaleDestroyPenalty( 40 )
|
Scoring:SetScaleDestroyPenalty( 40 )
|
||||||
|
|
||||||
Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 )
|
Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 )
|
||||||
|
|
||||||
-- Test for zone scores.
|
-- Test for zone scores.
|
||||||
|
|
||||||
-- This one is to test scoring on normal units.
|
-- This one is to test scoring on normal units.
|
||||||
ShootingRangeZone = ZONE:New( "ScoringZone1" )
|
ShootingRangeZone = ZONE:New( "ScoringZone1" )
|
||||||
Scoring:AddZoneScore( ShootingRangeZone, 200 )
|
Scoring:AddZoneScore( ShootingRangeZone, 200 )
|
||||||
|
|
||||||
-- This one is to test scoring on scenery.
|
-- This one is to test scoring on scenery.
|
||||||
-- Note that you can only destroy scenery with heavy weapons.
|
-- Note that you can only destroy scenery with heavy weapons.
|
||||||
SceneryZone = ZONE:New( "ScoringZone2" )
|
SceneryZone = ZONE:New( "ScoringZone2" )
|
||||||
Scoring:AddZoneScore( SceneryZone, 200 )
|
Scoring:AddZoneScore( SceneryZone, 200 )
|
||||||
|
|
||||||
Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 )
|
Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 )
|
||||||
|
|||||||
+139
-139
@@ -1,139 +1,139 @@
|
|||||||
---
|
---
|
||||||
-- Name: SCO-500 - Scoring Multi Player Demo Mission 1
|
-- Name: SCO-500 - Scoring Multi Player Demo Mission 1
|
||||||
-- Author: Pikey and FlightControl
|
-- Author: Pikey and FlightControl
|
||||||
-- Date Created: 1 Mar 2017
|
-- Date Created: 1 Mar 2017
|
||||||
--
|
--
|
||||||
-- # Situation:
|
-- # Situation:
|
||||||
--
|
--
|
||||||
-- A demo mission for the scoring. Read the briefing and have fun.
|
-- A demo mission for the scoring. Read the briefing and have fun.
|
||||||
--
|
--
|
||||||
-- # Test cases:
|
-- # Test cases:
|
||||||
--
|
--
|
||||||
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
|
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
|
||||||
|
|
||||||
-- Define the patrol zones
|
-- Define the patrol zones
|
||||||
BlueCapZone = ZONE_POLYGON:New( "BlueCapZone", GROUP:FindByName( "Blue CAP Zone Patrol" ) )
|
BlueCapZone = ZONE_POLYGON:New( "BlueCapZone", GROUP:FindByName( "Blue CAP Zone Patrol" ) )
|
||||||
RedCapZone = ZONE_POLYGON:New( "RedCapZone", GROUP:FindByName( "Red CAP Zone Patrol" ) )
|
RedCapZone = ZONE_POLYGON:New( "RedCapZone", GROUP:FindByName( "Red CAP Zone Patrol" ) )
|
||||||
|
|
||||||
-- Define the engage zones
|
-- Define the engage zones
|
||||||
BlueEngageZone = ZONE_POLYGON:New( "BlueEngageZone", GROUP:FindByName( "Blue CAP Zone Engage" ) )
|
BlueEngageZone = ZONE_POLYGON:New( "BlueEngageZone", GROUP:FindByName( "Blue CAP Zone Engage" ) )
|
||||||
RedEngageZone = ZONE_POLYGON:New( "RedEngageZone", GROUP:FindByName( "Red CAP Zone Engage" ) )
|
RedEngageZone = ZONE_POLYGON:New( "RedEngageZone", GROUP:FindByName( "Red CAP Zone Engage" ) )
|
||||||
|
|
||||||
-- Define the Spawn zones for ground vehicles
|
-- Define the Spawn zones for ground vehicles
|
||||||
BlueSpawnGroundZone = ZONE_POLYGON:New( "BlueSpawnGroundZone", GROUP:FindByName( "Blue Spawn Zone" ) )
|
BlueSpawnGroundZone = ZONE_POLYGON:New( "BlueSpawnGroundZone", GROUP:FindByName( "Blue Spawn Zone" ) )
|
||||||
--RedSpawnGroundZone = ZONE_POLYGON:New( "RedSpawnGroundZone", GROUP:FindByName( "Red Spawn Zone" ) )
|
--RedSpawnGroundZone = ZONE_POLYGON:New( "RedSpawnGroundZone", GROUP:FindByName( "Red Spawn Zone" ) )
|
||||||
|
|
||||||
RedSpawnGroundZone = ZONE:New( "Red Spawn Zone" )
|
RedSpawnGroundZone = ZONE:New( "Red Spawn Zone" )
|
||||||
|
|
||||||
-- Define the Scoring zones that define the shelters
|
-- Define the Scoring zones that define the shelters
|
||||||
BlueShelterZone = ZONE_POLYGON:New( "Blue Shelters", GROUP:FindByName( "Blue Shelters" ) )
|
BlueShelterZone = ZONE_POLYGON:New( "Blue Shelters", GROUP:FindByName( "Blue Shelters" ) )
|
||||||
RedShelterZone = ZONE_POLYGON:New( "Red Shelters", GROUP:FindByName( "Red Shelters" ) )
|
RedShelterZone = ZONE_POLYGON:New( "Red Shelters", GROUP:FindByName( "Red Shelters" ) )
|
||||||
|
|
||||||
-- Define the Set of Clients that are used for the AI Balancers
|
-- Define the Set of Clients that are used for the AI Balancers
|
||||||
BluePlanesClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterCategories( "plane" ):FilterPrefixes( "Blue Player")
|
BluePlanesClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterCategories( "plane" ):FilterPrefixes( "Blue Player")
|
||||||
RedPlanesClientSet = SET_CLIENT:New():FilterCoalitions( "red" ):FilterCategories( "plane" ):FilterPrefixes( "Red Player")
|
RedPlanesClientSet = SET_CLIENT:New():FilterCoalitions( "red" ):FilterCategories( "plane" ):FilterPrefixes( "Red Player")
|
||||||
|
|
||||||
-- Define the Spawn objects for the AI planes
|
-- Define the Spawn objects for the AI planes
|
||||||
BluePlanesSpawn = SPAWN:New( "BlueAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 )
|
BluePlanesSpawn = SPAWN:New( "BlueAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 )
|
||||||
RedPlanesSpawn = SPAWN:New( "RedAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 )
|
RedPlanesSpawn = SPAWN:New( "RedAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 )
|
||||||
|
|
||||||
-- Define the AI Balancers for the planes
|
-- Define the AI Balancers for the planes
|
||||||
BlueAIB = AI_BALANCER:New( BluePlanesClientSet, BluePlanesSpawn ):InitSpawnInterval( 60, 1200 )
|
BlueAIB = AI_BALANCER:New( BluePlanesClientSet, BluePlanesSpawn ):InitSpawnInterval( 60, 1200 )
|
||||||
RedAIB = AI_BALANCER:New( RedPlanesClientSet, RedPlanesSpawn ):InitSpawnInterval( 60, 1200 )
|
RedAIB = AI_BALANCER:New( RedPlanesClientSet, RedPlanesSpawn ):InitSpawnInterval( 60, 1200 )
|
||||||
|
|
||||||
-- Define the Spawn objects for the airbase defenses
|
-- Define the Spawn objects for the airbase defenses
|
||||||
BlueAirbaseDefense1Spawn = SPAWN:New( "Blue Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 )
|
BlueAirbaseDefense1Spawn = SPAWN:New( "Blue Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 )
|
||||||
BlueAirbaseDefense2Spawn = SPAWN:New( "Blue Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 )
|
BlueAirbaseDefense2Spawn = SPAWN:New( "Blue Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 )
|
||||||
RedAirbaseDefense1Spawn = SPAWN:New( "Red Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 )
|
RedAirbaseDefense1Spawn = SPAWN:New( "Red Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 )
|
||||||
RedAirbaseDefense2Spawn = SPAWN:New( "Red Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 )
|
RedAirbaseDefense2Spawn = SPAWN:New( "Red Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 )
|
||||||
|
|
||||||
-- Define the ground forces spawning engines...
|
-- Define the ground forces spawning engines...
|
||||||
|
|
||||||
-- First define the template arrays.
|
-- First define the template arrays.
|
||||||
BlueGroundTemplates = { "Blue Ground Forces 1", "Blue Ground Forces 2", "Blue Ground Forces 3" }
|
BlueGroundTemplates = { "Blue Ground Forces 1", "Blue Ground Forces 2", "Blue Ground Forces 3" }
|
||||||
RedGroundTemplates = { "Red Ground Forces 2", "Red Ground Forces 2", "Red Ground Forces 3" }
|
RedGroundTemplates = { "Red Ground Forces 2", "Red Ground Forces 2", "Red Ground Forces 3" }
|
||||||
|
|
||||||
-- New we are using these templates to define the spawn objects for the ground forces.
|
-- New we are using these templates to define the spawn objects for the ground forces.
|
||||||
-- We spawn them at random places into the define zone.
|
-- We spawn them at random places into the define zone.
|
||||||
BlueGroundSpawn = SPAWN
|
BlueGroundSpawn = SPAWN
|
||||||
:New( "Blue Ground Forces" )
|
:New( "Blue Ground Forces" )
|
||||||
:InitLimit( 12, 30 )
|
:InitLimit( 12, 30 )
|
||||||
:InitRandomizeZones( { BlueSpawnGroundZone } )
|
:InitRandomizeZones( { BlueSpawnGroundZone } )
|
||||||
:InitRandomizeTemplate( BlueGroundTemplates )
|
:InitRandomizeTemplate( BlueGroundTemplates )
|
||||||
:SpawnScheduled( 60, 0.2 )
|
:SpawnScheduled( 60, 0.2 )
|
||||||
|
|
||||||
RedGroundSpawn = SPAWN
|
RedGroundSpawn = SPAWN
|
||||||
:New( "Red Ground Forces" )
|
:New( "Red Ground Forces" )
|
||||||
:InitLimit( 12, 30 )
|
:InitLimit( 12, 30 )
|
||||||
:InitRandomizeTemplate( RedGroundTemplates )
|
:InitRandomizeTemplate( RedGroundTemplates )
|
||||||
:InitRandomizeZones( { RedSpawnGroundZone } )
|
:InitRandomizeZones( { RedSpawnGroundZone } )
|
||||||
:SpawnScheduled( 60, 0.2 )
|
:SpawnScheduled( 60, 0.2 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BlueCap = {}
|
BlueCap = {}
|
||||||
RedCap = {}
|
RedCap = {}
|
||||||
|
|
||||||
-- Define the OnAfterSpawned events of the AI balancer Spawn Groups
|
-- Define the OnAfterSpawned events of the AI balancer Spawn Groups
|
||||||
function BlueAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
function BlueAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||||
if AIGroup then
|
if AIGroup then
|
||||||
BlueCap[AIGroup] = BlueCap[AIGroup] or AI_CAP_ZONE:New( BlueCapZone, 500, 3000, 450, 1200 )
|
BlueCap[AIGroup] = BlueCap[AIGroup] or AI_CAP_ZONE:New( BlueCapZone, 500, 3000, 450, 1200 )
|
||||||
local Cap = BlueCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE
|
local Cap = BlueCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE
|
||||||
|
|
||||||
Cap:ManageFuel( 0.4, 180 )
|
Cap:ManageFuel( 0.4, 180 )
|
||||||
Cap:SetEngageZone( BlueEngageZone )
|
Cap:SetEngageZone( BlueEngageZone )
|
||||||
Cap:SetControllable( AIGroup )
|
Cap:SetControllable( AIGroup )
|
||||||
Cap:Start()
|
Cap:Start()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function RedAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
function RedAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
|
||||||
|
|
||||||
if AIGroup then
|
if AIGroup then
|
||||||
RedCap[AIGroup] = RedCap[AIGroup] or AI_CAP_ZONE:New( RedCapZone, 500, 3000, 450, 1200 )
|
RedCap[AIGroup] = RedCap[AIGroup] or AI_CAP_ZONE:New( RedCapZone, 500, 3000, 450, 1200 )
|
||||||
local Cap = RedCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE
|
local Cap = RedCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE
|
||||||
|
|
||||||
Cap:ManageFuel( 0.4, 180 )
|
Cap:ManageFuel( 0.4, 180 )
|
||||||
Cap:SetEngageZone( BlueEngageZone )
|
Cap:SetEngageZone( BlueEngageZone )
|
||||||
Cap:SetControllable( AIGroup )
|
Cap:SetControllable( AIGroup )
|
||||||
Cap:Start()
|
Cap:Start()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Okay, now that we defined all this stuff, now make the SCORING setup ...
|
-- Okay, now that we defined all this stuff, now make the SCORING setup ...
|
||||||
|
|
||||||
-- First define a Scoring object
|
-- First define a Scoring object
|
||||||
local Scoring = SCORING:New( "SCO-500 - Scoring Demonstration Mission" )
|
local Scoring = SCORING:New( "SCO-500 - Scoring Demonstration Mission" )
|
||||||
|
|
||||||
-- Define within the scoring the shelter designated targets.
|
-- Define within the scoring the shelter designated targets.
|
||||||
Scoring:AddZoneScore( BlueShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted.
|
Scoring:AddZoneScore( BlueShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted.
|
||||||
Scoring:AddZoneScore( RedShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted.
|
Scoring:AddZoneScore( RedShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted.
|
||||||
|
|
||||||
-- Define the static objects that give extra scores
|
-- Define the static objects that give extra scores
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 1"), 100 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 1"), 100 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 2"), 100 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 2"), 100 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 3"), 100 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 3"), 100 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 4"), 100 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 4"), 100 )
|
||||||
|
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #001"), 80 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #001"), 80 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #002"), 80 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #002"), 80 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #003"), 80 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #003"), 80 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #004"), 80 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #004"), 80 )
|
||||||
|
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 1" ), 100 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 1" ), 100 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 2" ), 100 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 2" ), 100 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 3" ), 100 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 3" ), 100 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 4" ), 100 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 4" ), 100 )
|
||||||
|
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #001" ), 80 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #001" ), 80 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #002" ), 80 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #002" ), 80 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #003" ), 80 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #003" ), 80 )
|
||||||
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #004" ), 80 )
|
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #004" ), 80 )
|
||||||
|
|
||||||
-- Scale the scoring rewarded.
|
-- Scale the scoring rewarded.
|
||||||
Scoring:SetScaleDestroyScore( 30 )
|
Scoring:SetScaleDestroyScore( 30 )
|
||||||
Scoring:SetScaleDestroyPenalty( 90 ) -- Penalties are punished more than normal destroys.
|
Scoring:SetScaleDestroyPenalty( 90 ) -- Penalties are punished more than normal destroys.
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- CCCP SEAD Defenses
|
-- CCCP SEAD Defenses
|
||||||
SEAD_RU_SAM_Defenses = SEAD
|
SEAD_RU_SAM_Defenses = SEAD
|
||||||
:New(
|
:New(
|
||||||
{ 'SAM Test'
|
{ 'SAM Test'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -1,39 +1,39 @@
|
|||||||
------------------
|
------------------
|
||||||
-- Self Request --
|
-- Self Request --
|
||||||
------------------
|
------------------
|
||||||
-- 1. Two groups of infantry are spawned in the Batumi spawn zone.
|
-- 1. Two groups of infantry are spawned in the Batumi spawn zone.
|
||||||
-- 2. After ~10 seconds they are put back into the warehouse stock.
|
-- 2. After ~10 seconds they are put back into the warehouse stock.
|
||||||
-- 3. After some time they are spawned again.
|
-- 3. After some time they are spawned again.
|
||||||
-- 4. And so on and so forth...
|
-- 4. And so on and so forth...
|
||||||
|
|
||||||
-- Create a WAREHOUSE object.
|
-- Create a WAREHOUSE object.
|
||||||
local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi")
|
local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi")
|
||||||
|
|
||||||
-- Start warehouse Batumi.
|
-- Start warehouse Batumi.
|
||||||
warehouseBatumi:Start()
|
warehouseBatumi:Start()
|
||||||
|
|
||||||
-- Add one infantry asset.
|
-- Add one infantry asset.
|
||||||
warehouseBatumi:AddAsset(GROUP:FindByName("Infantry Platoon Alpha"), 4)
|
warehouseBatumi:AddAsset(GROUP:FindByName("Infantry Platoon Alpha"), 4)
|
||||||
|
|
||||||
-- Add self request for one infantry at Batumi.
|
-- Add self request for one infantry at Batumi.
|
||||||
warehouseBatumi:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2)
|
warehouseBatumi:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2)
|
||||||
|
|
||||||
--- Self request event. Triggered once the assets are spawned in the spawn zone or at the airbase.
|
--- Self request event. Triggered once the assets are spawned in the spawn zone or at the airbase.
|
||||||
function warehouseBatumi:OnAfterSelfRequest(From, Event, To, groupset, request)
|
function warehouseBatumi:OnAfterSelfRequest(From, Event, To, groupset, request)
|
||||||
local groupset=groupset --Core.Set#SET_GROUP
|
local groupset=groupset --Core.Set#SET_GROUP
|
||||||
|
|
||||||
-- Loop over all groups spawned from that request.
|
-- Loop over all groups spawned from that request.
|
||||||
for _,group in pairs(groupset:GetSet()) do
|
for _,group in pairs(groupset:GetSet()) do
|
||||||
local group=group --Wrapper.Group#GROUP
|
local group=group --Wrapper.Group#GROUP
|
||||||
|
|
||||||
-- Gree smoke on spawned group.
|
-- Gree smoke on spawned group.
|
||||||
--group:SmokeGreen()
|
--group:SmokeGreen()
|
||||||
|
|
||||||
-- Put asset back to stock after 10 seconds.
|
-- Put asset back to stock after 10 seconds.
|
||||||
warehouseBatumi:__AddAsset(10, group)
|
warehouseBatumi:__AddAsset(10, group)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add new self request after 20 seconds.
|
-- Add new self request after 20 seconds.
|
||||||
warehouseBatumi:__AddRequest(20, warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2)
|
warehouseBatumi:__AddRequest(20, warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
+30
-30
@@ -1,30 +1,30 @@
|
|||||||
----------------------------------
|
----------------------------------
|
||||||
-- Self Propelled Ground Troops --
|
-- Self Propelled Ground Troops --
|
||||||
----------------------------------
|
----------------------------------
|
||||||
-- 1. Ground troops - APCs and infantry - are transferred from Batumi to FARP Berlin.
|
-- 1. Ground troops - APCs and infantry - are transferred from Batumi to FARP Berlin.
|
||||||
-- 2. Warehouse Berlin is empty initially. But a request from Batumi is made for APCs. This cannot be processed and is held in the queue.
|
-- 2. Warehouse Berlin is empty initially. But a request from Batumi is made for APCs. This cannot be processed and is held in the queue.
|
||||||
-- 3. Once the assets arrive at Berlin, the request can be processed and some APCs are send back to Batumi.
|
-- 3. Once the assets arrive at Berlin, the request can be processed and some APCs are send back to Batumi.
|
||||||
|
|
||||||
-- Create WAREHOUSE objects.
|
-- Create WAREHOUSE objects.
|
||||||
local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi")
|
local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi")
|
||||||
local warehouseBerlin=WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin")
|
local warehouseBerlin=WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin")
|
||||||
|
|
||||||
-- Set spawn zone for warehouse Batumi.
|
-- Set spawn zone for warehouse Batumi.
|
||||||
warehouseBatumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
warehouseBatumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
||||||
|
|
||||||
-- Start Warehouse at Batumi.
|
-- Start Warehouse at Batumi.
|
||||||
warehouseBatumi:Start()
|
warehouseBatumi:Start()
|
||||||
|
|
||||||
-- Add 20 infantry groups and 10 APCs as assets to Batumi warehouse stock.
|
-- Add 20 infantry groups and 10 APCs as assets to Batumi warehouse stock.
|
||||||
warehouseBatumi:AddAsset("Infantry Platoon Alpha", 20)
|
warehouseBatumi:AddAsset("Infantry Platoon Alpha", 20)
|
||||||
warehouseBatumi:AddAsset("TPz Fuchs", 10)
|
warehouseBatumi:AddAsset("TPz Fuchs", 10)
|
||||||
|
|
||||||
-- Start Warehouse Berlin.
|
-- Start Warehouse Berlin.
|
||||||
warehouseBerlin:Start()
|
warehouseBerlin:Start()
|
||||||
|
|
||||||
-- Warehouse Berlin requests ten infantry groups and five APCs from warehouse Batumi
|
-- Warehouse Berlin requests ten infantry groups and five APCs from warehouse Batumi
|
||||||
warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 10)
|
warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 10)
|
||||||
warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 5)
|
warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 5)
|
||||||
|
|
||||||
-- Request from Batumi for two APCs. Initially these are not in stock. When they become available, the request is executed.
|
-- Request from Batumi for two APCs. Initially these are not in stock. When they become available, the request is executed.
|
||||||
warehouseBerlin:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 2)
|
warehouseBerlin:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 2)
|
||||||
|
|||||||
+29
-29
@@ -1,29 +1,29 @@
|
|||||||
------------------------------------
|
------------------------------------
|
||||||
-- Self Propelled Airborne Assets --
|
-- Self Propelled Airborne Assets --
|
||||||
------------------------------------
|
------------------------------------
|
||||||
-- 1. Kutaisi requests two Yak-52 with high (10) priority from Senaki.
|
-- 1. Kutaisi requests two Yak-52 with high (10) priority from Senaki.
|
||||||
-- 2. Kobuleti requests half Yak-52 with low (70) priority and gets the remaining half of the rest.
|
-- 2. Kobuleti requests half Yak-52 with low (70) priority and gets the remaining half of the rest.
|
||||||
-- 3. FARP London requests 1/3 of all available Hueys from Senaki.
|
-- 3. FARP London requests 1/3 of all available Hueys from Senaki.
|
||||||
|
|
||||||
-- Create WAREHOUSE objects.
|
-- Create WAREHOUSE objects.
|
||||||
local warehouseSenaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki")
|
local warehouseSenaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki")
|
||||||
local warehouseKutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi")
|
local warehouseKutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi")
|
||||||
local warehouseKobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti")
|
local warehouseKobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti")
|
||||||
local warehouseLondon = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London")
|
local warehouseLondon = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London")
|
||||||
|
|
||||||
-- Start warehouses
|
-- Start warehouses
|
||||||
warehouseSenaki:Start()
|
warehouseSenaki:Start()
|
||||||
warehouseKutaisi:Start()
|
warehouseKutaisi:Start()
|
||||||
warehouseKobuleti:Start()
|
warehouseKobuleti:Start()
|
||||||
warehouseLondon:Start()
|
warehouseLondon:Start()
|
||||||
|
|
||||||
-- Add assets to Senaki warehouse
|
-- Add assets to Senaki warehouse
|
||||||
warehouseSenaki:AddAsset("Yak-52", 10)
|
warehouseSenaki:AddAsset("Yak-52", 10)
|
||||||
warehouseSenaki:AddAsset("Huey", 6)
|
warehouseSenaki:AddAsset("Huey", 6)
|
||||||
|
|
||||||
-- Kusaisi requests 3 Yak-52 form Senaki while Kobuleti wants all the rest.
|
-- Kusaisi requests 3 Yak-52 form Senaki while Kobuleti wants all the rest.
|
||||||
warehouseSenaki:AddRequest(warehouseKutaisi, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", 1, nil, nil, 10)
|
warehouseSenaki:AddRequest(warehouseKutaisi, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", 1, nil, nil, 10)
|
||||||
warehouseSenaki:AddRequest(warehouseKobuleti, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", WAREHOUSE.Quantity.HALF, nil, nil, 70)
|
warehouseSenaki:AddRequest(warehouseKobuleti, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", WAREHOUSE.Quantity.HALF, nil, nil, 70)
|
||||||
|
|
||||||
-- FARP London wants 1/3 of the six available Hueys.
|
-- FARP London wants 1/3 of the six available Hueys.
|
||||||
warehouseSenaki:AddRequest(warehouseLondon, WAREHOUSE.Descriptor.GROUPNAME, "Huey", WAREHOUSE.Quantity.THIRD)
|
warehouseSenaki:AddRequest(warehouseLondon, WAREHOUSE.Descriptor.GROUPNAME, "Huey", WAREHOUSE.Quantity.THIRD)
|
||||||
|
|||||||
@@ -1,103 +1,103 @@
|
|||||||
-----------------------
|
-----------------------
|
||||||
-- Test 17: Resupply --
|
-- Test 17: Resupply --
|
||||||
-----------------------
|
-----------------------
|
||||||
-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone.
|
-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone.
|
||||||
-- Whenever a group dies, a new group is send from the warehouse to the battle zone.
|
-- Whenever a group dies, a new group is send from the warehouse to the battle zone.
|
||||||
-- Additionally, for each dead group, Berlin requests resupply from Batumi.
|
-- Additionally, for each dead group, Berlin requests resupply from Batumi.
|
||||||
|
|
||||||
-- Display mission time every 30 seconds.
|
-- Display mission time every 30 seconds.
|
||||||
SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30)
|
SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Define Warehouses.
|
-- Define Warehouses.
|
||||||
local warehouse={}
|
local warehouse={}
|
||||||
|
|
||||||
-- Blue warehouses
|
-- Blue warehouses
|
||||||
warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE
|
warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE
|
warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE
|
warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE
|
warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE
|
warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE
|
warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE
|
warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE
|
warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE
|
warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE
|
||||||
-- Red warehouse
|
-- Red warehouse
|
||||||
warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE
|
warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE
|
warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE
|
warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE
|
||||||
|
|
||||||
-- Fine tune warehouses if necessary.
|
-- Fine tune warehouses if necessary.
|
||||||
warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
||||||
warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone"))
|
warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone"))
|
||||||
warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone")))
|
warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone")))
|
||||||
|
|
||||||
|
|
||||||
-- Creat explosion at an object.
|
-- Creat explosion at an object.
|
||||||
local function Explosion(object, power)
|
local function Explosion(object, power)
|
||||||
power=power or 1000
|
power=power or 1000
|
||||||
if object and object:IsAlive() then
|
if object and object:IsAlive() then
|
||||||
object:GetCoordinate():Explosion(power)
|
object:GetCoordinate():Explosion(power)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Start warehouses.
|
-- Start warehouses.
|
||||||
warehouse.Batumi:Start()
|
warehouse.Batumi:Start()
|
||||||
warehouse.Berlin:Start()
|
warehouse.Berlin:Start()
|
||||||
|
|
||||||
-- Front line warehouse.
|
-- Front line warehouse.
|
||||||
warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6)
|
warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6)
|
||||||
|
|
||||||
-- Resupply warehouse.
|
-- Resupply warehouse.
|
||||||
warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50)
|
warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50)
|
||||||
|
|
||||||
-- Battle zone near FARP Berlin. This is where the action is!
|
-- Battle zone near FARP Berlin. This is where the action is!
|
||||||
local BattleZone=ZONE:New("Virtual Battle Zone")
|
local BattleZone=ZONE:New("Virtual Battle Zone")
|
||||||
|
|
||||||
-- Send infantry groups to the battle zone. Two groups every ~60 seconds.
|
-- Send infantry groups to the battle zone. Two groups every ~60 seconds.
|
||||||
for i=1,2 do
|
for i=1,2 do
|
||||||
local time=(i-1)*60+10
|
local time=(i-1)*60+10
|
||||||
warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone")
|
warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Take care of the spawned units.
|
-- Take care of the spawned units.
|
||||||
function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request)
|
function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request)
|
||||||
local groupset=groupset --Core.Set#SET_GROUP
|
local groupset=groupset --Core.Set#SET_GROUP
|
||||||
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
||||||
|
|
||||||
-- Get assignment of this request.
|
-- Get assignment of this request.
|
||||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||||
|
|
||||||
if assignment=="To Battle Zone" then
|
if assignment=="To Battle Zone" then
|
||||||
|
|
||||||
for _,group in pairs(groupset:GetSet()) do
|
for _,group in pairs(groupset:GetSet()) do
|
||||||
local group=group --Wrapper.Group#GROUP
|
local group=group --Wrapper.Group#GROUP
|
||||||
|
|
||||||
-- Route group to Battle zone.
|
-- Route group to Battle zone.
|
||||||
local ToCoord=BattleZone:GetRandomCoordinate()
|
local ToCoord=BattleZone:GetRandomCoordinate()
|
||||||
group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80)
|
group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80)
|
||||||
|
|
||||||
-- After 3-5 minutes we create an explosion to destroy the group.
|
-- After 3-5 minutes we create an explosion to destroy the group.
|
||||||
SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300))
|
SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- An asset has died ==> request resupply for it.
|
-- An asset has died ==> request resupply for it.
|
||||||
function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request)
|
function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request)
|
||||||
local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem
|
local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem
|
||||||
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
||||||
|
|
||||||
-- Get assignment.
|
-- Get assignment.
|
||||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||||
|
|
||||||
-- Request resupply for dead asset from Batumi.
|
-- Request resupply for dead asset from Batumi.
|
||||||
warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply")
|
warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply")
|
||||||
|
|
||||||
-- Send asset to Battle zone either now or when they arrive.
|
-- Send asset to Battle zone either now or when they arrive.
|
||||||
warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment)
|
warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,103 +1,103 @@
|
|||||||
-----------------------
|
-----------------------
|
||||||
-- Test 17: Resupply --
|
-- Test 17: Resupply --
|
||||||
-----------------------
|
-----------------------
|
||||||
-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone.
|
-- Warehouse at FARP Berlin is located at the front line and sends infantry groups to the battle zone.
|
||||||
-- Whenever a group dies, a new group is send from the warehouse to the battle zone.
|
-- Whenever a group dies, a new group is send from the warehouse to the battle zone.
|
||||||
-- Additionally, for each dead group, Berlin requests resupply from Batumi.
|
-- Additionally, for each dead group, Berlin requests resupply from Batumi.
|
||||||
|
|
||||||
-- Display mission time every 30 seconds.
|
-- Display mission time every 30 seconds.
|
||||||
SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30)
|
SCHEDULER:New(nil, UTILS.DisplayMissionTime, {5}, 30, 30)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
-- Define Warehouses.
|
-- Define Warehouses.
|
||||||
local warehouse={}
|
local warehouse={}
|
||||||
|
|
||||||
-- Blue warehouses
|
-- Blue warehouses
|
||||||
warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE
|
warehouse.Senaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE
|
warehouse.Batumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE
|
warehouse.Kobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE
|
warehouse.Kutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE
|
warehouse.Berlin = WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE
|
warehouse.London = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE
|
warehouse.Stennis = WAREHOUSE:New(STATIC:FindByName("Warehouse Stennis"), "Stennis") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE
|
warehouse.Pampa = WAREHOUSE:New(STATIC:FindByName("Warehouse Pampa"), "Pampa") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE
|
warehouse.Pearth = WAREHOUSE:New(STATIC:FindByName("Warehouse Pearth"), "Pearth") --Functional.Warehouse#WAREHOUSE
|
||||||
-- Red warehouse
|
-- Red warehouse
|
||||||
warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE
|
warehouse.Sukhumi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sukhumi"), "Sukhumi") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE
|
warehouse.Gudauta = WAREHOUSE:New(STATIC:FindByName("Warehouse Gudauta"), "Gudauta") --Functional.Warehouse#WAREHOUSE
|
||||||
warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE
|
warehouse.Sochi = WAREHOUSE:New(STATIC:FindByName("Warehouse Sochi"), "Sochi") --Functional.Warehouse#WAREHOUSE
|
||||||
|
|
||||||
-- Fine tune warehouses if necessary.
|
-- Fine tune warehouses if necessary.
|
||||||
warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
warehouse.Batumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
||||||
warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone"))
|
warehouse.Senaki:SetSpawnZone(ZONE:New("Warehouse Senaki Spawn Zone"))
|
||||||
warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone")))
|
warehouse.Kobuleti:SetSpawnZone(ZONE_POLYGON:New("Warehouse Kobuleti Spawn Zone", GROUP:FindByName("Warehouse Kobuleti Spawn Zone")))
|
||||||
|
|
||||||
|
|
||||||
-- Creat explosion at an object.
|
-- Creat explosion at an object.
|
||||||
local function Explosion(object, power)
|
local function Explosion(object, power)
|
||||||
power=power or 1000
|
power=power or 1000
|
||||||
if object and object:IsAlive() then
|
if object and object:IsAlive() then
|
||||||
object:GetCoordinate():Explosion(power)
|
object:GetCoordinate():Explosion(power)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Start warehouses.
|
-- Start warehouses.
|
||||||
warehouse.Batumi:Start()
|
warehouse.Batumi:Start()
|
||||||
warehouse.Berlin:Start()
|
warehouse.Berlin:Start()
|
||||||
|
|
||||||
-- Front line warehouse.
|
-- Front line warehouse.
|
||||||
warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6)
|
warehouse.Berlin:AddAsset("Infantry Platoon Alpha", 6)
|
||||||
|
|
||||||
-- Resupply warehouse.
|
-- Resupply warehouse.
|
||||||
warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50)
|
warehouse.Batumi:AddAsset("Infantry Platoon Alpha", 50)
|
||||||
|
|
||||||
-- Battle zone near FARP Berlin. This is where the action is!
|
-- Battle zone near FARP Berlin. This is where the action is!
|
||||||
local BattleZone=ZONE:New("Virtual Battle Zone")
|
local BattleZone=ZONE:New("Virtual Battle Zone")
|
||||||
|
|
||||||
-- Send infantry groups to the battle zone. Two groups every ~60 seconds.
|
-- Send infantry groups to the battle zone. Two groups every ~60 seconds.
|
||||||
for i=1,2 do
|
for i=1,2 do
|
||||||
local time=(i-1)*60+10
|
local time=(i-1)*60+10
|
||||||
warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone")
|
warehouse.Berlin:__AddRequest(time, warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2, nil, nil, nil, "To Battle Zone")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Take care of the spawned units.
|
-- Take care of the spawned units.
|
||||||
function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request)
|
function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request)
|
||||||
local groupset=groupset --Core.Set#SET_GROUP
|
local groupset=groupset --Core.Set#SET_GROUP
|
||||||
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
||||||
|
|
||||||
-- Get assignment of this request.
|
-- Get assignment of this request.
|
||||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||||
|
|
||||||
if assignment=="To Battle Zone" then
|
if assignment=="To Battle Zone" then
|
||||||
|
|
||||||
for _,group in pairs(groupset:GetSet()) do
|
for _,group in pairs(groupset:GetSet()) do
|
||||||
local group=group --Wrapper.Group#GROUP
|
local group=group --Wrapper.Group#GROUP
|
||||||
|
|
||||||
-- Route group to Battle zone.
|
-- Route group to Battle zone.
|
||||||
local ToCoord=BattleZone:GetRandomCoordinate()
|
local ToCoord=BattleZone:GetRandomCoordinate()
|
||||||
group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80)
|
group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80)
|
||||||
|
|
||||||
-- After 3-5 minutes we create an explosion to destroy the group.
|
-- After 3-5 minutes we create an explosion to destroy the group.
|
||||||
SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300))
|
SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300))
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- An asset has died ==> request resupply for it.
|
-- An asset has died ==> request resupply for it.
|
||||||
function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request)
|
function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request)
|
||||||
local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem
|
local asset=asset --Functional.Warehouse#WAREHOUSE.Assetitem
|
||||||
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
local request=request --Functional.Warehouse#WAREHOUSE.Pendingitem
|
||||||
|
|
||||||
-- Get assignment.
|
-- Get assignment.
|
||||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||||
|
|
||||||
-- Request resupply for dead asset from Batumi.
|
-- Request resupply for dead asset from Batumi.
|
||||||
warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply")
|
warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply")
|
||||||
|
|
||||||
-- Send asset to Battle zone either now or when they arrive.
|
-- Send asset to Battle zone either now or when they arrive.
|
||||||
warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment)
|
warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment)
|
||||||
end
|
end
|
||||||
|
|||||||
+18
-18
@@ -1,19 +1,19 @@
|
|||||||
-- This test mission demonstrates the RADIO class, particularily when the transmiter is anything but a UNIT or a GROUP (a STATIC in this case)
|
-- This test mission demonstrates the RADIO class, particularily when the transmiter is anything but a UNIT or a GROUP (a STATIC in this case)
|
||||||
-- The Player is in a Su25T parked on Batumi, and a Russian command center named "Russian Command Center" is placed 12km east of Batumi.
|
-- The Player is in a Su25T parked on Batumi, and a Russian command center named "Russian Command Center" is placed 12km east of Batumi.
|
||||||
|
|
||||||
-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important.
|
-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important.
|
||||||
-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here)
|
-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here)
|
||||||
|
|
||||||
CommandCenter = STATIC:FindByName("Russian Command Center")
|
CommandCenter = STATIC:FindByName("Russian Command Center")
|
||||||
|
|
||||||
-- Let's get a reference to the Command Center's RADIO
|
-- Let's get a reference to the Command Center's RADIO
|
||||||
CommandCenterRadio = CommandCenter:GetRadio()
|
CommandCenterRadio = CommandCenter:GetRadio()
|
||||||
|
|
||||||
-- Now, we'll set up the next transmission
|
-- Now, we'll set up the next transmission
|
||||||
CommandCenterRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound,
|
CommandCenterRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound,
|
||||||
CommandCenterRadio:SetFrequency(108) -- then a frequency in MHz,
|
CommandCenterRadio:SetFrequency(108) -- then a frequency in MHz,
|
||||||
CommandCenterRadio:SetModulation(radio.modulation.AM) -- a modulation (we use DCS' enumartion, this way we don't have to type numbers)...
|
CommandCenterRadio:SetModulation(radio.modulation.AM) -- a modulation (we use DCS' enumartion, this way we don't have to type numbers)...
|
||||||
CommandCenterRadio:SetPower(100) -- and finally a power in Watts. A "normal" ground TACAN station has a power of 120W.
|
CommandCenterRadio:SetPower(100) -- and finally a power in Watts. A "normal" ground TACAN station has a power of 120W.
|
||||||
|
|
||||||
-- We have finished tinkering with our transmission, now is the time to broadcast it !
|
-- We have finished tinkering with our transmission, now is the time to broadcast it !
|
||||||
CommandCenterRadio:Broadcast()
|
CommandCenterRadio:Broadcast()
|
||||||
+24
-24
@@ -1,25 +1,25 @@
|
|||||||
-- This test mission demonstrates the RADIO class, particularily when the transmiter is a UNIT or a GROUP
|
-- This test mission demonstrates the RADIO class, particularily when the transmiter is a UNIT or a GROUP
|
||||||
-- The Player is in a Su25T parked on Batumi, and a Russian MiG-29 creatively named "Sergey" is placed above Kobuleti and is
|
-- The Player is in a Su25T parked on Batumi, and a Russian MiG-29 creatively named "Sergey" is placed above Kobuleti and is
|
||||||
-- inbound for a landing on Batumi
|
-- inbound for a landing on Batumi
|
||||||
|
|
||||||
-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important.
|
-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important.
|
||||||
-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here)
|
-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here)
|
||||||
|
|
||||||
Sergey = UNIT:FindByName("Sergey")
|
Sergey = UNIT:FindByName("Sergey")
|
||||||
|
|
||||||
-- Let's get a reference to Sergey's RADIO
|
-- Let's get a reference to Sergey's RADIO
|
||||||
SergeyRadio = Sergey:GetRadio()
|
SergeyRadio = Sergey:GetRadio()
|
||||||
|
|
||||||
-- Now, we'll set up the next transmission
|
-- Now, we'll set up the next transmission
|
||||||
SergeyRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound,
|
SergeyRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound,
|
||||||
SergeyRadio:SetFrequency(108) -- then a frequency in MHz,
|
SergeyRadio:SetFrequency(108) -- then a frequency in MHz,
|
||||||
SergeyRadio:SetModulation(radio.modulation.AM) -- and a modulation (we use DCS' enumartion, this way we don't have to type numbers).
|
SergeyRadio:SetModulation(radio.modulation.AM) -- and a modulation (we use DCS' enumartion, this way we don't have to type numbers).
|
||||||
|
|
||||||
-- Since Sergey is a UNIT, we can add a subtitle (displayed on the top left) to the transmission, and loop the transmission
|
-- Since Sergey is a UNIT, we can add a subtitle (displayed on the top left) to the transmission, and loop the transmission
|
||||||
SergeyRadio:SetSubtitle("Hey, hear that noise ?", 5) -- The subtitle "Noise" will be displayed for 5 secs
|
SergeyRadio:SetSubtitle("Hey, hear that noise ?", 5) -- The subtitle "Noise" will be displayed for 5 secs
|
||||||
SergeyRadio:SetLoop(false)
|
SergeyRadio:SetLoop(false)
|
||||||
|
|
||||||
-- Notice that we didn't have to imput a power ? If the broadcater is a UNIT or a GROUP, DCS automatically guesses the power to use depending on the type of UNIT or GROUP
|
-- Notice that we didn't have to imput a power ? If the broadcater is a UNIT or a GROUP, DCS automatically guesses the power to use depending on the type of UNIT or GROUP
|
||||||
|
|
||||||
-- We have finished tinkering with our transmission, now is the time to broadcast it !
|
-- We have finished tinkering with our transmission, now is the time to broadcast it !
|
||||||
SergeyRadio:Broadcast()
|
SergeyRadio:Broadcast()
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user