mirror of
https://github.com/FlightControl-Master/MOOSE_Demos.git
synced 2025-08-15 10:37:47 +00:00
Updated Moose.lua
This commit is contained in:
@@ -1,46 +1,46 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 20.10.2018
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 22.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Beacon.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- This test mission demonstrates the BEACON class.
|
||||
-- The goal is to activate 2 types of beacons:
|
||||
-- - One TACAN beacon attach to an aircraft.
|
||||
-- - And one generic radio beacon attach to a ground UNIT (ADF).
|
||||
--
|
||||
-- The player aircraft needs to be ASM and TACAN compatible.
|
||||
-- Please replace the A-10CII by an aircraft you own and that is able receive TACAN signals.
|
||||
--
|
||||
-- Please note that we added the Morse.ogg file with a SOUND TO COUNTRY action and the first MISSION START trigger.
|
||||
-- Because there is no unit from Bulgaria in the mission, nobody will hear the sound. But ths way the file is part of
|
||||
-- the mission file and we can use it with MOOSE.
|
||||
|
||||
-- # Guide:
|
||||
-- 1. Enter A-10CII.
|
||||
-- 2. Tune in 252 on UHF radio. You will hear the morse code.
|
||||
-- 2. Switch UHF mode to ADF
|
||||
-- 3. Needle 1 will move to ~ 150° on HSI.
|
||||
-- 4. Switch back to BOTH and frequency 252 to avoid the beacon sound.
|
||||
-- 5. Set TACAN to A/A REC and channel to 4Y.
|
||||
-- 6. On NMSP activate TCN.
|
||||
-- 7. HSI should point to the moving aircraft.
|
||||
|
||||
-- Create our UNIT objects on which we'll attach a BEACON.
|
||||
local Aircraft = UNIT:FindByName("Unit1")
|
||||
local LandUnit = UNIT:FindByName("Unit2")
|
||||
|
||||
-- Now, let's start with the TACAN Beacon.
|
||||
-- This particular TACAN can be homed on.
|
||||
local BeaconAircraft = Aircraft:GetBeacon()
|
||||
BeaconAircraft:ActivateTACAN(4, "Y", "UNIT1", true)
|
||||
|
||||
-- And let's setup the ground based radio beacon (ADF).
|
||||
-- Notice how this beacon will stop in 320 sec (last parameter).
|
||||
local BeaconLand = LandUnit:GetBeacon()
|
||||
BeaconLand:RadioBeacon("Morse.ogg", 252, radio.modulation.AM, 100, 320) -- File, frequency, modulation, power, timeout
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 20.10.2018
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 22.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Beacon.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- This test mission demonstrates the BEACON class.
|
||||
-- The goal is to activate 2 types of beacons:
|
||||
-- - One TACAN beacon attach to an aircraft.
|
||||
-- - And one generic radio beacon attach to a ground UNIT (ADF).
|
||||
--
|
||||
-- The player aircraft needs to be ASM and TACAN compatible.
|
||||
-- Please replace the A-10CII by an aircraft you own and that is able receive TACAN signals.
|
||||
--
|
||||
-- Please note that we added the Morse.ogg file with a SOUND TO COUNTRY action and the first MISSION START trigger.
|
||||
-- Because there is no unit from Bulgaria in the mission, nobody will hear the sound. But ths way the file is part of
|
||||
-- the mission file and we can use it with MOOSE.
|
||||
|
||||
-- # Guide:
|
||||
-- 1. Enter A-10CII.
|
||||
-- 2. Tune in 252 on UHF radio. You will hear the morse code.
|
||||
-- 2. Switch UHF mode to ADF
|
||||
-- 3. Needle 1 will move to ~ 150° on HSI.
|
||||
-- 4. Switch back to BOTH and frequency 252 to avoid the beacon sound.
|
||||
-- 5. Set TACAN to A/A REC and channel to 4Y.
|
||||
-- 6. On NMSP activate TCN.
|
||||
-- 7. HSI should point to the moving aircraft.
|
||||
|
||||
-- Create our UNIT objects on which we'll attach a BEACON.
|
||||
local Aircraft = UNIT:FindByName("Unit1")
|
||||
local LandUnit = UNIT:FindByName("Unit2")
|
||||
|
||||
-- Now, let's start with the TACAN Beacon.
|
||||
-- This particular TACAN can be homed on.
|
||||
local BeaconAircraft = Aircraft:GetBeacon()
|
||||
BeaconAircraft:ActivateTACAN(4, "Y", "UNIT1", true)
|
||||
|
||||
-- And let's setup the ground based radio beacon (ADF).
|
||||
-- Notice how this beacon will stop in 320 sec (last parameter).
|
||||
local BeaconLand = LandUnit:GetBeacon()
|
||||
BeaconLand:RadioBeacon("Morse.ogg", 252, radio.modulation.AM, 100, 320) -- File, frequency, modulation, power, timeout
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,39 +1,39 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 21.05.2018
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.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.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Now I can find the zone instead of doing ZONE:New, because the ZONE object is already in MOOSE.
|
||||
ZoneA = ZONE:FindByName( "Zone" )
|
||||
ZoneA:SmokeZone( SMOKECOLOR.White, 30 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( ZoneA ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 21.05.2018
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.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.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Now I can find the zone instead of doing ZONE:New, because the ZONE object is already in MOOSE.
|
||||
ZoneA = ZONE:FindByName( "Zone" )
|
||||
ZoneA:SmokeZone( SMOKECOLOR.White, 30 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( ZoneA ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
|
||||
Binary file not shown.
@@ -1,33 +1,33 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 08.10.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- This test mission demonstrates how to get all SCENERY objects within a given zone.
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission and watch the messages with the informations of the found objects.
|
||||
--
|
||||
-- Note: You can resice and move the zone in mission editor to inspect different locations.
|
||||
-- Important: IDs of SCENERY objects often change on terrain updates!
|
||||
|
||||
ZoneToScan = ZONE:New( "Zone" )
|
||||
ZoneToScan:DrawZone() -- Show the zone in F10 map, so it is easy to see.
|
||||
|
||||
-- Scan for all objects which are of category SCENERY
|
||||
ZoneToScan:Scan( Object.Category.SCENERY )
|
||||
|
||||
-- Process the result of the scan and print a message for each object.
|
||||
for SceneryTypeName, SceneryData in pairs( ZoneToScan: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
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 08.10.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- This test mission demonstrates how to get all SCENERY objects within a given zone.
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission and watch the messages with the informations of the found objects.
|
||||
--
|
||||
-- Note: You can resice and move the zone in mission editor to inspect different locations.
|
||||
-- Important: IDs of SCENERY objects often change on terrain updates!
|
||||
|
||||
ZoneToScan = ZONE:New( "Zone" )
|
||||
ZoneToScan:DrawZone() -- Show the zone in F10 map, so it is easy to see.
|
||||
|
||||
-- Scan for all objects which are of category SCENERY
|
||||
ZoneToScan:Scan( Object.Category.SCENERY )
|
||||
|
||||
-- Process the result of the scan and print a message for each object.
|
||||
for SceneryTypeName, SceneryData in pairs( ZoneToScan: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.
@@ -1,51 +1,51 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 21.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A group of trucks will move straigth into one direction.
|
||||
-- We define a ZONE_GROUP which is a round zone around a group. It will move with the group leader.
|
||||
-- To make the zone visible in the mission we use FlareZone.
|
||||
--
|
||||
-- An APC is driving zigzags through the terrain. If it is within the moving zone red smoke will be deployed.
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission and watch the moving truck convoy.
|
||||
-- 2. See the recurring deployed flare to get an idea of the actual zone bounderies.
|
||||
-- 3. Watch the APC driving trough the zone, a red smoke will be deployed.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get object of moving truck convoi.
|
||||
GroupTrucks = GROUP:FindByName( "Trucks" )
|
||||
|
||||
-- Get a zone attached to the group.
|
||||
ZoneA = ZONE_GROUP:New( "ZoneA", GroupTrucks, 100 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( ZoneA ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
|
||||
-- Start a scheduler to deploy a flare every 5 seconds to give you an idea of the actual zone bounderies.
|
||||
TrucksZoneColoring = SCHEDULER:New( nil,
|
||||
function()
|
||||
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
||||
end,
|
||||
{}, 0, 5
|
||||
)
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 21.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A group of trucks will move straigth into one direction.
|
||||
-- We define a ZONE_GROUP which is a round zone around a group. It will move with the group leader.
|
||||
-- To make the zone visible in the mission we use FlareZone.
|
||||
--
|
||||
-- An APC is driving zigzags through the terrain. If it is within the moving zone red smoke will be deployed.
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission and watch the moving truck convoy.
|
||||
-- 2. See the recurring deployed flare to get an idea of the actual zone bounderies.
|
||||
-- 3. Watch the APC driving trough the zone, a red smoke will be deployed.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get object of moving truck convoi.
|
||||
GroupTrucks = GROUP:FindByName( "Trucks" )
|
||||
|
||||
-- Get a zone attached to the group.
|
||||
ZoneA = ZONE_GROUP:New( "ZoneA", GroupTrucks, 100 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( ZoneA ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
|
||||
-- Start a scheduler to deploy a flare every 5 seconds to give you an idea of the actual zone bounderies.
|
||||
TrucksZoneColoring = SCHEDULER:New( nil,
|
||||
function()
|
||||
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
||||
end,
|
||||
{}, 0, 5
|
||||
)
|
||||
|
||||
Binary file not shown.
@@ -1,52 +1,52 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 18.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- Three groups of firefighters are placed.
|
||||
-- We define a ZONE_GROUP for each group, mark the border with white smoke and place 15 smokes inside of each zone.
|
||||
-- We use different methods to choose a random point:
|
||||
-- - 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: At each zone an vehicle is placed, so you can view the smoking in external view (F7).
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission. Zoom out and switch position with F7.
|
||||
-- 2. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 3. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 4. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
-- Get all three ZONE_GROUPs:
|
||||
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 )
|
||||
|
||||
-- Add white smoke to the borders of the zones:
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
-- Mark 15 random points with smock inside each zone.
|
||||
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: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- Three groups of firefighters are placed.
|
||||
-- We define a ZONE_GROUP for each group, mark the border with white smoke and place 15 smokes inside of each zone.
|
||||
-- We use different methods to choose a random point:
|
||||
-- - 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: At each zone an vehicle is placed, so you can view the smoking in external view (F7).
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission. Zoom out and switch position with F7.
|
||||
-- 2. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 3. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 4. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
-- Get all three ZONE_GROUPs:
|
||||
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 )
|
||||
|
||||
-- Add white smoke to the borders of the zones:
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
-- Mark 15 random points with smock inside each zone.
|
||||
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,51 +1,51 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 21.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A single truck will move straigth into one direction.
|
||||
-- We define a ZONE_UNIT which is a round zone around a unit. It will move with the unit.
|
||||
-- To make the zone visible in the mission we use FlareZone.
|
||||
--
|
||||
-- An APC is driving zigzags through the terrain. If it is within the moving zone red smoke will be deployed.
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission and watch the moving truck.
|
||||
-- 2. See the recurring deployed flare to get an idea of the actual zone bounderies.
|
||||
-- 3. Watch the APC driving trough the zone, a red smoke will be deployed.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get object of moving truck.
|
||||
Truck = UNIT:FindByName( "Truck" )
|
||||
|
||||
-- Get a zone attached to the unit.
|
||||
ZoneA = ZONE_UNIT:New( "Zone A", Truck, 100 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( ZoneA ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
|
||||
-- Start a scheduler to deploy a flare every 5 seconds to give you an idea of the actual zone bounderies.
|
||||
TankZoneColoring = SCHEDULER:New( nil,
|
||||
function()
|
||||
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
||||
end,
|
||||
{}, 0, 5
|
||||
)
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 21.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A single truck will move straigth into one direction.
|
||||
-- We define a ZONE_UNIT which is a round zone around a unit. It will move with the unit.
|
||||
-- To make the zone visible in the mission we use FlareZone.
|
||||
--
|
||||
-- An APC is driving zigzags through the terrain. If it is within the moving zone red smoke will be deployed.
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission and watch the moving truck.
|
||||
-- 2. See the recurring deployed flare to get an idea of the actual zone bounderies.
|
||||
-- 3. Watch the APC driving trough the zone, a red smoke will be deployed.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get object of moving truck.
|
||||
Truck = UNIT:FindByName( "Truck" )
|
||||
|
||||
-- Get a zone attached to the unit.
|
||||
ZoneA = ZONE_UNIT:New( "Zone A", Truck, 100 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( ZoneA ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
|
||||
-- Start a scheduler to deploy a flare every 5 seconds to give you an idea of the actual zone bounderies.
|
||||
TankZoneColoring = SCHEDULER:New( nil,
|
||||
function()
|
||||
ZoneA:FlareZone( FLARECOLOR.White, 90, 60 )
|
||||
end,
|
||||
{}, 0, 5
|
||||
)
|
||||
|
||||
Binary file not shown.
@@ -1,52 +1,52 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 18.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- Three firefighters are placed.
|
||||
-- We define a ZONE_UNIT for each firefighter, mark the border with white smoke and place 15 smokes inside of each zone.
|
||||
-- We use different methods to choose a random point:
|
||||
-- - 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: At each zone an vehicle is placed, so you can view the smoking in external view (F7).
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission. Zoom out and switch position with F7.
|
||||
-- 2. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 3. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 4. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
-- Get all three ZONE_UNITs:
|
||||
Zone1 = ZONE_UNIT:New( "Zone 1", UNIT:FindByName( "Unit1" ), 300 )
|
||||
Zone2 = ZONE_UNIT:New( "Zone 2", UNIT:FindByName( "Unit2" ), 300 )
|
||||
Zone3 = ZONE_UNIT:New( "Zone 3", UNIT:FindByName( "Unit3" ), 300 )
|
||||
|
||||
-- Add white smoke to the borders of the zones:
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
-- Mark 15 random points with smock inside each zone.
|
||||
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: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- Three firefighters are placed.
|
||||
-- We define a ZONE_UNIT for each firefighter, mark the border with white smoke and place 15 smokes inside of each zone.
|
||||
-- We use different methods to choose a random point:
|
||||
-- - 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: At each zone an vehicle is placed, so you can view the smoking in external view (F7).
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission. Zoom out and switch position with F7.
|
||||
-- 2. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 3. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 4. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
-- Get all three ZONE_UNITs:
|
||||
Zone1 = ZONE_UNIT:New( "Zone 1", UNIT:FindByName( "Unit1" ), 300 )
|
||||
Zone2 = ZONE_UNIT:New( "Zone 2", UNIT:FindByName( "Unit2" ), 300 )
|
||||
Zone3 = ZONE_UNIT:New( "Zone 3", UNIT:FindByName( "Unit3" ), 300 )
|
||||
|
||||
-- Add white smoke to the borders of the zones:
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
-- Mark 15 random points with smock inside each zone.
|
||||
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,41 +1,41 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 21.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A ZONE_RADIUS has been defined. It's boundaries are marked with white smoke.
|
||||
-- Center of the zone is placed on the postion of a bunker.
|
||||
-- A vehicle is driving through the zone perimeters.
|
||||
-- When the vehicle is driving inside of the zone, a red smoke is placed on the vehicle location.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Watch the APC driving trough the zone, a red smoke will be deployed.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get object of the bunker.
|
||||
Bunker = STATIC:FindByName( "Bunker" )
|
||||
|
||||
-- Get a zone around the bunker object and mark it with smoke.
|
||||
ZoneA = ZONE_RADIUS:New( "Zone A", Bunker:GetVec2(), 300 )
|
||||
ZoneA:SmokeZone( SMOKECOLOR.White, 90 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( ZoneA ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 21.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A ZONE_RADIUS has been defined. It's boundaries are marked with white smoke.
|
||||
-- Center of the zone is placed on the postion of a bunker.
|
||||
-- A vehicle is driving through the zone perimeters.
|
||||
-- When the vehicle is driving inside of the zone, a red smoke is placed on the vehicle location.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Watch the APC driving trough the zone, a red smoke will be deployed.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get object of the bunker.
|
||||
Bunker = STATIC:FindByName( "Bunker" )
|
||||
|
||||
-- Get a zone around the bunker object and mark it with smoke.
|
||||
ZoneA = ZONE_RADIUS:New( "Zone A", Bunker:GetVec2(), 300 )
|
||||
ZoneA:SmokeZone( SMOKECOLOR.White, 90 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( ZoneA ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
|
||||
Binary file not shown.
@@ -1,58 +1,58 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 18.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- Three firefighters are placed.
|
||||
-- We define a ZONE_RADIUS and use the position of the units (GetVec2) as center.
|
||||
-- We mark the border of each zone with white smoke and place 15 smokes inside of each zone.
|
||||
-- We use different methods to choose a random point:
|
||||
-- - 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: At each zone an vehicle is placed, so you can view the smoking in external view (F7).
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission. Zoom out and switch position with F7.
|
||||
-- 2. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 3. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 4. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
-- Get all three UNITs:
|
||||
Unit1 = UNIT:FindByName( "Unit1" )
|
||||
Unit2 = UNIT:FindByName( "Unit2" )
|
||||
Unit3 = UNIT:FindByName( "Unit3" )
|
||||
|
||||
-- Get all three ZONE_RADIUS on unit positions:
|
||||
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 )
|
||||
|
||||
-- Add white smoke to the borders of the zones:
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
-- Mark 15 random points with smock inside each zone.
|
||||
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: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- Three firefighters are placed.
|
||||
-- We define a ZONE_RADIUS and use the position of the units (GetVec2) as center.
|
||||
-- We mark the border of each zone with white smoke and place 15 smokes inside of each zone.
|
||||
-- We use different methods to choose a random point:
|
||||
-- - 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: At each zone an vehicle is placed, so you can view the smoking in external view (F7).
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission. Zoom out and switch position with F7.
|
||||
-- 2. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 3. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 4. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
-- Get all three UNITs:
|
||||
Unit1 = UNIT:FindByName( "Unit1" )
|
||||
Unit2 = UNIT:FindByName( "Unit2" )
|
||||
Unit3 = UNIT:FindByName( "Unit3" )
|
||||
|
||||
-- Get all three ZONE_RADIUS on unit positions:
|
||||
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 )
|
||||
|
||||
-- Add white smoke to the borders of the zones:
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 18 )
|
||||
|
||||
-- Mark 15 random points with smock inside each zone.
|
||||
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,42 +1,42 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 18.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are smoking.
|
||||
-- The polygon is defined by the waypoint of a BTR-80, whith activated 'LATE ACTIVATION'
|
||||
-- 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. Start the mission and watch the APC driving trough the zone.
|
||||
-- 2. A red smoke will be deployed within the zone.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get object of the unit with waypoints.
|
||||
GroupPolygon = GROUP:FindByName( "Polygon" )
|
||||
|
||||
-- Get a polygon zone and smoke the borders.
|
||||
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
||||
PolygonZone:SmokeZone( SMOKECOLOR.White, 20 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 18.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are smoking.
|
||||
-- The polygon is defined by the waypoint of a BTR-80, whith activated 'LATE ACTIVATION'
|
||||
-- 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. Start the mission and watch the APC driving trough the zone.
|
||||
-- 2. A red smoke will be deployed within the zone.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get object of the unit with waypoints.
|
||||
GroupPolygon = GROUP:FindByName( "Polygon" )
|
||||
|
||||
-- Get a polygon zone and smoke the borders.
|
||||
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
||||
PolygonZone:SmokeZone( SMOKECOLOR.White, 20 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
|
||||
Binary file not shown.
@@ -1,52 +1,52 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 18.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- Three firefighters are placed.
|
||||
-- We define a ZONE_POLYGON for each and use the waypoints as the shape.
|
||||
-- We use different methods to choose a random point:
|
||||
-- - 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: At each zone an vehicle is placed, so you can view the smoking in external view (F7).
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission. Zoom out and switch position with F7.
|
||||
-- 2. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 3. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 4. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
-- Get all three ZONE_POLYGON from the groups:
|
||||
Zone1 = ZONE_POLYGON:New( "Zone 1", GROUP:FindByName( "GroupA" ) )
|
||||
Zone2 = ZONE_POLYGON:New( "Zone 2", GROUP:FindByName( "GroupB" ) )
|
||||
Zone3 = ZONE_POLYGON:New( "Zone 3", GROUP:FindByName( "GroupC" ) )
|
||||
|
||||
-- Add white smoke to the borders of the zones:
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
|
||||
-- Mark 15 random points with smock inside each zone.
|
||||
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: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- Three firefighters are placed.
|
||||
-- We define a ZONE_POLYGON for each and use the waypoints as the shape.
|
||||
-- We use different methods to choose a random point:
|
||||
-- - 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: At each zone an vehicle is placed, so you can view the smoking in external view (F7).
|
||||
--
|
||||
-- # Guide:
|
||||
--
|
||||
-- 1. Start the mission. Zoom out and switch position with F7.
|
||||
-- 2. Observe smoking of Blue smoke in Zone 1.
|
||||
-- 3. Observe smoking of Orange smoke in Zone 2.
|
||||
-- 4. Observe smoking of Red smoke in Zone 3.
|
||||
|
||||
-- Get all three ZONE_POLYGON from the groups:
|
||||
Zone1 = ZONE_POLYGON:New( "Zone 1", GROUP:FindByName( "GroupA" ) )
|
||||
Zone2 = ZONE_POLYGON:New( "Zone 2", GROUP:FindByName( "GroupB" ) )
|
||||
Zone3 = ZONE_POLYGON:New( "Zone 3", GROUP:FindByName( "GroupC" ) )
|
||||
|
||||
-- Add white smoke to the borders of the zones:
|
||||
Zone1:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
Zone2:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
Zone3:SmokeZone( SMOKECOLOR.White, 4 )
|
||||
|
||||
-- Mark 15 random points with smock inside each zone.
|
||||
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,42 +1,42 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 18.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are marked with tires.
|
||||
-- The polygon is defined by the waypoint of a BTR-80, whith activated 'LATE ACTIVATION'
|
||||
-- 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. Start the mission and watch the APC driving trough the zone.
|
||||
-- 2. A red smoke will be deployed within the zone.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get object of the unit with waypoints.
|
||||
GroupPolygon = GROUP:FindByName( "Polygon" )
|
||||
|
||||
-- Get a polygon zone and mark the with tires (see F10 map).
|
||||
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
||||
PolygonZone:BoundZone()
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 18.02.2017
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are marked with tires.
|
||||
-- The polygon is defined by the waypoint of a BTR-80, whith activated 'LATE ACTIVATION'
|
||||
-- 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. Start the mission and watch the APC driving trough the zone.
|
||||
-- 2. A red smoke will be deployed within the zone.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get object of the unit with waypoints.
|
||||
GroupPolygon = GROUP:FindByName( "Polygon" )
|
||||
|
||||
-- Get a polygon zone and mark the with tires (see F10 map).
|
||||
PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
|
||||
PolygonZone:BoundZone()
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
|
||||
Binary file not shown.
@@ -1,39 +1,39 @@
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 21.05.2018
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are smoking.
|
||||
-- The polygon is defined by the waypoints of a BTR-80, whith activated 'LATE ACTIVATION'
|
||||
-- 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. Start the mission and watch the APC driving trough the zone.
|
||||
-- 2. A red smoke will be deployed within the zone.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get a polygon zone and smoke the borders. This time with function FindByName!
|
||||
PolygonZone = ZONE_POLYGON:FindByName( "Polygon A" )
|
||||
PolygonZone:SmokeZone( SMOKECOLOR.White, 10 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
---
|
||||
-- Author: FlightControl
|
||||
-- Created: 21.05.2018
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.02.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are smoking.
|
||||
-- The polygon is defined by the waypoints of a BTR-80, whith activated 'LATE ACTIVATION'
|
||||
-- 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. Start the mission and watch the APC driving trough the zone.
|
||||
-- 2. A red smoke will be deployed within the zone.
|
||||
|
||||
-- Get object for APC.
|
||||
GroupApc = GROUP:FindByName( "APC" )
|
||||
|
||||
-- Get a polygon zone and smoke the borders. This time with function FindByName!
|
||||
PolygonZone = ZONE_POLYGON:FindByName( "Polygon A" )
|
||||
PolygonZone:SmokeZone( SMOKECOLOR.White, 10 )
|
||||
|
||||
-- Start a scheduler to test every second if the APC is inside of the zone.
|
||||
-- Post a message with the result and deploy smoke if APC is within the zone.
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupApc:MessageToAll( ( GroupApc:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupApc:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupApc:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1
|
||||
)
|
||||
|
||||
Binary file not shown.
@@ -1,70 +1,70 @@
|
||||
---
|
||||
-- Author: Applevangelist
|
||||
-- Created: 13.05.2021
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.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:
|
||||
--
|
||||
-- This demo mission illustrates how to draw zones (circular and polygon) defined in the Mission Editor on the F10 map.
|
||||
-- Furthermore, it shows how to create cicles, rectangled, lines, arrows and text at arbitrary coordinates on the F10 map.
|
||||
--
|
||||
-- # Guide:
|
||||
-- 1. Start the mission and join as Observer.
|
||||
-- 2. Zoom out and find all the different drawings.
|
||||
|
||||
-- Circular zone defined in the ME.
|
||||
local circzone=ZONE:New("Circular Zone")
|
||||
|
||||
-- Draw the zone on the F10 map. Colors are taken from the ME settings.
|
||||
circzone:DrawZone()
|
||||
|
||||
-- Quad-point zone defined in the ME.
|
||||
local quadzone=ZONE:New("Quad Zone") --Core.Zone#ZONE_POLYGON_BASE
|
||||
|
||||
-- Draw the zone on the F10 map. Colors are taken from the ME settings.
|
||||
quadzone:DrawZone()
|
||||
|
||||
-- After 500 seconds, the drawing is removed.
|
||||
quadzone:UndrawZone(500)
|
||||
|
||||
|
||||
-- Polygon zone defined by waypoints of the group "Rotary-1". This surrounds a lake near Poti.
|
||||
local polyzone=ZONE_POLYGON:NewFromGroupName("Rotary-1")
|
||||
|
||||
-- Draw the zone. Line color is green, fill color is turquoise with 50% alpha. Line type is dashed.
|
||||
polyzone:DrawZone(-1, {0,1,0}, 1.0, {0,1,1}, 0.5, 2)
|
||||
|
||||
|
||||
-- Get coordinates of some airbases of the map.
|
||||
local coordBatumi=AIRBASE:FindByName("Batumi"):GetCoordinate()
|
||||
local coordKobuleti=AIRBASE:FindByName("Kobuleti"):GetCoordinate()
|
||||
local coordGudauta=AIRBASE:FindByName(AIRBASE.Caucasus.Gudauta):GetCoordinate()
|
||||
local coordKrymsk=AIRBASE:FindByName(AIRBASE.Caucasus.Krymsk):GetCoordinate()
|
||||
local coordBeslan=AIRBASE:FindByName(AIRBASE.Caucasus.Beslan):GetCoordinate()
|
||||
local coordNalchik=AIRBASE:FindByName(AIRBASE.Caucasus.Nalchik):GetCoordinate()
|
||||
local coordMinVody=AIRBASE:FindByName(AIRBASE.Caucasus.Mineralnye_Vody):GetCoordinate()
|
||||
local coordMozdok=AIRBASE:FindByName(AIRBASE.Caucasus.Mozdok):GetCoordinate()
|
||||
|
||||
|
||||
-- Draw a circle with 15 km radius around Krymsk Airbase.
|
||||
coordKrymsk:CircleToAll(15000)
|
||||
|
||||
-- Draw a rectancle. First corner is Gudauta. Opposite corner is 30000 meters in heading 135 degrees.
|
||||
coordGudauta:RectToAll(coordGudauta:Translate(30000, 135))
|
||||
|
||||
-- Draw a quad-point shape. Corners are defined by the airbases.
|
||||
coordBeslan:QuadToAll(coordNalchik, coordMinVody, coordMozdok, nil, {1,0,1}, nil, {0,1,0}, 0.8, 4)
|
||||
|
||||
-- Draw a blue line from Mozdok to Krymsk.
|
||||
coordMozdok:LineToAll(coordKrymsk, nil, {0,0,1})
|
||||
|
||||
-- Draw a green arrow from Batumi to a ship group called "Naval-1". This arrow is only visible to the blue coalition.
|
||||
coordBatumi:ArrowToAll(GROUP:FindByName("Naval-1"):GetCoordinate(), 2, {0,1,0})
|
||||
|
||||
-- Write text "Target Warehouse" at position of a static warehouse.
|
||||
STATIC:FindByName("Static Warehouse-1"):GetCoordinate():TextToAll("Target Warehouse")
|
||||
---
|
||||
-- Author: Applevangelist
|
||||
-- Created: 13.05.2021
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 23.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:
|
||||
--
|
||||
-- This demo mission illustrates how to draw zones (circular and polygon) defined in the Mission Editor on the F10 map.
|
||||
-- Furthermore, it shows how to create cicles, rectangled, lines, arrows and text at arbitrary coordinates on the F10 map.
|
||||
--
|
||||
-- # Guide:
|
||||
-- 1. Start the mission and join as Observer.
|
||||
-- 2. Zoom out and find all the different drawings.
|
||||
|
||||
-- Circular zone defined in the ME.
|
||||
local circzone=ZONE:New("Circular Zone")
|
||||
|
||||
-- Draw the zone on the F10 map. Colors are taken from the ME settings.
|
||||
circzone:DrawZone()
|
||||
|
||||
-- Quad-point zone defined in the ME.
|
||||
local quadzone=ZONE:New("Quad Zone") --Core.Zone#ZONE_POLYGON_BASE
|
||||
|
||||
-- Draw the zone on the F10 map. Colors are taken from the ME settings.
|
||||
quadzone:DrawZone()
|
||||
|
||||
-- After 500 seconds, the drawing is removed.
|
||||
quadzone:UndrawZone(500)
|
||||
|
||||
|
||||
-- Polygon zone defined by waypoints of the group "Rotary-1". This surrounds a lake near Poti.
|
||||
local polyzone=ZONE_POLYGON:NewFromGroupName("Rotary-1")
|
||||
|
||||
-- Draw the zone. Line color is green, fill color is turquoise with 50% alpha. Line type is dashed.
|
||||
polyzone:DrawZone(-1, {0,1,0}, 1.0, {0,1,1}, 0.5, 2)
|
||||
|
||||
|
||||
-- Get coordinates of some airbases of the map.
|
||||
local coordBatumi=AIRBASE:FindByName("Batumi"):GetCoordinate()
|
||||
local coordKobuleti=AIRBASE:FindByName("Kobuleti"):GetCoordinate()
|
||||
local coordGudauta=AIRBASE:FindByName(AIRBASE.Caucasus.Gudauta):GetCoordinate()
|
||||
local coordKrymsk=AIRBASE:FindByName(AIRBASE.Caucasus.Krymsk):GetCoordinate()
|
||||
local coordBeslan=AIRBASE:FindByName(AIRBASE.Caucasus.Beslan):GetCoordinate()
|
||||
local coordNalchik=AIRBASE:FindByName(AIRBASE.Caucasus.Nalchik):GetCoordinate()
|
||||
local coordMinVody=AIRBASE:FindByName(AIRBASE.Caucasus.Mineralnye_Vody):GetCoordinate()
|
||||
local coordMozdok=AIRBASE:FindByName(AIRBASE.Caucasus.Mozdok):GetCoordinate()
|
||||
|
||||
|
||||
-- Draw a circle with 15 km radius around Krymsk Airbase.
|
||||
coordKrymsk:CircleToAll(15000)
|
||||
|
||||
-- Draw a rectancle. First corner is Gudauta. Opposite corner is 30000 meters in heading 135 degrees.
|
||||
coordGudauta:RectToAll(coordGudauta:Translate(30000, 135))
|
||||
|
||||
-- Draw a quad-point shape. Corners are defined by the airbases.
|
||||
coordBeslan:QuadToAll(coordNalchik, coordMinVody, coordMozdok, nil, {1,0,1}, nil, {0,1,0}, 0.8, 4)
|
||||
|
||||
-- Draw a blue line from Mozdok to Krymsk.
|
||||
coordMozdok:LineToAll(coordKrymsk, nil, {0,0,1})
|
||||
|
||||
-- Draw a green arrow from Batumi to a ship group called "Naval-1". This arrow is only visible to the blue coalition.
|
||||
coordBatumi:ArrowToAll(GROUP:FindByName("Naval-1"):GetCoordinate(), 2, {0,1,0})
|
||||
|
||||
-- Write text "Target Warehouse" at position of a static warehouse.
|
||||
STATIC:FindByName("Static Warehouse-1"):GetCoordinate():TextToAll("Target Warehouse")
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user