mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2025-08-15 10:37:46 +00:00
Updated Moose.lua
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
--- Simple function scheduling
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. The log should contain a "Hello World" line that is fired off 10 seconds after mission start.
|
||||
--
|
||||
--
|
||||
-- # Status: TESTED - 12 Dec 2016
|
||||
|
||||
local TestScheduler = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Hello World 1")
|
||||
end, {}, 1
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Hello World 2")
|
||||
end, {}, 2
|
||||
)
|
||||
|
||||
collectgarbage()
|
||||
|
||||
--- Simple function scheduling
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. The log should contain a "Hello World" line that is fired off 10 seconds after mission start.
|
||||
--
|
||||
--
|
||||
-- # Status: TESTED - 12 Dec 2016
|
||||
|
||||
local TestScheduler = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Hello World 1")
|
||||
end, {}, 1
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Hello World 2")
|
||||
end, {}, 2
|
||||
)
|
||||
|
||||
collectgarbage()
|
||||
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
--- Simple Object Scheduling
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
--
|
||||
-- # Status: TESTED - 12 Dec 2016
|
||||
|
||||
local TEST_BASE = {
|
||||
ClassName = "TEST_BASE",
|
||||
}
|
||||
|
||||
function TEST_BASE:New( Message )
|
||||
self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
local TestScheduler = SCHEDULER:New( self,
|
||||
function( Object, Message )
|
||||
Object:E( Message )
|
||||
end, { Message }, 1
|
||||
)
|
||||
end
|
||||
|
||||
--- Simple Object Scheduling
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
--
|
||||
-- # Status: TESTED - 12 Dec 2016
|
||||
|
||||
local TEST_BASE = {
|
||||
ClassName = "TEST_BASE",
|
||||
}
|
||||
|
||||
function TEST_BASE:New( Message )
|
||||
self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
local TestScheduler = SCHEDULER:New( self,
|
||||
function( Object, Message )
|
||||
Object:E( Message )
|
||||
end, { Message }, 1
|
||||
)
|
||||
end
|
||||
|
||||
local Test = TEST_BASE:New( "Hello World" )
|
||||
@@ -1,24 +1,24 @@
|
||||
--- Simple repeat scheduling of a function.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
-- # 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.
|
||||
--
|
||||
--
|
||||
-- # Status: TESTED - 13 Dec 2016
|
||||
|
||||
local TestScheduler = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Hello World Repeat")
|
||||
end, {}, 1, 1
|
||||
--- Simple repeat scheduling of a function.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
-- # 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.
|
||||
--
|
||||
--
|
||||
-- # Status: TESTED - 13 Dec 2016
|
||||
|
||||
local TestScheduler = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Hello World Repeat")
|
||||
end, {}, 1, 1
|
||||
)
|
||||
@@ -1,44 +1,44 @@
|
||||
--- Object Repeat Scheduling.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
-- Three Test objects are created.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 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
|
||||
|
||||
local TEST_BASE = {
|
||||
ClassName = "TEST_BASE",
|
||||
}
|
||||
|
||||
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
|
||||
self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
self.TestScheduler = SCHEDULER:New( self,
|
||||
function( Object, Message )
|
||||
Object:E( Message )
|
||||
end, { Message }, Start, Repeat, Randomize, Stop
|
||||
)
|
||||
return self
|
||||
end
|
||||
|
||||
do
|
||||
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
|
||||
end
|
||||
|
||||
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 )
|
||||
--- Object Repeat Scheduling.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
-- Three Test objects are created.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 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
|
||||
|
||||
local TEST_BASE = {
|
||||
ClassName = "TEST_BASE",
|
||||
}
|
||||
|
||||
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
|
||||
self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
self.TestScheduler = SCHEDULER:New( self,
|
||||
function( Object, Message )
|
||||
Object:E( Message )
|
||||
end, { Message }, Start, Repeat, Randomize, Stop
|
||||
)
|
||||
return self
|
||||
end
|
||||
|
||||
do
|
||||
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
|
||||
end
|
||||
|
||||
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 )
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
--- Simple repeat scheduling of a function.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.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 20 seconds, TestScheduler will restart the scheduler.
|
||||
--
|
||||
-- # 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.
|
||||
--
|
||||
--
|
||||
-- # Status: TESTED - 14 Dec 2016
|
||||
|
||||
local TestScheduler = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( timer.getTime() .. " - Hello World Repeat")
|
||||
end, {}, 1, 1
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
TestScheduler:Stop()
|
||||
end, {}, 10
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
TestScheduler:Start()
|
||||
end, {}, 20
|
||||
)
|
||||
--- Simple repeat scheduling of a function.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.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 20 seconds, TestScheduler will restart the scheduler.
|
||||
--
|
||||
-- # 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.
|
||||
--
|
||||
--
|
||||
-- # Status: TESTED - 14 Dec 2016
|
||||
|
||||
local TestScheduler = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( timer.getTime() .. " - Hello World Repeat")
|
||||
end, {}, 1, 1
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
TestScheduler:Stop()
|
||||
end, {}, 10
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
TestScheduler:Start()
|
||||
end, {}, 20
|
||||
)
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
--- No Object Scheduling because of garbage collect and Object nillification.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
-- A Test object is created.
|
||||
-- It is nillified directly after the Schedule has been planned.
|
||||
-- There should be no schedule fired.
|
||||
-- The Test object should be garbage collected!
|
||||
--
|
||||
-- THIS IS A VERY IMPORTANT TEST!
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- The schedule should now be fired and Hello World should be logged through the Test object.
|
||||
--
|
||||
-- # Status: STARTED - 12 Dec 2016
|
||||
|
||||
local TEST_BASE = {
|
||||
ClassName = "TEST_BASE",
|
||||
}
|
||||
|
||||
function TEST_BASE:New( Message )
|
||||
self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
self.TestScheduler = SCHEDULER:New( self,
|
||||
function( Object, Message )
|
||||
Object:E( Message )
|
||||
end, { Message }, 1
|
||||
)
|
||||
return self
|
||||
end
|
||||
|
||||
do
|
||||
local Test1 = TEST_BASE:New( "Hello World Test 1" )
|
||||
Test1 = nil
|
||||
BASE:E( Test1 )
|
||||
end
|
||||
|
||||
local Test2 = TEST_BASE:New( "Hello World Test 2" )
|
||||
BASE:E( Test2 )
|
||||
|
||||
local Test3 = TEST_BASE:New( "Hello World Test 3" )
|
||||
Test3 = nil
|
||||
BASE:E( Test3 )
|
||||
|
||||
collectgarbage()
|
||||
|
||||
BASE:E( "Collect Garbage executed." )
|
||||
BASE:E( "You should only see a Hello Worlld message for Test 2!" )
|
||||
--- No Object Scheduling because of garbage collect and Object nillification.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 12 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
-- A Test object is created.
|
||||
-- It is nillified directly after the Schedule has been planned.
|
||||
-- There should be no schedule fired.
|
||||
-- The Test object should be garbage collected!
|
||||
--
|
||||
-- THIS IS A VERY IMPORTANT TEST!
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- The schedule should now be fired and Hello World should be logged through the Test object.
|
||||
--
|
||||
-- # Status: STARTED - 12 Dec 2016
|
||||
|
||||
local TEST_BASE = {
|
||||
ClassName = "TEST_BASE",
|
||||
}
|
||||
|
||||
function TEST_BASE:New( Message )
|
||||
self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
self.TestScheduler = SCHEDULER:New( self,
|
||||
function( Object, Message )
|
||||
Object:E( Message )
|
||||
end, { Message }, 1
|
||||
)
|
||||
return self
|
||||
end
|
||||
|
||||
do
|
||||
local Test1 = TEST_BASE:New( "Hello World Test 1" )
|
||||
Test1 = nil
|
||||
BASE:E( Test1 )
|
||||
end
|
||||
|
||||
local Test2 = TEST_BASE:New( "Hello World Test 2" )
|
||||
BASE:E( Test2 )
|
||||
|
||||
local Test3 = TEST_BASE:New( "Hello World Test 3" )
|
||||
Test3 = nil
|
||||
BASE:E( Test3 )
|
||||
|
||||
collectgarbage()
|
||||
|
||||
BASE:E( "Collect Garbage executed." )
|
||||
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!" )
|
||||
@@ -1,80 +1,80 @@
|
||||
--- Object Repeat Scheduling.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Three objects Test1, Test2, Test 3 are created with schedule a function.
|
||||
-- After 15 seconds, Test1 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.
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
--
|
||||
-- Three Test objects are created.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 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.
|
||||
-- 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.
|
||||
--
|
||||
-- # Status: TESTED - 13 Dec 2016
|
||||
|
||||
local TEST_BASE = {
|
||||
ClassName = "TEST_BASE",
|
||||
}
|
||||
|
||||
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
|
||||
self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
self.TestScheduler = SCHEDULER:New( self,
|
||||
function( Object, Message )
|
||||
Object:E( Message )
|
||||
end, { Message }, Start, Repeat, Randomize, Stop
|
||||
)
|
||||
return self
|
||||
end
|
||||
|
||||
do
|
||||
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
|
||||
|
||||
-- Nillify Test1 after 15 seconds and garbage collect.
|
||||
local Nil1 = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Nillify Test1 and Garbage Collect" )
|
||||
Test1 = nil
|
||||
collectgarbage()
|
||||
end, {}, 15 )
|
||||
|
||||
end
|
||||
|
||||
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 )
|
||||
|
||||
-- Nillify Test2 after 30 seconds and garbage collect.
|
||||
local Nil2 = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Nillify Test2 and Garbage Collect" )
|
||||
Test2 = nil
|
||||
collectgarbage()
|
||||
end, {}, 30 )
|
||||
|
||||
-- Nillify Test3 after 45 seconds and garbage collect.
|
||||
local Nil3 = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Nillify Test3 and Garbage Collect" )
|
||||
Test3 = nil
|
||||
collectgarbage()
|
||||
end, {}, 45 )
|
||||
|
||||
collectgarbage()
|
||||
--- Object Repeat Scheduling.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Dec 2016
|
||||
--
|
||||
-- # Situation
|
||||
-- Three objects Test1, Test2, Test 3 are created with schedule a function.
|
||||
-- After 15 seconds, Test1 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.
|
||||
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
|
||||
-- Create a new SCHEDULER object.
|
||||
-- Check the DCS.log.
|
||||
--
|
||||
--
|
||||
-- Three Test objects are created.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 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.
|
||||
-- 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.
|
||||
--
|
||||
-- # Status: TESTED - 13 Dec 2016
|
||||
|
||||
local TEST_BASE = {
|
||||
ClassName = "TEST_BASE",
|
||||
}
|
||||
|
||||
function TEST_BASE:New( Message, Start, Repeat, Randomize, Stop )
|
||||
self = BASE:Inherit( self, BASE:New() )
|
||||
|
||||
self.TestScheduler = SCHEDULER:New( self,
|
||||
function( Object, Message )
|
||||
Object:E( Message )
|
||||
end, { Message }, Start, Repeat, Randomize, Stop
|
||||
)
|
||||
return self
|
||||
end
|
||||
|
||||
do
|
||||
local Test1 = TEST_BASE:New( "Hello World Repeat 1", 1, 1 )
|
||||
|
||||
-- Nillify Test1 after 15 seconds and garbage collect.
|
||||
local Nil1 = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Nillify Test1 and Garbage Collect" )
|
||||
Test1 = nil
|
||||
collectgarbage()
|
||||
end, {}, 15 )
|
||||
|
||||
end
|
||||
|
||||
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 )
|
||||
|
||||
-- Nillify Test2 after 30 seconds and garbage collect.
|
||||
local Nil2 = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Nillify Test2 and Garbage Collect" )
|
||||
Test2 = nil
|
||||
collectgarbage()
|
||||
end, {}, 30 )
|
||||
|
||||
-- Nillify Test3 after 45 seconds and garbage collect.
|
||||
local Nil3 = SCHEDULER:New( nil,
|
||||
function()
|
||||
BASE:E( "Nillify Test3 and Garbage Collect" )
|
||||
Test3 = nil
|
||||
collectgarbage()
|
||||
end, {}, 45 )
|
||||
|
||||
collectgarbage()
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
|
||||
BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart()
|
||||
|
||||
RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart()
|
||||
|
||||
RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart()
|
||||
|
||||
BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart()
|
||||
|
||||
BlueAirbaseSet:Flush()
|
||||
|
||||
RedAirbaseSet:Flush()
|
||||
|
||||
RedAirbaseHelipadSet:Flush()
|
||||
|
||||
|
||||
BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart()
|
||||
|
||||
RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart()
|
||||
|
||||
RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart()
|
||||
|
||||
BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart()
|
||||
|
||||
BlueAirbaseSet:Flush()
|
||||
|
||||
RedAirbaseSet:Flush()
|
||||
|
||||
RedAirbaseHelipadSet:Flush()
|
||||
|
||||
BlueAirbaseShipSet:Flush()
|
||||
@@ -1,34 +1,34 @@
|
||||
---
|
||||
-- Name: SET-102 - Test SET_GROUP object against ZONE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 31 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, and the SET_GROUP object is checked against the zone.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone.
|
||||
-- 2. Observe the results of the functions.
|
||||
|
||||
|
||||
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
|
||||
|
||||
Zone = ZONE:New( "Zone" )
|
||||
|
||||
SetGroupObject:ForEachGroupCompletelyInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } )
|
||||
end )
|
||||
|
||||
SetGroupObject:ForEachGroupPartlyInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } )
|
||||
end )
|
||||
|
||||
SetGroupObject:ForEachGroupNotInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } )
|
||||
end )
|
||||
|
||||
---
|
||||
-- Name: SET-102 - Test SET_GROUP object against ZONE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 31 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, and the SET_GROUP object is checked against the zone.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone.
|
||||
-- 2. Observe the results of the functions.
|
||||
|
||||
|
||||
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
|
||||
|
||||
Zone = ZONE:New( "Zone" )
|
||||
|
||||
SetGroupObject:ForEachGroupCompletelyInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } )
|
||||
end )
|
||||
|
||||
SetGroupObject:ForEachGroupPartlyInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } )
|
||||
end )
|
||||
|
||||
SetGroupObject:ForEachGroupNotInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } )
|
||||
end )
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
---
|
||||
-- Name: ZON-103 - Test if GROUP object is in ZONE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 31 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, and it is checked if a GROUP object is within the zone.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone.
|
||||
-- 2. Observe the results of the functions.
|
||||
|
||||
|
||||
GroupObject = GROUP:FindByName( "Group Object" )
|
||||
|
||||
Zone = ZONE:New( "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 not in Zone:", GroupObject:IsNotInZone( Zone ) } )
|
||||
|
||||
---
|
||||
-- Name: ZON-103 - Test if GROUP object is in ZONE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 31 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, and it is checked if a GROUP object is within the zone.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone.
|
||||
-- 2. Observe the results of the functions.
|
||||
|
||||
|
||||
GroupObject = GROUP:FindByName( "Group Object" )
|
||||
|
||||
Zone = ZONE:New( "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 not in Zone:", GroupObject:IsNotInZone( Zone ) } )
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
-- Name: SET-103 - Test SET_GROUP players added and deleted
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 31 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Multiple groups of ground vehicles have been defined.
|
||||
-- There are collected in a SET_GROUP.
|
||||
-- A human player is jumping into the seat on one of these vehicles of the SET_GROUP.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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()
|
||||
---
|
||||
-- Name: SET-103 - Test SET_GROUP players added and deleted
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 31 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Multiple groups of ground vehicles have been defined.
|
||||
-- There are collected in a SET_GROUP.
|
||||
-- A human player is jumping into the seat on one of these vehicles of the SET_GROUP.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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()
|
||||
|
||||
@@ -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:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
||||
|
||||
SetVehicles:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeGreen()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
|
||||
SetBluePlanesGroup = SET_GROUP:New()
|
||||
:FilterCoalitions( "blue" )
|
||||
:FilterCategories( "plane" )
|
||||
:FilterStart()
|
||||
|
||||
SetNorthKoreaGroup = SET_GROUP:New()
|
||||
:FilterCountries( "RUSSIA" )
|
||||
:FilterStart()
|
||||
|
||||
SetSAMGroup = SET_GROUP:New()
|
||||
:FilterPrefixes( "SAM" )
|
||||
:FilterStart()
|
||||
:SetIteratorIntervals( 5, 10 )
|
||||
|
||||
SetGroundGroup = SET_GROUP:New()
|
||||
:FilterCategories( "ground" )
|
||||
:FilterStart()
|
||||
|
||||
SetGroundGroup:Flush()
|
||||
|
||||
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
|
||||
GroupUS_Plane = SpawnUS_Plane:Spawn()
|
||||
|
||||
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
|
||||
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
|
||||
|
||||
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
|
||||
GroupUS_Ship = SpawnUS_Ship:Spawn()
|
||||
|
||||
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
|
||||
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
|
||||
|
||||
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
|
||||
GroupRU_Ship = SpawnRU_Ship:Spawn()
|
||||
|
||||
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 )
|
||||
|
||||
for i = 1, 30 do
|
||||
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||
end
|
||||
|
||||
SetVehicleCompletely = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
|
||||
:FilterStart()
|
||||
|
||||
SetVehiclePartly = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
|
||||
:FilterStart()
|
||||
|
||||
SetVehicleNot = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Not" )
|
||||
:FilterStart()
|
||||
|
||||
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_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
|
||||
for i = 1, 30 do
|
||||
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
|
||||
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
|
||||
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
|
||||
end
|
||||
|
||||
--DBBlue:TraceDatabase()
|
||||
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
|
||||
--
|
||||
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
||||
|
||||
SetBluePlanesGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetNorthKoreaGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeRed()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetSAMGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeOrange()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
|
||||
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
|
||||
GroupZoneNot = GROUP:FindByName( "Zone Not" )
|
||||
|
||||
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
|
||||
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
|
||||
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
|
||||
|
||||
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
SetVehicles = SET_GROUP:New()
|
||||
|
||||
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
||||
|
||||
SetVehicles:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeGreen()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
|
||||
SetBluePlanesGroup = SET_GROUP:New()
|
||||
:FilterCoalitions( "blue" )
|
||||
:FilterCategories( "plane" )
|
||||
:FilterStart()
|
||||
|
||||
SetNorthKoreaGroup = SET_GROUP:New()
|
||||
:FilterCountries( "RUSSIA" )
|
||||
:FilterStart()
|
||||
|
||||
SetSAMGroup = SET_GROUP:New()
|
||||
:FilterPrefixes( "SAM" )
|
||||
:FilterStart()
|
||||
:SetIteratorIntervals( 5, 10 )
|
||||
|
||||
SetGroundGroup = SET_GROUP:New()
|
||||
:FilterCategories( "ground" )
|
||||
:FilterStart()
|
||||
|
||||
SetGroundGroup:Flush()
|
||||
|
||||
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
|
||||
GroupUS_Plane = SpawnUS_Plane:Spawn()
|
||||
|
||||
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
|
||||
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
|
||||
|
||||
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
|
||||
GroupUS_Ship = SpawnUS_Ship:Spawn()
|
||||
|
||||
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
|
||||
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
|
||||
|
||||
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
|
||||
GroupRU_Ship = SpawnRU_Ship:Spawn()
|
||||
|
||||
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 )
|
||||
|
||||
for i = 1, 30 do
|
||||
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||
end
|
||||
|
||||
SetVehicleCompletely = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
|
||||
:FilterStart()
|
||||
|
||||
SetVehiclePartly = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
|
||||
:FilterStart()
|
||||
|
||||
SetVehicleNot = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Not" )
|
||||
:FilterStart()
|
||||
|
||||
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_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
|
||||
for i = 1, 30 do
|
||||
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
|
||||
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
|
||||
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
|
||||
end
|
||||
|
||||
--DBBlue:TraceDatabase()
|
||||
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
|
||||
--
|
||||
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
||||
|
||||
SetBluePlanesGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetNorthKoreaGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeRed()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetSAMGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeOrange()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
|
||||
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
|
||||
GroupZoneNot = GROUP:FindByName( "Zone Not" )
|
||||
|
||||
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
|
||||
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
|
||||
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
|
||||
|
||||
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
@@ -1,163 +1,163 @@
|
||||
|
||||
|
||||
|
||||
|
||||
SetVehicles = SET_GROUP:New()
|
||||
|
||||
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
||||
|
||||
SetVehicles:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeGreen()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
|
||||
SetBluePlanesGroup = SET_GROUP:New()
|
||||
:FilterCoalitions( "blue" )
|
||||
:FilterCategories( "plane" )
|
||||
:FilterStart()
|
||||
|
||||
SetNorthKoreaGroup = SET_GROUP:New()
|
||||
:FilterCountries( "RUSSIA" )
|
||||
:FilterStart()
|
||||
|
||||
SetSAMGroup = SET_GROUP:New()
|
||||
:FilterPrefixes( "SAM" )
|
||||
:FilterStart()
|
||||
:SetIteratorIntervals( 5, 10 )
|
||||
|
||||
SetGroundGroup = SET_GROUP:New()
|
||||
:FilterCategories( "ground" )
|
||||
:FilterStart()
|
||||
|
||||
SetGroundGroup:Flush()
|
||||
|
||||
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
|
||||
GroupUS_Plane = SpawnUS_Plane:Spawn()
|
||||
|
||||
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
|
||||
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
|
||||
|
||||
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
|
||||
GroupUS_Ship = SpawnUS_Ship:Spawn()
|
||||
|
||||
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
|
||||
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
|
||||
|
||||
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
|
||||
GroupRU_Ship = SpawnRU_Ship:Spawn()
|
||||
|
||||
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 )
|
||||
|
||||
for i = 1, 30 do
|
||||
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||
end
|
||||
|
||||
SetVehicleCompletely = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
|
||||
:FilterStart()
|
||||
|
||||
SetVehiclePartly = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
|
||||
:FilterStart()
|
||||
|
||||
SetVehicleNot = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Not" )
|
||||
:FilterStart()
|
||||
|
||||
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_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
|
||||
for i = 1, 30 do
|
||||
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
|
||||
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
|
||||
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
|
||||
end
|
||||
|
||||
--DBBlue:TraceDatabase()
|
||||
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
|
||||
--
|
||||
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
||||
|
||||
SetBluePlanesGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetNorthKoreaGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeRed()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetSAMGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeOrange()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
|
||||
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
|
||||
GroupZoneNot = GROUP:FindByName( "Zone Not" )
|
||||
|
||||
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
|
||||
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
|
||||
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
|
||||
|
||||
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
SetVehicles = SET_GROUP:New()
|
||||
|
||||
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
|
||||
|
||||
SetVehicles:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeGreen()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
|
||||
SetBluePlanesGroup = SET_GROUP:New()
|
||||
:FilterCoalitions( "blue" )
|
||||
:FilterCategories( "plane" )
|
||||
:FilterStart()
|
||||
|
||||
SetNorthKoreaGroup = SET_GROUP:New()
|
||||
:FilterCountries( "RUSSIA" )
|
||||
:FilterStart()
|
||||
|
||||
SetSAMGroup = SET_GROUP:New()
|
||||
:FilterPrefixes( "SAM" )
|
||||
:FilterStart()
|
||||
:SetIteratorIntervals( 5, 10 )
|
||||
|
||||
SetGroundGroup = SET_GROUP:New()
|
||||
:FilterCategories( "ground" )
|
||||
:FilterStart()
|
||||
|
||||
SetGroundGroup:Flush()
|
||||
|
||||
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
|
||||
GroupUS_Plane = SpawnUS_Plane:Spawn()
|
||||
|
||||
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
|
||||
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
|
||||
|
||||
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
|
||||
GroupUS_Ship = SpawnUS_Ship:Spawn()
|
||||
|
||||
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
|
||||
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
|
||||
|
||||
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
|
||||
GroupRU_Ship = SpawnRU_Ship:Spawn()
|
||||
|
||||
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 )
|
||||
|
||||
for i = 1, 30 do
|
||||
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
|
||||
end
|
||||
|
||||
SetVehicleCompletely = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
|
||||
:FilterStart()
|
||||
|
||||
SetVehiclePartly = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
|
||||
:FilterStart()
|
||||
|
||||
SetVehicleNot = SET_GROUP:New()
|
||||
:FilterPrefixes( "Spawn Vehicle Zone Not" )
|
||||
:FilterStart()
|
||||
|
||||
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_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
|
||||
for i = 1, 30 do
|
||||
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
|
||||
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
|
||||
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
|
||||
end
|
||||
|
||||
--DBBlue:TraceDatabase()
|
||||
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
|
||||
--
|
||||
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
|
||||
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
|
||||
|
||||
SetBluePlanesGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetNorthKoreaGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeRed()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetSAMGroup:ForEachGroup(
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeOrange()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
|
||||
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
|
||||
GroupZoneNot = GROUP:FindByName( "Zone Not" )
|
||||
|
||||
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
|
||||
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
|
||||
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
|
||||
|
||||
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
|
||||
--- @param Wrapper.Group#GROUP MooseGroup
|
||||
function( MooseGroup )
|
||||
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
|
||||
local UnitAction = UnitData -- Wrapper.Unit#UNIT
|
||||
UnitAction:SmokeBlue()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-- The mission contains templates, which are late activated groups. Only the active groups should be included.
|
||||
-- It should count 3 groups in DCS.log.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
|
||||
SetGroup:Flush()
|
||||
SetGroup:I( { Count = SetGroup:Count() } )
|
||||
|
||||
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()
|
||||
-- The mission contains templates, which are late activated groups. Only the active groups should be included.
|
||||
-- It should count 3 groups in DCS.log.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
|
||||
SetGroup:Flush()
|
||||
SetGroup:I( { Count = SetGroup:Count() } )
|
||||
|
||||
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-- The mission contains templates, which are late activated groups. All groups should be included.
|
||||
-- It should count 7 groups in DCS.log.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||
SetGroup:Flush()
|
||||
SetGroup:I( { Count = SetGroup:Count() } )
|
||||
|
||||
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()
|
||||
-- The mission contains templates, which are late activated groups. All groups should be included.
|
||||
-- It should count 7 groups in DCS.log.
|
||||
|
||||
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||
SetGroup:Flush()
|
||||
SetGroup:I( { Count = SetGroup:Count() } )
|
||||
|
||||
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:Flush()
|
||||
|
||||
SetUnit:I(SetUnit:Count())
|
||||
|
||||
|
||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||
|
||||
SetUnit:Flush()
|
||||
|
||||
SetUnit:I(SetUnit:Count())
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
|
||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||
SetUnit:Flush()
|
||||
SetUnit:I( { Count = SetUnit:Count() } )
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||
SetUnit:Flush()
|
||||
SetUnit:I( { Count = SetUnit:Count() } )
|
||||
end, {}, 60 )
|
||||
|
||||
|
||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||
SetUnit:Flush()
|
||||
SetUnit:I( { Count = SetUnit:Count() } )
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||
SetUnit:Flush()
|
||||
SetUnit:I( { Count = SetUnit:Count() } )
|
||||
end, {}, 60 )
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||
SetUnit:Flush()
|
||||
SetUnit:I( { Count = SetUnit:Count() } )
|
||||
end, {}, 0, 30 )
|
||||
|
||||
GroupPlanes = GROUP:FindByName( "Planes #001" )
|
||||
|
||||
GroupPlanes:HandleEvent( EVENTS.EngineShutdown )
|
||||
|
||||
function GroupPlanes:OnEventEngineShutdown( EventData )
|
||||
|
||||
EventData.IniUnit:Destroy()
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
|
||||
SetUnit:Flush()
|
||||
SetUnit:I( { Count = SetUnit:Count() } )
|
||||
end, {}, 0, 30 )
|
||||
|
||||
GroupPlanes = GROUP:FindByName( "Planes #001" )
|
||||
|
||||
GroupPlanes:HandleEvent( EVENTS.EngineShutdown )
|
||||
|
||||
function GroupPlanes:OnEventEngineShutdown( EventData )
|
||||
|
||||
EventData.IniUnit:Destroy()
|
||||
|
||||
end
|
||||
@@ -1,8 +1,8 @@
|
||||
-- The mission contains templates, which are late activated groups. Only the active units should be included.
|
||||
-- It should count 24 units in DCS.log.
|
||||
|
||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
|
||||
SetUnit:Flush()
|
||||
SetUnit:I( { Count = SetUnit:Count() } )
|
||||
|
||||
MESSAGE:NewType( "There are " .. SetUnit:Count() .. " units in the SetUnit.", MESSAGE.Type.Information ):ToAll()
|
||||
-- The mission contains templates, which are late activated groups. Only the active units should be included.
|
||||
-- It should count 24 units in DCS.log.
|
||||
|
||||
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
|
||||
SetUnit:Flush()
|
||||
SetUnit:I( { Count = SetUnit:Count() } )
|
||||
|
||||
MESSAGE:NewType( "There are " .. SetUnit:Count() .. " units in the SetUnit.", MESSAGE.Type.Information ):ToAll()
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
-- Name: SPA-011 - Ground Ops - Simple Spawning
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn a ground vehicle.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicle is spawned.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Spawn a gound vehicle...
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||
|
||||
|
||||
|
||||
-- Name: SPA-011 - Ground Ops - Simple Spawning
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn a ground vehicle.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicle is spawned.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Spawn a gound vehicle...
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
-- Name: SPA-012 - Ground Ops - Multiple Spawns
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Spawn a gound vehicle...
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_2 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_3 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_4 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_5 = Spawn_Vehicle_1:Spawn()
|
||||
|
||||
|
||||
|
||||
-- Name: SPA-012 - Ground Ops - Multiple Spawns
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicles are spawned at the position declared within the mission editor.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Spawn a gound vehicle...
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_2 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_3 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_4 = Spawn_Vehicle_1:Spawn()
|
||||
Spawn_Group_5 = Spawn_Vehicle_1:Spawn()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
-- Name: SPA-013 - Ground Ops - Scheduled Spawns
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 )
|
||||
|
||||
|
||||
|
||||
|
||||
-- Name: SPA-013 - Ground Ops - Scheduled Spawns
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
-- Name: SPA-014 - Ground Ops - Scheduled Spawns Limited
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 3. There should not be more than 5 groups spawned.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 5, 0 ):SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
-- Name: SPA-014 - Ground Ops - Scheduled Spawns Limited
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 3. There should not be more than 5 groups spawned.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 5, 0 ):SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
-- Name: SPA-015 - Ground Ops - Randomize Route
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
: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.
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
|
||||
|
||||
-- Name: SPA-015 - Ground Ops - Randomize Route
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
: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.
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
-- Name: SPA-016 - Ground Ops - Randomize Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 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.
|
||||
-- 5. Observe that the position where the units are spawned, is randomized according the zones.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 10, 10 )
|
||||
:InitRandomizeRoute( 1, 1, 200 )
|
||||
:InitRandomizeZones( ZoneTable )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
-- Name: SPA-016 - Ground Ops - Randomize Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 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.
|
||||
-- 5. Observe that the position where the units are spawned, is randomized according the zones.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 10, 10 )
|
||||
:InitRandomizeRoute( 1, 1, 200 )
|
||||
:InitRandomizeZones( ZoneTable )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
-- Name: SPA-017 - Ground Ops - Set AI inactive while spawning
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
-- But set the AI inactive when spawning.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 3. There should not be more than 5 groups spawned.
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 10, 10 )
|
||||
:InitRandomizeRoute( 1, 1, 200 )
|
||||
: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().
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
-- Name: SPA-017 - Ground Ops - Set AI inactive while spawning
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
-- But set the AI inactive when spawning.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 3. There should not be more than 5 groups spawned.
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 10, 10 )
|
||||
:InitRandomizeRoute( 1, 1, 200 )
|
||||
: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().
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
---
|
||||
-- Name: SPA-018 - Ground Ops - Randomize Templates
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicles are spawned with randomized templates.
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
TemplateTable = { "A", "B", "C" }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 10, 10 )
|
||||
:InitRandomizeRoute( 1, 1, 200 )
|
||||
:InitRandomizeTemplate( TemplateTable )
|
||||
--:InitRandomizeZones( ZoneTable )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
---
|
||||
-- Name: SPA-018 - Ground Ops - Randomize Templates
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicles are spawned with randomized templates.
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
TemplateTable = { "A", "B", "C" }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 10, 10 )
|
||||
:InitRandomizeRoute( 1, 1, 200 )
|
||||
:InitRandomizeTemplate( TemplateTable )
|
||||
--:InitRandomizeZones( ZoneTable )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
---
|
||||
-- Name: SPA-019 - Ground Ops - Randomize Templates with Waypoints
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
TemplateTable = { "A", "B", "C" }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 10, 10 )
|
||||
:InitRandomizeTemplate( TemplateTable )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
---
|
||||
-- Name: SPA-019 - Ground Ops - Randomize Templates with Waypoints
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
TemplateTable = { "A", "B", "C" }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 10, 10 )
|
||||
:InitRandomizeTemplate( TemplateTable )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
---
|
||||
-- Name: SPA-020 - Ground Ops - Randomize Templates in Random Zones without Waypoints
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 3. Observe that the ground vehicles are spread over the random zones, and that the initial templates formations are kept.
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
TemplateTable = { "A", "B", "C" }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 100, 10 )
|
||||
:InitRandomizeTemplate( TemplateTable )
|
||||
:InitRandomizeZones( ZoneTable )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
---
|
||||
-- Name: SPA-020 - Ground Ops - Randomize Templates in Random Zones without Waypoints
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 24 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 3. Observe that the ground vehicles are spread over the random zones, and that the initial templates formations are kept.
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Create a zone table of the 2 zones.
|
||||
ZoneTable = { ZONE:New( "Zone1" ), ZONE:New( "Zone2" ) }
|
||||
|
||||
TemplateTable = { "A", "B", "C" }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
:InitLimit( 100, 10 )
|
||||
:InitRandomizeTemplate( TemplateTable )
|
||||
:InitRandomizeZones( ZoneTable )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
---
|
||||
-- Name: SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN
|
||||
:New( "Spawn Vehicle 1" )
|
||||
:InitKeepUnitNames()
|
||||
:InitLimit( 5, 10 )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
---
|
||||
-- Name: SPA-021 - Ground Ops - Scheduled Spawns Limited Keep Unit Names
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN
|
||||
:New( "Spawn Vehicle 1" )
|
||||
:InitKeepUnitNames()
|
||||
:InitLimit( 5, 10 )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
-- Name: SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
-- The vehicle should respawn when killed.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 1, 0 ):SpawnScheduled( 30, .5 )
|
||||
|
||||
|
||||
|
||||
|
||||
-- Name: SPA-022 - Ground Ops - Scheduled Spawns Limited with long interval
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
-- The vehicle should respawn when killed.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" ):InitLimit( 1, 0 ):SpawnScheduled( 30, .5 )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
---
|
||||
-- Name: SPA-023 - Ground Ops - SpawnStart and SpawnStop
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
-- The schedule is immediately stopped and started.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ):SpawnScheduleStop()
|
||||
|
||||
Spawn_Vehicle:SpawnScheduleStart()
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: SPA-023 - Ground Ops - SpawnStart and SpawnStop
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Jan 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in a scheduled fashion.
|
||||
-- The schedule is immediately stopped and started.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle = SPAWN:New( "Spawn Vehicle 1" ):SpawnScheduled( 10, 0.5 ):SpawnScheduleStop()
|
||||
|
||||
Spawn_Vehicle:SpawnScheduleStart()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
---
|
||||
-- Name: SPA-024 - Ground Ops - Arrays
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 19 Jul 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in an array.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle = SPAWN
|
||||
:New( "Spawn Vehicles" )
|
||||
:InitLimit( 12, 60 )
|
||||
:InitArray( 90, 10, 10, 10 )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: SPA-024 - Ground Ops - Arrays
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 19 Jul 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in an array.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle = SPAWN
|
||||
:New( "Spawn Vehicles" )
|
||||
:InitLimit( 12, 60 )
|
||||
:InitArray( 90, 10, 10, 10 )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
---
|
||||
-- Name: SPA-024 - Ground Ops - Arrays
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 19 Jul 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in an array.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle = SPAWN
|
||||
:New( "Spawn Vehicles" )
|
||||
:InitLimit( 12, 60 )
|
||||
:InitArray( 90, 10, 10, 10 )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: SPA-024 - Ground Ops - Arrays
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 19 Jul 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn multiple ground vehicles, in an array.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 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.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
Spawn_Vehicle = SPAWN
|
||||
:New( "Spawn Vehicles" )
|
||||
:InitLimit( 12, 60 )
|
||||
:InitArray( 90, 10, 10, 10 )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
-- Name: SPA-025 - Ground Ops - Spawn Hidden
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 06 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn a ground vehicle, hidden
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicle is spawned and his hidden.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Spawn a gound vehicle...
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||
|
||||
|
||||
|
||||
-- Name: SPA-025 - Ground Ops - Spawn Hidden
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 06 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn a ground vehicle, hidden
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the ground vehicle is spawned and his hidden.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Spawn a gound vehicle...
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Spawn Vehicle 1" )
|
||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
-- Name: SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 06 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn a ground vehicle, hidden, based on a randomized template.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that a random ground vehicle is spawned and his hidden.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Spawn a gound vehicle...
|
||||
|
||||
Templates = { "A", "B" }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Vehicle" )
|
||||
Spawn_Vehicle_1:InitRandomizeTemplate( Templates )
|
||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||
|
||||
|
||||
|
||||
-- Name: SPA-026 - Ground Ops - Spawn RandomizeTemplate Hidden
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 06 Sep 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn a ground vehicle, hidden, based on a randomized template.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that a random ground vehicle is spawned and his hidden.
|
||||
|
||||
|
||||
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Spawn a gound vehicle...
|
||||
|
||||
Templates = { "A", "B" }
|
||||
|
||||
Spawn_Vehicle_1 = SPAWN:New( "Vehicle" )
|
||||
Spawn_Vehicle_1:InitRandomizeTemplate( Templates )
|
||||
Spawn_Group_1 = Spawn_Vehicle_1:Spawn()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
-- Name: SPA-027 - Ground Ops - Respawning After Destroy
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Dec 2017
|
||||
--
|
||||
-- At Gudauta spawns ground vehicle, in a scheduled fashion.
|
||||
-- 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.
|
||||
-- Until that one is also destroyed.
|
||||
--
|
||||
-- Red is attacking the spawned blue vehicles.
|
||||
-- Once blue is destroyed, a new blue needs to spawn.
|
||||
-- Until all 10 blue vehicles are spawned.
|
||||
-- The position of blue is randomized in the zone.
|
||||
-- Blue has ROE hold weapons.
|
||||
--
|
||||
|
||||
|
||||
BlueVehicleSpawn = SPAWN
|
||||
:New( "Tank" )
|
||||
:InitLimit( 2, 10 )
|
||||
:InitRandomizePosition( true, 200, 50 )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
|
||||
-- Name: SPA-027 - Ground Ops - Respawning After Destroy
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 10 Dec 2017
|
||||
--
|
||||
-- At Gudauta spawns ground vehicle, in a scheduled fashion.
|
||||
-- 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.
|
||||
-- Until that one is also destroyed.
|
||||
--
|
||||
-- Red is attacking the spawned blue vehicles.
|
||||
-- Once blue is destroyed, a new blue needs to spawn.
|
||||
-- Until all 10 blue vehicles are spawned.
|
||||
-- The position of blue is randomized in the zone.
|
||||
-- Blue has ROE hold weapons.
|
||||
--
|
||||
|
||||
|
||||
BlueVehicleSpawn = SPAWN
|
||||
:New( "Tank" )
|
||||
:InitLimit( 2, 10 )
|
||||
:InitRandomizePosition( true, 200, 50 )
|
||||
:SpawnScheduled( 5, .5 )
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-- Tests Kutaisi
|
||||
-- -------------
|
||||
-- Tests the CleanUp functionality.
|
||||
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
|
||||
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
|
||||
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):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 )
|
||||
|
||||
-- Tests Kutaisi
|
||||
-- -------------
|
||||
-- Tests the CleanUp functionality.
|
||||
-- Limited spawning of groups, scheduled every 10 seconds, who are engaging into combat. Some helicopters may crash land on the ground.
|
||||
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
|
||||
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):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 )
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Limited scheduled spawning of groups...
|
||||
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_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 90, 0 )
|
||||
|
||||
---
|
||||
-- Tests Sukhumi
|
||||
-- -------------
|
||||
-- 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_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 )
|
||||
|
||||
|
||||
---
|
||||
-- Tests Gudauta
|
||||
-- -------------
|
||||
-- Limited scheduled spawning of groups...
|
||||
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_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):InitLimit( 4, 20 ):SpawnScheduled( 90, 0 )
|
||||
|
||||
---
|
||||
-- Tests Sukhumi
|
||||
-- -------------
|
||||
-- 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_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 )
|
||||
|
||||
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
---
|
||||
-- Name: SPA-120 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 05 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- One airplane and one helicopter will be spawned.
|
||||
-- Only one airplane and one helicopter can be alive at the same time.
|
||||
-- Upon landing, the airplane and helicopter will respawn at Kutaisi.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the spawning of the airplane and helicopter
|
||||
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
||||
-- 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.
|
||||
|
||||
|
||||
do
|
||||
|
||||
-- Declare SPAWN objects
|
||||
Spawn_Plane = SPAWN:New("Plane"):InitLimit( 2, 0 )
|
||||
|
||||
-- Choose repeat functionality
|
||||
|
||||
-- Repeat on ... (when landed on the airport)
|
||||
Spawn_Plane:InitRepeatOnEngineShutDown()
|
||||
|
||||
-- Now SPAWN the GROUPs
|
||||
Spawn_Plane:SpawnScheduled(30,0)
|
||||
|
||||
-- Now run the mission and observe the behaviour.
|
||||
|
||||
end
|
||||
---
|
||||
-- Name: SPA-120 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 05 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- One airplane and one helicopter will be spawned.
|
||||
-- Only one airplane and one helicopter can be alive at the same time.
|
||||
-- Upon landing, the airplane and helicopter will respawn at Kutaisi.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the spawning of the airplane and helicopter
|
||||
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
||||
-- 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.
|
||||
|
||||
|
||||
do
|
||||
|
||||
-- Declare SPAWN objects
|
||||
Spawn_Plane = SPAWN:New("Plane"):InitLimit( 2, 0 )
|
||||
|
||||
-- Choose repeat functionality
|
||||
|
||||
-- Repeat on ... (when landed on the airport)
|
||||
Spawn_Plane:InitRepeatOnEngineShutDown()
|
||||
|
||||
-- Now SPAWN the GROUPs
|
||||
Spawn_Plane:SpawnScheduled(30,0)
|
||||
|
||||
-- Now run the mission and observe the behaviour.
|
||||
|
||||
end
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
---
|
||||
-- Name: SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 05 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Multiple airplanes will be spawned at a scheduled interval.
|
||||
-- There is a limit on how many airplanes can be alive at the same time.
|
||||
-- Upon landing, the airplanes will respawn at Kutaisi.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the spawning of the airplanes
|
||||
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
||||
-- 3. Upon landing, the planes should respawn.
|
||||
-- 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.
|
||||
|
||||
|
||||
do
|
||||
|
||||
-- Declare SPAWN objects
|
||||
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
|
||||
Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 2, 10 )
|
||||
Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 2, 10 )
|
||||
Spawn_A_10C = SPAWN:New("A-10C")
|
||||
:InitLimit( 2, 10 )
|
||||
|
||||
-- Choose repeat functionality
|
||||
|
||||
-- Repeat on landing
|
||||
Spawn_KA_50:InitRepeatOnLanding()
|
||||
Spawn_KA_50:InitDelayOff()
|
||||
|
||||
Spawn_C_101EB:InitRepeatOnLanding()
|
||||
Spawn_C_101EB:InitDelayOff()
|
||||
|
||||
-- Repeat on enging shutdown (when landed on the airport)
|
||||
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
|
||||
Spawn_A_10C:InitRepeatOnEngineShutDown()
|
||||
|
||||
-- Now SPAWN the GROUPs
|
||||
Spawn_KA_50:SpawnScheduled(180,0)
|
||||
Spawn_C_101EB:SpawnScheduled(180,0)
|
||||
Spawn_MI_8MTV2:SpawnScheduled(180,0)
|
||||
Spawn_A_10C:SpawnScheduled(180,0)
|
||||
|
||||
-- Now run the mission and observe the behaviour.
|
||||
|
||||
end
|
||||
---
|
||||
-- Name: SPA-121 - Air Ops - Scheduled Spawns with Repeat on Landing with Limit
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 05 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Multiple airplanes will be spawned at a scheduled interval.
|
||||
-- There is a limit on how many airplanes can be alive at the same time.
|
||||
-- Upon landing, the airplanes will respawn at Kutaisi.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the spawning of the airplanes
|
||||
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
||||
-- 3. Upon landing, the planes should respawn.
|
||||
-- 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.
|
||||
|
||||
|
||||
do
|
||||
|
||||
-- Declare SPAWN objects
|
||||
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
|
||||
Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 2, 10 )
|
||||
Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 2, 10 )
|
||||
Spawn_A_10C = SPAWN:New("A-10C")
|
||||
:InitLimit( 2, 10 )
|
||||
|
||||
-- Choose repeat functionality
|
||||
|
||||
-- Repeat on landing
|
||||
Spawn_KA_50:InitRepeatOnLanding()
|
||||
Spawn_KA_50:InitDelayOff()
|
||||
|
||||
Spawn_C_101EB:InitRepeatOnLanding()
|
||||
Spawn_C_101EB:InitDelayOff()
|
||||
|
||||
-- Repeat on enging shutdown (when landed on the airport)
|
||||
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
|
||||
Spawn_A_10C:InitRepeatOnEngineShutDown()
|
||||
|
||||
-- Now SPAWN the GROUPs
|
||||
Spawn_KA_50:SpawnScheduled(180,0)
|
||||
Spawn_C_101EB:SpawnScheduled(180,0)
|
||||
Spawn_MI_8MTV2:SpawnScheduled(180,0)
|
||||
Spawn_A_10C:SpawnScheduled(180,0)
|
||||
|
||||
-- Now run the mission and observe the behaviour.
|
||||
|
||||
end
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
---
|
||||
-- Name: SPA-122 - Air Ops - OnLand test for Scheduled Spawns
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- An airplane is spawned at a scheduled interval.
|
||||
-- There is a limit on how many airplanes can be alive at the same time.
|
||||
-- Upon landing, the airplane will respawn in the air.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the spawning of the airplanes
|
||||
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
||||
-- 3. Upon landing, the planes should respawn.
|
||||
-- 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.
|
||||
|
||||
|
||||
do
|
||||
|
||||
-- Declare SPAWN objects
|
||||
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 1, 0 )
|
||||
Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 1, 0 )
|
||||
Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 1, 0 )
|
||||
Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 1, 0 )
|
||||
|
||||
-- Choose repeat functionality
|
||||
|
||||
-- Repeat on landing
|
||||
Spawn_KA_50:InitRepeatOnLanding()
|
||||
Spawn_C_101EB:InitRepeatOnLanding()
|
||||
|
||||
-- Repeat on enging shutdown (when landed on the airport)
|
||||
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
|
||||
Spawn_A_10C:InitRepeatOnEngineShutDown()
|
||||
|
||||
-- Now SPAWN the GROUPs
|
||||
Spawn_KA_50:SpawnScheduled(30,0)
|
||||
Spawn_C_101EB:SpawnScheduled(30,0)
|
||||
Spawn_MI_8MTV2:SpawnScheduled(30,0)
|
||||
Spawn_A_10C:SpawnScheduled(30,0)
|
||||
|
||||
-- Now run the mission and observe the behaviour.
|
||||
|
||||
end
|
||||
---
|
||||
-- Name: SPA-122 - Air Ops - OnLand test for Scheduled Spawns
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- An airplane is spawned at a scheduled interval.
|
||||
-- There is a limit on how many airplanes can be alive at the same time.
|
||||
-- Upon landing, the airplane will respawn in the air.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the spawning of the airplanes
|
||||
-- 2. There should not be more airplanes alive than there are set by InitLimit.
|
||||
-- 3. Upon landing, the planes should respawn.
|
||||
-- 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.
|
||||
|
||||
|
||||
do
|
||||
|
||||
-- Declare SPAWN objects
|
||||
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 1, 0 )
|
||||
Spawn_MI_8MTV2 = SPAWN:New("MI-8MTV2"):InitLimit( 1, 0 )
|
||||
Spawn_C_101EB = SPAWN:New("C-101EB"):InitLimit( 1, 0 )
|
||||
Spawn_A_10C = SPAWN:New("A-10C"):InitLimit( 1, 0 )
|
||||
|
||||
-- Choose repeat functionality
|
||||
|
||||
-- Repeat on landing
|
||||
Spawn_KA_50:InitRepeatOnLanding()
|
||||
Spawn_C_101EB:InitRepeatOnLanding()
|
||||
|
||||
-- Repeat on enging shutdown (when landed on the airport)
|
||||
Spawn_MI_8MTV2:InitRepeatOnEngineShutDown()
|
||||
Spawn_A_10C:InitRepeatOnEngineShutDown()
|
||||
|
||||
-- Now SPAWN the GROUPs
|
||||
Spawn_KA_50:SpawnScheduled(30,0)
|
||||
Spawn_C_101EB:SpawnScheduled(30,0)
|
||||
Spawn_MI_8MTV2:SpawnScheduled(30,0)
|
||||
Spawn_A_10C:SpawnScheduled(30,0)
|
||||
|
||||
-- Now run the mission and observe the behaviour.
|
||||
|
||||
end
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
---
|
||||
-- Name: SPA-123 - Air Ops - Repeat on Landing and InitCleanUp
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 Sep 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Helicpters spawn and are lightly shot until the crash land, but don't really destroy.
|
||||
-- The should be respawned after a while.
|
||||
-- No performance overhead should be noticed.
|
||||
|
||||
do
|
||||
|
||||
-- Declare SPAWN objects
|
||||
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
|
||||
:InitLimit( 2, 0 )
|
||||
|
||||
-- Choose repeat functionality
|
||||
|
||||
-- Repeat on landing
|
||||
Spawn_KA_50:InitRepeatOnLanding()
|
||||
Spawn_KA_50:InitDelayOff()
|
||||
Spawn_KA_50:InitCleanUp( 300 )
|
||||
Spawn_KA_50:SpawnScheduled( 180, 0.2 )
|
||||
|
||||
-- Now run the mission and observe the behaviour.
|
||||
|
||||
end
|
||||
---
|
||||
-- Name: SPA-123 - Air Ops - Repeat on Landing and InitCleanUp
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 15 Sep 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Helicpters spawn and are lightly shot until the crash land, but don't really destroy.
|
||||
-- The should be respawned after a while.
|
||||
-- No performance overhead should be noticed.
|
||||
|
||||
do
|
||||
|
||||
-- Declare SPAWN objects
|
||||
Spawn_KA_50 = SPAWN:New("KA-50"):InitLimit( 2, 10 )
|
||||
:InitLimit( 2, 0 )
|
||||
|
||||
-- Choose repeat functionality
|
||||
|
||||
-- Repeat on landing
|
||||
Spawn_KA_50:InitRepeatOnLanding()
|
||||
Spawn_KA_50:InitDelayOff()
|
||||
Spawn_KA_50:InitCleanUp( 300 )
|
||||
Spawn_KA_50:SpawnScheduled( 180, 0.2 )
|
||||
|
||||
-- Now run the mission and observe the behaviour.
|
||||
|
||||
end
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
---
|
||||
-- Name: SPA-130 - Uncontrolled Spawning
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the spawning of the UnControlled Plane.
|
||||
-- 2. Observe the spawning of the Controlled Plane.
|
||||
|
||||
|
||||
-- Create the SPAWN object looking for the group (template) "Plane".
|
||||
SpawnPlane = SPAWN:New( "Plane" )
|
||||
|
||||
-- Set the spawn mode to UnControlled.
|
||||
SpawnPlane:InitUnControlled( true )
|
||||
|
||||
-- Spawn the UnControlled Group
|
||||
UnControlledPlane = SpawnPlane:Spawn()
|
||||
|
||||
-- Set the spawn mode back to Controlled.
|
||||
SpawnPlane:InitUnControlled( false )
|
||||
|
||||
ControlledPlane = SpawnPlane:Spawn()
|
||||
|
||||
-- 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 ...
|
||||
PlayerPlane = CLIENT:FindByName( "PlayerPlane", "Select Menu item to activate UnControlled plane" )
|
||||
|
||||
PlayerPlane:Alive(
|
||||
function( Client, SpawnPlane )
|
||||
|
||||
--- @param Functional.Spawn#SPAWN SpawnPlane
|
||||
local function ActivatePlane( SpawnPlane )
|
||||
SpawnPlane:InitUnControlled( false )
|
||||
SpawnPlane:ReSpawn( 1 )
|
||||
end
|
||||
|
||||
local Menu = MENU_CLIENT_COMMAND:New( Client, "Select to activate UnControlled plane", nil, ActivatePlane, SpawnPlane )
|
||||
end
|
||||
, SpawnPlane
|
||||
---
|
||||
-- Name: SPA-130 - Uncontrolled Spawning
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the spawning of the UnControlled Plane.
|
||||
-- 2. Observe the spawning of the Controlled Plane.
|
||||
|
||||
|
||||
-- Create the SPAWN object looking for the group (template) "Plane".
|
||||
SpawnPlane = SPAWN:New( "Plane" )
|
||||
|
||||
-- Set the spawn mode to UnControlled.
|
||||
SpawnPlane:InitUnControlled( true )
|
||||
|
||||
-- Spawn the UnControlled Group
|
||||
UnControlledPlane = SpawnPlane:Spawn()
|
||||
|
||||
-- Set the spawn mode back to Controlled.
|
||||
SpawnPlane:InitUnControlled( false )
|
||||
|
||||
ControlledPlane = SpawnPlane:Spawn()
|
||||
|
||||
-- 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 ...
|
||||
PlayerPlane = CLIENT:FindByName( "PlayerPlane", "Select Menu item to activate UnControlled plane" )
|
||||
|
||||
PlayerPlane:Alive(
|
||||
function( Client, SpawnPlane )
|
||||
|
||||
--- @param Functional.Spawn#SPAWN SpawnPlane
|
||||
local function ActivatePlane( SpawnPlane )
|
||||
SpawnPlane:InitUnControlled( false )
|
||||
SpawnPlane:ReSpawn( 1 )
|
||||
end
|
||||
|
||||
local Menu = MENU_CLIENT_COMMAND:New( Client, "Select to activate UnControlled plane", nil, ActivatePlane, SpawnPlane )
|
||||
end
|
||||
, SpawnPlane
|
||||
)
|
||||
@@ -1,11 +1,11 @@
|
||||
-- Name: SPA-131 - Air Ops - SpawnAtAirbase
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Sep 2017
|
||||
--
|
||||
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.Hot )
|
||||
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Runway )
|
||||
|
||||
|
||||
|
||||
-- Name: SPA-131 - Air Ops - SpawnAtAirbase
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Sep 2017
|
||||
--
|
||||
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.Hot )
|
||||
Spawn_Plane:SpawnAtAirbase( AIRBASE:FindByName( AIRBASE.Nevada.Groom_Lake_AFB ), SPAWN.Takeoff.Runway )
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
-- Tests Gudauta
|
||||
-- --------------
|
||||
-- Limited and scheduled spawning of groups, with RandomizeTemplate ...
|
||||
|
||||
Templates = { "Template1", "Template2", "Template3", "Template4" }
|
||||
|
||||
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 )
|
||||
|
||||
|
||||
---
|
||||
-- Tests Gudauta
|
||||
-- --------------
|
||||
-- Limited and scheduled spawning of groups, with RandomizeTemplate ...
|
||||
|
||||
Templates = { "Template1", "Template2", "Template3", "Template4" }
|
||||
|
||||
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 )
|
||||
|
||||
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
-- This test will create 3 different zones of different types.
|
||||
-- 100 groups of 1 unit will be spawned.
|
||||
-- The test is about testing the zone randomization, and the place where the units are created.
|
||||
|
||||
local Iterations = 100
|
||||
local Iteration = 1
|
||||
|
||||
-- The PolygonGroup route defines zone 1
|
||||
local ZonePolygonGroup = GROUP:FindByName( "ZonePolygon" )
|
||||
|
||||
-- The ZoneUnit defines zone 4.
|
||||
local ZoneUnit = UNIT:FindByName( "ZoneUnit" )
|
||||
|
||||
-- The ZoneGroup defines zone 5
|
||||
local ZoneGroup = GROUP:FindByName( "ZoneGroup" )
|
||||
|
||||
-- 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 zone probabibility is 0 = 0%, 1 = 100%
|
||||
-- The default value of the probability is 1.
|
||||
-- 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!
|
||||
local SpawnZones = {
|
||||
ZONE_POLYGON:New( "Zone 1", ZonePolygonGroup ):SetZoneProbability( 0.8 ),
|
||||
ZONE_RADIUS:New( "Zone 2", ZONE:New( "GroundZone2" ):GetVec2(), 5000 ):SetZoneProbability( 0.2 ),
|
||||
ZONE:New( "GroundZone3" ):SetZoneProbability( 0.2 ),
|
||||
ZONE_UNIT:New( "Zone 4", ZoneUnit, 5000 ):SetZoneProbability( 0.6 ),
|
||||
ZONE_GROUP:New( "Zone 5", ZoneGroup, 5000 ):SetZoneProbability( 0.4 ),
|
||||
}
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN
|
||||
:New("Ground")
|
||||
:InitLimit( 100, 100 )
|
||||
-- This method will randomize the selection of the zones for each spawned Group during initialization,
|
||||
-- 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.
|
||||
:InitRandomizeZones( SpawnZones )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
SpawnGrounds:Spawn()
|
||||
end
|
||||
|
||||
end, {}, 0, 1, 0
|
||||
)
|
||||
-- This test will create 3 different zones of different types.
|
||||
-- 100 groups of 1 unit will be spawned.
|
||||
-- The test is about testing the zone randomization, and the place where the units are created.
|
||||
|
||||
local Iterations = 100
|
||||
local Iteration = 1
|
||||
|
||||
-- The PolygonGroup route defines zone 1
|
||||
local ZonePolygonGroup = GROUP:FindByName( "ZonePolygon" )
|
||||
|
||||
-- The ZoneUnit defines zone 4.
|
||||
local ZoneUnit = UNIT:FindByName( "ZoneUnit" )
|
||||
|
||||
-- The ZoneGroup defines zone 5
|
||||
local ZoneGroup = GROUP:FindByName( "ZoneGroup" )
|
||||
|
||||
-- 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 zone probabibility is 0 = 0%, 1 = 100%
|
||||
-- The default value of the probability is 1.
|
||||
-- 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!
|
||||
local SpawnZones = {
|
||||
ZONE_POLYGON:New( "Zone 1", ZonePolygonGroup ):SetZoneProbability( 0.8 ),
|
||||
ZONE_RADIUS:New( "Zone 2", ZONE:New( "GroundZone2" ):GetVec2(), 5000 ):SetZoneProbability( 0.2 ),
|
||||
ZONE:New( "GroundZone3" ):SetZoneProbability( 0.2 ),
|
||||
ZONE_UNIT:New( "Zone 4", ZoneUnit, 5000 ):SetZoneProbability( 0.6 ),
|
||||
ZONE_GROUP:New( "Zone 5", ZoneGroup, 5000 ):SetZoneProbability( 0.4 ),
|
||||
}
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN
|
||||
:New("Ground")
|
||||
:InitLimit( 100, 100 )
|
||||
-- This method will randomize the selection of the zones for each spawned Group during initialization,
|
||||
-- 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.
|
||||
:InitRandomizeZones( SpawnZones )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
SpawnGrounds:Spawn()
|
||||
end
|
||||
|
||||
end, {}, 0, 1, 0
|
||||
)
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundStatics = { "GroundStatic1", "GroundStatic2", "GroundStatic3" }
|
||||
AirplaneStatics = { "AirplaneStatic1", "AirplaneStatic2", "AirplaneStatic3" }
|
||||
HelicopterStatics = { "HelicopterStatic1", "HelicopterStatic2", "HelicopterStatic3" }
|
||||
ShipStatics = { "ShipStatic1", "ShipStatic2", "ShipStatic3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):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 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local StaticName = GroundStatics[ math.random( 1, 3 ) ]
|
||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||
SpawnGrounds:SpawnFromUnit( SpawnStatic )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local StaticName = AirplaneStatics[ math.random( 1, 3 ) ]
|
||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||
SpawnAirplanes:SpawnFromUnit( SpawnStatic )
|
||||
SpawnAirplanes:SpawnFromUnit( SpawnStatic, 2000, 4000 )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local StaticName = HelicopterStatics[ math.random( 1, 3 ) ]
|
||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||
SpawnHelicopters:SpawnFromUnit( SpawnStatic )
|
||||
SpawnHelicopters:SpawnFromUnit( SpawnStatic, 200, 500 ) -- Spawn between 200 and 500 meters.
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local StaticName = ShipStatics[ math.random( 1, 3 ) ]
|
||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||
SpawnShips:SpawnFromUnit( SpawnStatic )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundStatics = { "GroundStatic1", "GroundStatic2", "GroundStatic3" }
|
||||
AirplaneStatics = { "AirplaneStatic1", "AirplaneStatic2", "AirplaneStatic3" }
|
||||
HelicopterStatics = { "HelicopterStatic1", "HelicopterStatic2", "HelicopterStatic3" }
|
||||
ShipStatics = { "ShipStatic1", "ShipStatic2", "ShipStatic3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):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 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local StaticName = GroundStatics[ math.random( 1, 3 ) ]
|
||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||
SpawnGrounds:SpawnFromUnit( SpawnStatic )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local StaticName = AirplaneStatics[ math.random( 1, 3 ) ]
|
||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||
SpawnAirplanes:SpawnFromUnit( SpawnStatic )
|
||||
SpawnAirplanes:SpawnFromUnit( SpawnStatic, 2000, 4000 )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local StaticName = HelicopterStatics[ math.random( 1, 3 ) ]
|
||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||
SpawnHelicopters:SpawnFromUnit( SpawnStatic )
|
||||
SpawnHelicopters:SpawnFromUnit( SpawnStatic, 200, 500 ) -- Spawn between 200 and 500 meters.
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local StaticName = ShipStatics[ math.random( 1, 3 ) ]
|
||||
local SpawnStatic = STATIC:FindByName( StaticName )
|
||||
SpawnShips:SpawnFromUnit( SpawnStatic )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundUnits = { "GroundUnit1", "GroundUnit2", "GroundUnit3" }
|
||||
AirplaneUnits = { "AirplaneUnit1", "AirplaneUnit2", "AirplaneUnit3" }
|
||||
HelicopterUnits = { "HelicopterUnit1", "HelicopterUnit2", "HelicopterUnit3" }
|
||||
ShipUnits = { "ShipUnit1", "ShipUnit2", "ShipUnit3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 10, 3 )
|
||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local UnitName = GroundUnits[ math.random( 1, 3 ) ]
|
||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||
SpawnGrounds:SpawnFromUnit( SpawnUnit )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local UnitName = AirplaneUnits[ math.random( 1, 3 ) ]
|
||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||
SpawnAirplanes:SpawnFromUnit( SpawnUnit )
|
||||
SpawnAirplanes:SpawnFromUnit( SpawnUnit, 200, 500 )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local UnitName = HelicopterUnits[ math.random( 1, 3 ) ]
|
||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||
SpawnHelicopters:SpawnFromUnit( SpawnUnit )
|
||||
SpawnHelicopters:SpawnFromUnit( SpawnUnit, 500, 2000 )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local UnitName = ShipUnits[ math.random( 1, 3 ) ]
|
||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||
SpawnShips:SpawnFromUnit( SpawnUnit )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundUnits = { "GroundUnit1", "GroundUnit2", "GroundUnit3" }
|
||||
AirplaneUnits = { "AirplaneUnit1", "AirplaneUnit2", "AirplaneUnit3" }
|
||||
HelicopterUnits = { "HelicopterUnit1", "HelicopterUnit2", "HelicopterUnit3" }
|
||||
ShipUnits = { "ShipUnit1", "ShipUnit2", "ShipUnit3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 10, 3 )
|
||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local UnitName = GroundUnits[ math.random( 1, 3 ) ]
|
||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||
SpawnGrounds:SpawnFromUnit( SpawnUnit )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local UnitName = AirplaneUnits[ math.random( 1, 3 ) ]
|
||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||
SpawnAirplanes:SpawnFromUnit( SpawnUnit )
|
||||
SpawnAirplanes:SpawnFromUnit( SpawnUnit, 200, 500 )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local UnitName = HelicopterUnits[ math.random( 1, 3 ) ]
|
||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||
SpawnHelicopters:SpawnFromUnit( SpawnUnit )
|
||||
SpawnHelicopters:SpawnFromUnit( SpawnUnit, 500, 2000 )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local UnitName = ShipUnits[ math.random( 1, 3 ) ]
|
||||
local SpawnUnit = UNIT:FindByName( UnitName )
|
||||
SpawnShips:SpawnFromUnit( SpawnUnit )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
|
||||
@@ -1,61 +1,61 @@
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 )
|
||||
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnGrounds:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ground Randomize
|
||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnRandomizeGrounds:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2(), 200, 500 )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2(), 2000, 4000 )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnShips:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 )
|
||||
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnGrounds:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ground Randomize
|
||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnRandomizeGrounds:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||
SpawnAirplanes:SpawnFromVec2( SpawnVec3:GetVec2(), 200, 500 )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||
SpawnHelicopters:SpawnFromVec2( SpawnVec3:GetVec2(), 2000, 4000 )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnShips:SpawnFromVec2( SpawnVec3:GetVec2() )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 )
|
||||
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ground Randomize
|
||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):InitLimit( 20, 10 )
|
||||
SpawnRandomizeGrounds = SPAWN:New("GroundRandomize"):InitLimit( 20, 10 ):InitRandomizeUnits( true, 500, 100 )
|
||||
SpawnAirplanes = SPAWN:New("Airplane"):InitLimit( 20, 10 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ground Randomize
|
||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
|
||||
@@ -1,73 +1,73 @@
|
||||
---
|
||||
-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the random positioning of the groups. There should be no scattering of units.
|
||||
--
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):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 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ground Randomize
|
||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
---
|
||||
-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the random positioning of the groups. There should be no scattering of units.
|
||||
--
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):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 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ground Randomize
|
||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
|
||||
@@ -1,73 +1,73 @@
|
||||
---
|
||||
-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the random positioning of the groups. There should be no scattering of units.
|
||||
--
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):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 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ground Randomize
|
||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
---
|
||||
-- Name: SPA-350 - Spawn at Vec3 position RandomzePosition
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 14 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the random positioning of the groups. There should be no scattering of units.
|
||||
--
|
||||
|
||||
local Iterations = 10
|
||||
local Iteration = 1
|
||||
|
||||
GroundZones = { "GroundZone1", "GroundZone2", "GroundZone3" }
|
||||
GroundRandomizeZones = { "GroundRandomizeZone1", "GroundRandomizeZone2", "GroundRandomizeZone3" }
|
||||
AirplaneZones = { "AirplaneZone1", "AirplaneZone2", "AirplaneZone3" }
|
||||
HelicopterZones = { "HelicopterZone1", "HelicopterZone2", "HelicopterZone3" }
|
||||
ShipZones = { "ShipZone1", "ShipZone2", "ShipZone3" }
|
||||
|
||||
HeightLimit = 500
|
||||
|
||||
SpawnGrounds = SPAWN:New("Ground"):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 )
|
||||
SpawnHelicopters = SPAWN:New("Helicopter"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
SpawnShips = SPAWN:New("Ship"):InitLimit( 20, 10 ):InitRandomizePosition( true , 1000, 900 )
|
||||
|
||||
--- Spawns these groups slowly.
|
||||
SCHEDULER:New( nil,
|
||||
|
||||
function( Interation, Iterations )
|
||||
do
|
||||
-- Spawn Ground
|
||||
local ZoneName = GroundZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ground Randomize
|
||||
local ZoneName = GroundRandomizeZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnRandomizeGrounds:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Airplanes
|
||||
local ZoneName = AirplaneZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnAirplanes:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Helicopters
|
||||
local ZoneName = HelicopterZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnHelicopters:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
do
|
||||
-- Spawn Ships
|
||||
local ZoneName = ShipZones[ math.random( 1, 3 ) ]
|
||||
local SpawnVec3 = POINT_VEC3:NewFromVec3( ZONE:New( ZoneName ):GetVec3() )
|
||||
SpawnShips:SpawnFromVec3( SpawnVec3:GetVec3() )
|
||||
end
|
||||
|
||||
end, {}, 0, 15, 0.5
|
||||
)
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
--- Name: SPS-100 - Simple Spawning
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 09 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn a static.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the static is spawned.
|
||||
|
||||
|
||||
local ZonePosition = ZONE:New( "Position" )
|
||||
|
||||
local SpawnBuilding = SPAWNSTATIC:NewFromStatic( "Building", country.id.GERMANY )
|
||||
local SpawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY )
|
||||
|
||||
local ZonePointVec2 = ZonePosition:GetPointVec2()
|
||||
|
||||
local Building = SpawnBuilding:SpawnFromZone( ZonePosition, 0 )
|
||||
|
||||
for Heading = 0, 360,60 do
|
||||
local Radial = Heading * ( math.pi*2 ) / 360
|
||||
local x = ZonePointVec2:GetLat() + math.cos( Radial ) * 150
|
||||
local y = ZonePointVec2:GetLon() + math.sin( Radial ) * 150
|
||||
SpawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 )
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Name: SPS-100 - Simple Spawning
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 09 Apr 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- At Gudauta spawn a static.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe that the static is spawned.
|
||||
|
||||
|
||||
local ZonePosition = ZONE:New( "Position" )
|
||||
|
||||
local SpawnBuilding = SPAWNSTATIC:NewFromStatic( "Building", country.id.GERMANY )
|
||||
local SpawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY )
|
||||
|
||||
local ZonePointVec2 = ZonePosition:GetPointVec2()
|
||||
|
||||
local Building = SpawnBuilding:SpawnFromZone( ZonePosition, 0 )
|
||||
|
||||
for Heading = 0, 360,60 do
|
||||
local Radial = Heading * ( math.pi*2 ) / 360
|
||||
local x = ZonePointVec2:GetLat() + math.cos( Radial ) * 150
|
||||
local y = ZonePointVec2:GetLon() + math.sin( Radial ) * 150
|
||||
SpawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 )
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,62 +1,62 @@
|
||||
---
|
||||
-- FARPS
|
||||
-- This demo shows how to dynamically spawn FARPs into a mission.
|
||||
--
|
||||
-- We spawn two FARPS in a zone near Batumi.
|
||||
-- The first FARP is names "FARP Berlin" and the second "FARP London".
|
||||
-- We put coloured smoke on the spawned objects to mark them.
|
||||
--
|
||||
-- The data is taken from "template" FARPS. Note that if the same
|
||||
-- name as the template is used, the original object is despawned
|
||||
-- automatically when the new object is spawned.
|
||||
--
|
||||
-- As FARPS in DCS are strange creatures, which are hybrids of groups
|
||||
-- and statics, the function :InitFARP is necessary.
|
||||
---
|
||||
|
||||
-- Zone near Batumi on land.
|
||||
local ZoneSpawn=ZONE:FindByName("Spawn Land")
|
||||
|
||||
|
||||
-- Create a SPAWNSTATIC object from a template static FARP object.
|
||||
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.
|
||||
SpawnStaticFarp:InitFARP(CALLSIGN.FARP.Berlin, 130.000, 0)
|
||||
|
||||
-- Spawn FARP with heading 90°. It's name will be "Farp Berlin".
|
||||
local FarpBerlin=SpawnStaticFarp:SpawnFromZone(ZoneSpawn, 90, "FARP Berlin")
|
||||
|
||||
-- Smoke static green.
|
||||
FarpBerlin:GetCoordinate():SmokeGreen()
|
||||
|
||||
|
||||
-- The second FAPR gets callsign London and used radio frequency 131 MHz.
|
||||
SpawnStaticFarp:InitFARP(CALLSIGN.FARP.London, 131.000, 0)
|
||||
|
||||
-- We set the country to UK.
|
||||
SpawnStaticFarp:InitCountry(country.id.UK)
|
||||
|
||||
-- Spawn the FARP at a random location inside the zone.
|
||||
local FarpLondon=SpawnStaticFarp:SpawnFromCoordinate(ZoneSpawn:GetRandomCoordinate(), nil, "Farp London")
|
||||
|
||||
-- Put red smoke at FARP London.
|
||||
FarpLondon:GetCoordinate():SmokeRed()
|
||||
|
||||
|
||||
-- Function to check if the STATIC/AIRBASE objects can be found.
|
||||
local function check()
|
||||
|
||||
-- Try to find static.
|
||||
local StaticBerlin=STATIC:FindByName("FARP Berlin")
|
||||
|
||||
-- Launch red flare.
|
||||
StaticBerlin:GetCoordinate():FlareRed()
|
||||
|
||||
-- Get the airbase object.
|
||||
local AirbaseBerlin=AIRBASE:FindByName("FARP Berlin")
|
||||
AirbaseBerlin:MarkParkingSpots()
|
||||
|
||||
end
|
||||
---
|
||||
-- FARPS
|
||||
-- This demo shows how to dynamically spawn FARPs into a mission.
|
||||
--
|
||||
-- We spawn two FARPS in a zone near Batumi.
|
||||
-- The first FARP is names "FARP Berlin" and the second "FARP London".
|
||||
-- We put coloured smoke on the spawned objects to mark them.
|
||||
--
|
||||
-- The data is taken from "template" FARPS. Note that if the same
|
||||
-- name as the template is used, the original object is despawned
|
||||
-- automatically when the new object is spawned.
|
||||
--
|
||||
-- As FARPS in DCS are strange creatures, which are hybrids of groups
|
||||
-- and statics, the function :InitFARP is necessary.
|
||||
---
|
||||
|
||||
-- Zone near Batumi on land.
|
||||
local ZoneSpawn=ZONE:FindByName("Spawn Land")
|
||||
|
||||
|
||||
-- Create a SPAWNSTATIC object from a template static FARP object.
|
||||
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.
|
||||
SpawnStaticFarp:InitFARP(CALLSIGN.FARP.Berlin, 130.000, 0)
|
||||
|
||||
-- Spawn FARP with heading 90°. It's name will be "Farp Berlin".
|
||||
local FarpBerlin=SpawnStaticFarp:SpawnFromZone(ZoneSpawn, 90, "FARP Berlin")
|
||||
|
||||
-- Smoke static green.
|
||||
FarpBerlin:GetCoordinate():SmokeGreen()
|
||||
|
||||
|
||||
-- The second FAPR gets callsign London and used radio frequency 131 MHz.
|
||||
SpawnStaticFarp:InitFARP(CALLSIGN.FARP.London, 131.000, 0)
|
||||
|
||||
-- We set the country to UK.
|
||||
SpawnStaticFarp:InitCountry(country.id.UK)
|
||||
|
||||
-- Spawn the FARP at a random location inside the zone.
|
||||
local FarpLondon=SpawnStaticFarp:SpawnFromCoordinate(ZoneSpawn:GetRandomCoordinate(), nil, "Farp London")
|
||||
|
||||
-- Put red smoke at FARP London.
|
||||
FarpLondon:GetCoordinate():SmokeRed()
|
||||
|
||||
|
||||
-- Function to check if the STATIC/AIRBASE objects can be found.
|
||||
local function check()
|
||||
|
||||
-- Try to find static.
|
||||
local StaticBerlin=STATIC:FindByName("FARP Berlin")
|
||||
|
||||
-- Launch red flare.
|
||||
StaticBerlin:GetCoordinate():FlareRed()
|
||||
|
||||
-- Get the airbase object.
|
||||
local AirbaseBerlin=AIRBASE:FindByName("FARP Berlin")
|
||||
AirbaseBerlin:MarkParkingSpots()
|
||||
|
||||
end
|
||||
TIMER:New(check):Start(1)
|
||||
@@ -1,32 +1,32 @@
|
||||
---
|
||||
-- Name: ZON-100 - Normal Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
ZoneA = ZONE:New( "Zone A" )
|
||||
ZoneA:SmokeZone( SMOKECOLOR.White, 90 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
---
|
||||
-- Name: ZON-100 - Normal Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
ZoneA = ZONE:New( "Zone A" )
|
||||
ZoneA:SmokeZone( SMOKECOLOR.White, 90 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
---
|
||||
-- Name: ZON-101 - Normal Zone - Random Point
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Three zones are defined.
|
||||
-- 15 points are smoked in each zone.
|
||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() 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: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
Zone1 = ZONE:New( "Zone 1" )
|
||||
Zone2 = ZONE:New( "Zone 2" )
|
||||
Zone3 = ZONE:New( "Zone 3" )
|
||||
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
for i = 1, 15 do
|
||||
-- Zone 1
|
||||
local Vec2 = Zone1:GetRandomVec2()
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
PointVec2:SmokeBlue()
|
||||
|
||||
-- Zone 2
|
||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||
PointVec2:SmokeOrange()
|
||||
|
||||
-- Zone 3
|
||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||
PointVec3:SmokeRed()
|
||||
end
|
||||
---
|
||||
-- Name: ZON-101 - Normal Zone - Random Point
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Three zones are defined.
|
||||
-- 15 points are smoked in each zone.
|
||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() 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: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
Zone1 = ZONE:New( "Zone 1" )
|
||||
Zone2 = ZONE:New( "Zone 2" )
|
||||
Zone3 = ZONE:New( "Zone 3" )
|
||||
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
for i = 1, 15 do
|
||||
-- Zone 1
|
||||
local Vec2 = Zone1:GetRandomVec2()
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
PointVec2:SmokeBlue()
|
||||
|
||||
-- Zone 2
|
||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||
PointVec2:SmokeOrange()
|
||||
|
||||
-- Zone 3
|
||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||
PointVec3:SmokeRed()
|
||||
end
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
---
|
||||
-- Name: ZON-100 - Normal Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
ZoneA = ZONE:New( "Zone A" )
|
||||
ZoneA:BoundZone( 90 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
---
|
||||
-- Name: ZON-100 - Normal Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
ZoneA = ZONE:New( "Zone A" )
|
||||
ZoneA:BoundZone( 90 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
---
|
||||
-- Name: SET-102 - Test SET_GROUP object against ZONE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 31 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, and the SET_GROUP object is checked against the zone.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone.
|
||||
-- 2. Observe the results of the functions.
|
||||
|
||||
|
||||
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
|
||||
|
||||
Zone = ZONE:New( "Zone" )
|
||||
|
||||
SetGroupObject:ForEachGroupCompletelyInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } )
|
||||
end )
|
||||
|
||||
SetGroupObject:ForEachGroupPartlyInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } )
|
||||
end )
|
||||
|
||||
SetGroupObject:ForEachGroupNotInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } )
|
||||
end )
|
||||
|
||||
---
|
||||
-- Name: SET-102 - Test SET_GROUP object against ZONE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 31 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, and the SET_GROUP object is checked against the zone.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone.
|
||||
-- 2. Observe the results of the functions.
|
||||
|
||||
|
||||
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
|
||||
|
||||
Zone = ZONE:New( "Zone" )
|
||||
|
||||
SetGroupObject:ForEachGroupCompletelyInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } )
|
||||
end )
|
||||
|
||||
SetGroupObject:ForEachGroupPartlyInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } )
|
||||
end )
|
||||
|
||||
SetGroupObject:ForEachGroupNotInZone( Zone,
|
||||
function( GroupObject )
|
||||
GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } )
|
||||
end )
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
---
|
||||
-- Name: ZON-103 - Test if GROUP object is in ZONE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 31 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, and it is checked if a GROUP object is within the zone.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone.
|
||||
-- 2. Observe the results of the functions.
|
||||
|
||||
|
||||
GroupObject = GROUP:FindByName( "Group Object" )
|
||||
|
||||
Zone = ZONE:New( "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 not in Zone:", GroupObject:IsNotInZone( Zone ) } )
|
||||
|
||||
---
|
||||
-- Name: ZON-103 - Test if GROUP object is in ZONE
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 31 Mar 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, and it is checked if a GROUP object is within the zone.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone.
|
||||
-- 2. Observe the results of the functions.
|
||||
|
||||
|
||||
GroupObject = GROUP:FindByName( "Group Object" )
|
||||
|
||||
Zone = ZONE:New( "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 not in Zone:", GroupObject:IsNotInZone( Zone ) } )
|
||||
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
---
|
||||
-- Name: ZON-110 - ZONE declared in ME
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 May 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined using the Mission Editor, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside" )
|
||||
|
||||
-- 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:FindByName( "Zone A" )
|
||||
ZoneA:SmokeZone( SMOKECOLOR.White, 30 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
---
|
||||
-- Name: ZON-110 - ZONE declared in ME
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 May 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined using the Mission Editor, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside" )
|
||||
|
||||
-- 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:FindByName( "Zone A" )
|
||||
ZoneA:SmokeZone( SMOKECOLOR.White, 30 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
---
|
||||
-- Name: ZON-190 - Return SCENERY objects in Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 08 Oct 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
|
||||
|
||||
Zone = ZONE:New( "Zone" )
|
||||
|
||||
|
||||
Zone:Scan( Object.Category.SCENERY )
|
||||
|
||||
for SceneryTypeName, SceneryData in pairs( Zone:GetScannedScenery() ) do
|
||||
for SceneryName, SceneryObject in pairs( SceneryData ) do
|
||||
local SceneryObject = SceneryObject -- Wrapper.Scenery#SCENERY
|
||||
MESSAGE:NewType( "Scenery: " .. SceneryObject:GetTypeName() .. ", Coord LL DMS: " .. SceneryObject:GetCoordinate():ToStringLLDMS(), MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
---
|
||||
-- Name: ZON-190 - Return SCENERY objects in Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 08 Oct 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
|
||||
|
||||
Zone = ZONE:New( "Zone" )
|
||||
|
||||
|
||||
Zone:Scan( Object.Category.SCENERY )
|
||||
|
||||
for SceneryTypeName, SceneryData in pairs( Zone:GetScannedScenery() ) do
|
||||
for SceneryName, SceneryObject in pairs( SceneryData ) do
|
||||
local SceneryObject = SceneryObject -- Wrapper.Scenery#SCENERY
|
||||
MESSAGE:NewType( "Scenery: " .. SceneryObject:GetTypeName() .. ", Coord LL DMS: " .. SceneryObject:GetCoordinate():ToStringLLDMS(), MESSAGE.Type.Information ):ToAll()
|
||||
end
|
||||
end
|
||||
@@ -1,36 +1,36 @@
|
||||
---
|
||||
-- Name: ZON-200 - Group Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_GROUP has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
Tank = GROUP:FindByName( "Tank" )
|
||||
ZoneA = ZONE_GROUP:New( "Zone A", Tank, 100 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
TankZoneColoring = SCHEDULER:New( nil,
|
||||
function()
|
||||
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
||||
end,
|
||||
---
|
||||
-- Name: ZON-200 - Group Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_GROUP has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
Tank = GROUP:FindByName( "Tank" )
|
||||
ZoneA = ZONE_GROUP:New( "Zone A", Tank, 100 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
TankZoneColoring = SCHEDULER:New( nil,
|
||||
function()
|
||||
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
||||
end,
|
||||
{}, 0, 5 )
|
||||
@@ -1,43 +1,43 @@
|
||||
---
|
||||
-- Name: ZON-201 - Group Zone - Random Point
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Three zones are defined.
|
||||
-- 15 points are smoked in each zone.
|
||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() 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: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
Zone1 = ZONE_GROUP:New( "Zone 1", GROUP:FindByName( "Zone 1" ), 300 )
|
||||
Zone2 = ZONE_GROUP:New( "Zone 2", GROUP:FindByName( "Zone 2" ), 300 )
|
||||
Zone3 = ZONE_GROUP:New( "Zone 3", GROUP:FindByName( "Zone 3" ), 300 )
|
||||
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
for i = 1, 15 do
|
||||
-- Zone 1
|
||||
local Vec2 = Zone1:GetRandomVec2()
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
PointVec2:SmokeBlue()
|
||||
|
||||
-- Zone 2
|
||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||
PointVec2:SmokeOrange()
|
||||
|
||||
-- Zone 3
|
||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||
PointVec3:SmokeRed()
|
||||
end
|
||||
---
|
||||
-- Name: ZON-201 - Group Zone - Random Point
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Three zones are defined.
|
||||
-- 15 points are smoked in each zone.
|
||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() 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: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
Zone1 = ZONE_GROUP:New( "Zone 1", GROUP:FindByName( "Zone 1" ), 300 )
|
||||
Zone2 = ZONE_GROUP:New( "Zone 2", GROUP:FindByName( "Zone 2" ), 300 )
|
||||
Zone3 = ZONE_GROUP:New( "Zone 3", GROUP:FindByName( "Zone 3" ), 300 )
|
||||
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
for i = 1, 15 do
|
||||
-- Zone 1
|
||||
local Vec2 = Zone1:GetRandomVec2()
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
PointVec2:SmokeBlue()
|
||||
|
||||
-- Zone 2
|
||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||
PointVec2:SmokeOrange()
|
||||
|
||||
-- Zone 3
|
||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||
PointVec3:SmokeRed()
|
||||
end
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
---
|
||||
-- Name: ZON-300 - Unit Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_UNIT has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
Tank = UNIT:FindByName( "Tank" )
|
||||
ZoneA = ZONE_UNIT:New( "Zone A", Tank, 100 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
TankZoneColoring = SCHEDULER:New( nil,
|
||||
function()
|
||||
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
||||
end,
|
||||
---
|
||||
-- Name: ZON-300 - Unit Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_UNIT has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
Tank = UNIT:FindByName( "Tank" )
|
||||
ZoneA = ZONE_UNIT:New( "Zone A", Tank, 100 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
TankZoneColoring = SCHEDULER:New( nil,
|
||||
function()
|
||||
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
||||
end,
|
||||
{}, 0, 5 )
|
||||
@@ -1,43 +1,43 @@
|
||||
---
|
||||
-- Name: ZON-301 - Unit Zone - Random Point
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Three zones are defined.
|
||||
-- 15 points are smoked in each zone.
|
||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() 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: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
Zone1 = ZONE_UNIT:New( "Zone 1", UNIT:FindByName( "Zone 1" ), 300 )
|
||||
Zone2 = ZONE_UNIT:New( "Zone 2", UNIT:FindByName( "Zone 2" ), 300 )
|
||||
Zone3 = ZONE_UNIT:New( "Zone 3", UNIT:FindByName( "Zone 3" ), 300 )
|
||||
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
for i = 1, 15 do
|
||||
-- Zone 1
|
||||
local Vec2 = Zone1:GetRandomVec2()
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
PointVec2:SmokeBlue()
|
||||
|
||||
-- Zone 2
|
||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||
PointVec2:SmokeOrange()
|
||||
|
||||
-- Zone 3
|
||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||
PointVec3:SmokeRed()
|
||||
end
|
||||
---
|
||||
-- Name: ZON-301 - Unit Zone - Random Point
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Three zones are defined.
|
||||
-- 15 points are smoked in each zone.
|
||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() 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: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
Zone1 = ZONE_UNIT:New( "Zone 1", UNIT:FindByName( "Zone 1" ), 300 )
|
||||
Zone2 = ZONE_UNIT:New( "Zone 2", UNIT:FindByName( "Zone 2" ), 300 )
|
||||
Zone3 = ZONE_UNIT:New( "Zone 3", UNIT:FindByName( "Zone 3" ), 300 )
|
||||
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
for i = 1, 15 do
|
||||
-- Zone 1
|
||||
local Vec2 = Zone1:GetRandomVec2()
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
PointVec2:SmokeBlue()
|
||||
|
||||
-- Zone 2
|
||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||
PointVec2:SmokeOrange()
|
||||
|
||||
-- Zone 3
|
||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||
PointVec3:SmokeRed()
|
||||
end
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
---
|
||||
-- Name: ZON-400 - Radius Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_RADIUS has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the polygon perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
House = STATIC:FindByName( "House" )
|
||||
ZoneA = ZONE_RADIUS:New( "Zone A", House:GetVec2(), 300 )
|
||||
ZoneA:SmokeZone( SMOKECOLOR.White, 90 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
---
|
||||
-- Name: ZON-400 - Radius Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_RADIUS has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the polygon perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
House = STATIC:FindByName( "House" )
|
||||
ZoneA = ZONE_RADIUS:New( "Zone A", House:GetVec2(), 300 )
|
||||
ZoneA:SmokeZone( SMOKECOLOR.White, 90 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
---
|
||||
-- Name: ZON-401 - Radius Zone - Random Point
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Three zones are defined.
|
||||
-- 15 points are smoked in each zone.
|
||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() 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: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
Unit1 = UNIT:FindByName( "Zone 1" )
|
||||
Unit2 = UNIT:FindByName( "Zone 2" )
|
||||
Unit3 = UNIT:FindByName( "Zone 3" )
|
||||
|
||||
|
||||
Zone1 = ZONE_RADIUS:New( "Zone 1", Unit1:GetVec2(), 300 )
|
||||
Zone2 = ZONE_RADIUS:New( "Zone 2", Unit2:GetVec2(), 300 )
|
||||
Zone3 = ZONE_RADIUS:New( "Zone 3", Unit3:GetVec2(), 300 )
|
||||
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
for i = 1, 15 do
|
||||
-- Zone 1
|
||||
local Vec2 = Zone1:GetRandomVec2()
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
PointVec2:SmokeBlue()
|
||||
|
||||
-- Zone 2
|
||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||
PointVec2:SmokeOrange()
|
||||
|
||||
-- Zone 3
|
||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||
PointVec3:SmokeRed()
|
||||
end
|
||||
---
|
||||
-- Name: ZON-401 - Radius Zone - Random Point
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Three zones are defined.
|
||||
-- 15 points are smoked in each zone.
|
||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() 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: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
Unit1 = UNIT:FindByName( "Zone 1" )
|
||||
Unit2 = UNIT:FindByName( "Zone 2" )
|
||||
Unit3 = UNIT:FindByName( "Zone 3" )
|
||||
|
||||
|
||||
Zone1 = ZONE_RADIUS:New( "Zone 1", Unit1:GetVec2(), 300 )
|
||||
Zone2 = ZONE_RADIUS:New( "Zone 2", Unit2:GetVec2(), 300 )
|
||||
Zone3 = ZONE_RADIUS:New( "Zone 3", Unit3:GetVec2(), 300 )
|
||||
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
for i = 1, 15 do
|
||||
-- Zone 1
|
||||
local Vec2 = Zone1:GetRandomVec2()
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
PointVec2:SmokeBlue()
|
||||
|
||||
-- Zone 2
|
||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||
PointVec2:SmokeOrange()
|
||||
|
||||
-- Zone 3
|
||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||
PointVec3:SmokeRed()
|
||||
end
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
---
|
||||
-- Name: ZON-500 - Polygon Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the polygon perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
GroupPolygon = GROUP:FindByName( "Polygon A" )
|
||||
|
||||
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
||||
PolygonZone:SmokeZone( SMOKECOLOR.White, 20 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
---
|
||||
-- Name: ZON-500 - Polygon Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the polygon perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
GroupPolygon = GROUP:FindByName( "Polygon A" )
|
||||
|
||||
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
||||
PolygonZone:SmokeZone( SMOKECOLOR.White, 20 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
---
|
||||
-- Name: ZON-501 - Polygon Zone - Random Point
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Three zones are defined.
|
||||
-- 15 points are smoked in each zone.
|
||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() 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: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
Zone1 = ZONE_POLYGON:New( "Zone 1", GROUP:FindByName( "Zone 1" ) )
|
||||
Zone2 = ZONE_POLYGON:New( "Zone 2", GROUP:FindByName( "Zone 2" ) )
|
||||
Zone3 = ZONE_POLYGON:New( "Zone 3", GROUP:FindByName( "Zone 3" ) )
|
||||
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
|
||||
for i = 1, 15 do
|
||||
-- Zone 1
|
||||
local Vec2 = Zone1:GetRandomVec2()
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
PointVec2:SmokeBlue()
|
||||
|
||||
-- Zone 2
|
||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||
PointVec2:SmokeOrange()
|
||||
|
||||
-- Zone 3
|
||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||
PointVec3:SmokeRed()
|
||||
end
|
||||
---
|
||||
-- Name: ZON-501 - Polygon Zone - Random Point
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Three zones are defined.
|
||||
-- 15 points are smoked in each zone.
|
||||
-- The first 15 points are blue smoked using the GetRandomVec2() API.
|
||||
-- The second 15 points are orange smoked using the GetRandomPointVec2() 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: At each zone an vehicle is placed, so you can view the smoking in external view.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 2. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 3. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
Zone1 = ZONE_POLYGON:New( "Zone 1", GROUP:FindByName( "Zone 1" ) )
|
||||
Zone2 = ZONE_POLYGON:New( "Zone 2", GROUP:FindByName( "Zone 2" ) )
|
||||
Zone3 = ZONE_POLYGON:New( "Zone 3", GROUP:FindByName( "Zone 3" ) )
|
||||
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
|
||||
for i = 1, 15 do
|
||||
-- Zone 1
|
||||
local Vec2 = Zone1:GetRandomVec2()
|
||||
local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 )
|
||||
PointVec2:SmokeBlue()
|
||||
|
||||
-- Zone 2
|
||||
local PointVec2 = Zone2:GetRandomPointVec2()
|
||||
PointVec2:SmokeOrange()
|
||||
|
||||
-- Zone 3
|
||||
local PointVec3 = Zone3:GetRandomPointVec3()
|
||||
PointVec3:SmokeRed()
|
||||
end
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
---
|
||||
-- Name: ZON-502 - Polygon Zone Boundary
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are tires.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the polygon perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
GroupPolygon = GROUP:FindByName( "Polygon A" )
|
||||
|
||||
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
||||
PolygonZone:BoundZone()
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
---
|
||||
-- Name: ZON-502 - Polygon Zone Boundary
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are tires.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the polygon perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
GroupPolygon = GROUP:FindByName( "Polygon A" )
|
||||
|
||||
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
||||
PolygonZone:BoundZone()
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
---
|
||||
-- Name: ZON-510 - ZONE_POLYGON declared in ME
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 May 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, within the mission editor using ~ZONE_POLYGON in the group name.
|
||||
-- Its boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the polygon perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
PolygonZone = ZONE_POLYGON:FindByName( "Polygon A" )
|
||||
PolygonZone:SmokeZone( SMOKECOLOR.White, 10 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
---
|
||||
-- Name: ZON-510 - ZONE_POLYGON declared in ME
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 May 2018
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, within the mission editor using ~ZONE_POLYGON in the group name.
|
||||
-- Its boundaries are smoking.
|
||||
-- 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.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the polygon perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
PolygonZone = ZONE_POLYGON:FindByName( "Polygon A" )
|
||||
PolygonZone:SmokeZone( SMOKECOLOR.White, 10 )
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user