From bdecacf3e46222b381749da5ae76a572e955b083 Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Sun, 18 Feb 2024 20:53:32 +0000 Subject: [PATCH] ExtractMissionScripts --- .../100-Normal-Zone/ZON-100-Normal-Zone.lua | 68 ++++++------ .../ZON-101-Normal-Zone-Random-Point.lua | 98 ++++++++--------- .../ZON-102-Normal-Zone-Boundary.lua | 72 ++++++------- ...ON-103-Test-if-GROUP-object-is-in-ZONE.lua | 102 +++++++++--------- 4 files changed, 170 insertions(+), 170 deletions(-) diff --git a/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.lua b/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.lua index 43eb18e..cc922cd 100644 --- a/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.lua +++ b/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.lua @@ -1,34 +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 ) +--- +-- 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/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 index 5cf2704..122e640 100644 --- 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 @@ -1,49 +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 +--- +-- 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/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.lua b/Core/Zone/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.lua index 3a6d369..033874b 100644 --- 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 @@ -1,36 +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 ) +--- +-- 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/103-Test-if-GROUP-object-is-in-ZONE/ZON-103-Test-if-GROUP-object-is-in-ZONE.lua b/Core/Zone/103-Test-if-GROUP-object-is-in-ZONE/ZON-103-Test-if-GROUP-object-is-in-ZONE.lua index 9b1d5a1..5a48b35 100644 --- a/Core/Zone/103-Test-if-GROUP-object-is-in-ZONE/ZON-103-Test-if-GROUP-object-is-in-ZONE.lua +++ b/Core/Zone/103-Test-if-GROUP-object-is-in-ZONE/ZON-103-Test-if-GROUP-object-is-in-ZONE.lua @@ -1,51 +1,51 @@ ---- --- Author: FlightControl --- Created: 31.03.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/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Message.html --- --- A ZONE has been defined in mission editor. Three groups are placed in the area. --- The zone will be marked by white smoke and very group is marked by smoke in different colors. --- --- # Guide: --- --- 1. Start the mission. --- 2. Locate the zone marked with white smoke. --- 3. Search the different groups and their units. --- 4. Compare the situation with the messages. - -function SmokeEveryUnit( Group, Color ) - local units = Group:GetUnits() - for i, unit in ipairs(units) do - unit:Smoke( Color, nil, 2 ) - end -end - -GroupGreen = GROUP:FindByName( "GroupGreen" ) -GroupOrange = GROUP:FindByName( "GroupOrange" ) -GroupBlue = GROUP:FindByName( "GroupBlue" ) - -Zone = ZONE:New( "Zone" ) -Zone:SmokeZone( SMOKECOLOR.White, 90 ) - -SmokeEveryUnit(GroupBlue,SMOKECOLOR.Blue) -GroupBlue:MessageToAll( "Group is completely in Zone: " .. tostring( GroupBlue:IsCompletelyInZone( Zone ) ), 120 ) -GroupBlue:MessageToAll( "Group is partially in Zone: " .. tostring( GroupBlue:IsPartlyInZone( Zone ) ), 120 ) -GroupBlue:MessageToAll( "Group is not in Zone: " .. tostring( GroupBlue:IsNotInZone( Zone ) ), 120 ) -MESSAGE:New( "---", 120 ):ToAll() - -SmokeEveryUnit(GroupGreen,SMOKECOLOR.Green) -GroupGreen:MessageToAll( "Group is completely in Zone: " .. tostring( GroupGreen:IsCompletelyInZone( Zone ) ), 120 ) -GroupGreen:MessageToAll( "Group is partially in Zone: " .. tostring( GroupGreen:IsPartlyInZone( Zone ) ), 120 ) -GroupGreen:MessageToAll( "Group is not in Zone: " .. tostring( GroupGreen:IsNotInZone( Zone ) ), 120 ) -MESSAGE:New( "---", 120 ):ToAll() - -SmokeEveryUnit(GroupOrange,SMOKECOLOR.Orange) -GroupOrange:MessageToAll( "Group is completely in Zone: " .. tostring( GroupOrange:IsCompletelyInZone( Zone ) ), 120 ) -GroupOrange:MessageToAll( "Group is partially in Zone: " .. tostring( GroupOrange:IsPartlyInZone( Zone ) ), 120 ) -GroupOrange:MessageToAll( "Group is not in Zone: " .. tostring( GroupOrange:IsNotInZone( Zone ) ), 120 ) +--- +-- Author: FlightControl +-- Created: 31.03.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/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Message.html +-- +-- A ZONE has been defined in mission editor. Three groups are placed in the area. +-- The zone will be marked by white smoke and very group is marked by smoke in different colors. +-- +-- # Guide: +-- +-- 1. Start the mission. +-- 2. Locate the zone marked with white smoke. +-- 3. Search the different groups and their units. +-- 4. Compare the situation with the messages. + +function SmokeEveryUnit( Group, Color ) + local units = Group:GetUnits() + for i, unit in ipairs(units) do + unit:Smoke( Color, nil, 2 ) + end +end + +GroupGreen = GROUP:FindByName( "GroupGreen" ) +GroupOrange = GROUP:FindByName( "GroupOrange" ) +GroupBlue = GROUP:FindByName( "GroupBlue" ) + +Zone = ZONE:New( "Zone" ) +Zone:SmokeZone( SMOKECOLOR.White, 90 ) + +SmokeEveryUnit(GroupBlue,SMOKECOLOR.Blue) +GroupBlue:MessageToAll( "Group is completely in Zone: " .. tostring( GroupBlue:IsCompletelyInZone( Zone ) ), 120 ) +GroupBlue:MessageToAll( "Group is partially in Zone: " .. tostring( GroupBlue:IsPartlyInZone( Zone ) ), 120 ) +GroupBlue:MessageToAll( "Group is not in Zone: " .. tostring( GroupBlue:IsNotInZone( Zone ) ), 120 ) +MESSAGE:New( "---", 120 ):ToAll() + +SmokeEveryUnit(GroupGreen,SMOKECOLOR.Green) +GroupGreen:MessageToAll( "Group is completely in Zone: " .. tostring( GroupGreen:IsCompletelyInZone( Zone ) ), 120 ) +GroupGreen:MessageToAll( "Group is partially in Zone: " .. tostring( GroupGreen:IsPartlyInZone( Zone ) ), 120 ) +GroupGreen:MessageToAll( "Group is not in Zone: " .. tostring( GroupGreen:IsNotInZone( Zone ) ), 120 ) +MESSAGE:New( "---", 120 ):ToAll() + +SmokeEveryUnit(GroupOrange,SMOKECOLOR.Orange) +GroupOrange:MessageToAll( "Group is completely in Zone: " .. tostring( GroupOrange:IsCompletelyInZone( Zone ) ), 120 ) +GroupOrange:MessageToAll( "Group is partially in Zone: " .. tostring( GroupOrange:IsPartlyInZone( Zone ) ), 120 ) +GroupOrange:MessageToAll( "Group is not in Zone: " .. tostring( GroupOrange:IsNotInZone( Zone ) ), 120 )