diff --git a/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.lua b/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.lua new file mode 100644 index 0000000..43eb18e --- /dev/null +++ b/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.lua @@ -0,0 +1,34 @@ +--- +-- Author: FlightControl +-- Created: 21.02.2017 +-- Contributors: kaltokri +-- Modified: 18.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html +-- +-- # Description: +-- +-- A ZONE has been defined in mission editor. It's boundaries are marked with white smoke. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving within the zone, a red smoke is placed at the vehicle location. +-- +-- # Guide: +-- +-- 1. Start the mission. +-- 2. Observe the zone perimeter. It should be marked with white smoke. +-- 3. Observe the vehicle. It should place red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Zone" ) + +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 ) diff --git a/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.miz b/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.miz new file mode 100644 index 0000000..23239be Binary files /dev/null and b/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.miz differ diff --git a/Core/Zone/101-Normal-Zone-Random-Point/ZON-101-Normal-Zone-Random-Point.lua b/Core/Zone/101-Normal-Zone-Random-Point/ZON-101-Normal-Zone-Random-Point.lua new file mode 100644 index 0000000..5cf2704 --- /dev/null +++ b/Core/Zone/101-Normal-Zone-Random-Point/ZON-101-Normal-Zone-Random-Point.lua @@ -0,0 +1,49 @@ +--- +-- Author: FlightControl +-- Created: 18.02.2017 +-- Contributors: kaltokri +-- Modified: 18.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html +-- +-- # Description: +-- +-- 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 by pressing F7. +-- +-- # Guide: +-- +-- 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 diff --git a/Core/Zone/101-Normal-Zone-Random-Point/ZON-101-Normal-Zone-Random-Point.miz b/Core/Zone/101-Normal-Zone-Random-Point/ZON-101-Normal-Zone-Random-Point.miz new file mode 100644 index 0000000..0da279e Binary files /dev/null and b/Core/Zone/101-Normal-Zone-Random-Point/ZON-101-Normal-Zone-Random-Point.miz differ diff --git a/Core/Zone/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.lua b/Core/Zone/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.lua new file mode 100644 index 0000000..5287795 --- /dev/null +++ b/Core/Zone/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.lua @@ -0,0 +1,36 @@ +--- +-- Author: FlightControl +-- Created: 21.02.2017 +-- Contributors: kaltokri +-- Modified: 18.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html +-- +-- # Description: +-- +-- A ZONE has been defined in mission editor. It's boundaries are marked with tires. +-- Take a look at the F10 map to see the tires. It may help to disable the lables in F10 map. +-- You can you to a tires with F12. +-- A vehicle is driving through the zone perimeters. +-- When the vehicle is driving within the zone, a red smoke is placed at the vehicle location. +-- +-- # Guide: +-- +-- 1. Start the mission. +-- 2. Observe the zone perimeter. It should be marked with tires. +-- 3. Observe the vehicle. It should place red smoke when driving through the zone. + +GroupInside = GROUP:FindByName( "Test Inside Zone" ) + +ZoneA = ZONE:New( "Zone A" ) +ZoneA:BoundZone( 90, country.id.USA ) + +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 ) diff --git a/Core/Zone/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.miz b/Core/Zone/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.miz new file mode 100644 index 0000000..fa9587d Binary files /dev/null and b/Core/Zone/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.miz differ