mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2025-08-15 10:37:46 +00:00
Migrated Core/Zone to new repo
This commit is contained in:
parent
b8cfd0d3ac
commit
f1bf0d6475
@ -1,32 +0,0 @@
|
||||
---
|
||||
-- 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 )
|
||||
|
||||
Binary file not shown.
@ -1,43 +0,0 @@
|
||||
---
|
||||
-- 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
|
||||
Binary file not shown.
@ -1,32 +0,0 @@
|
||||
---
|
||||
-- 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 )
|
||||
|
||||
Binary file not shown.
@ -1,34 +0,0 @@
|
||||
---
|
||||
-- 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 +0,0 @@
|
||||
---
|
||||
-- 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 ) } )
|
||||
|
||||
Binary file not shown.
@ -1,34 +0,0 @@
|
||||
---
|
||||
-- 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 )
|
||||
|
||||
Binary file not shown.
@ -1,22 +0,0 @@
|
||||
---
|
||||
-- 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
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,36 +0,0 @@
|
||||
---
|
||||
-- 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 )
|
||||
Binary file not shown.
@ -1,43 +0,0 @@
|
||||
---
|
||||
-- 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
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,36 +0,0 @@
|
||||
---
|
||||
-- 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 )
|
||||
Binary file not shown.
@ -1,43 +0,0 @@
|
||||
---
|
||||
-- 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
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,32 +0,0 @@
|
||||
---
|
||||
-- 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 )
|
||||
|
||||
Binary file not shown.
@ -1,48 +0,0 @@
|
||||
---
|
||||
-- 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
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1,33 +0,0 @@
|
||||
---
|
||||
-- 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 )
|
||||
|
||||
Binary file not shown.
@ -1,43 +0,0 @@
|
||||
---
|
||||
-- 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
|
||||
Binary file not shown.
@ -1,33 +0,0 @@
|
||||
---
|
||||
-- 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 )
|
||||
|
||||
Binary file not shown.
@ -1,32 +0,0 @@
|
||||
---
|
||||
-- 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 )
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user