diff --git a/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.lua b/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.lua new file mode 100644 index 0000000000..5da1f240b5 --- /dev/null +++ b/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.lua @@ -0,0 +1,58 @@ +--- +-- 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 circles, rectangles, lines, arrows and text at arbitrary coordinates on the F10 map. +--- + +-- 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 600 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") \ No newline at end of file diff --git a/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.miz b/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.miz new file mode 100644 index 0000000000..3535890d18 Binary files /dev/null and b/ZON - Zones/ZON-520 - Draw Zones and Shapes/ZON-520 - Draw Zones and Shapes.miz differ diff --git a/ZON - Zones/ZON-520 - Draw Zones and Shapes/pack.ps1 b/ZON - Zones/ZON-520 - Draw Zones and Shapes/pack.ps1 new file mode 100644 index 0000000000..caa79efcaf --- /dev/null +++ b/ZON - Zones/ZON-520 - Draw Zones and Shapes/pack.ps1 @@ -0,0 +1,6 @@ +$dir = split-path -parent $MyInvocation.MyCommand.Definition +cd $dir +$file = Split-Path $dir -leaf +cd "_unpacked" +. 7z a -r -y -tzip "..\$file.miz" * +cd .. diff --git a/ZON - Zones/ZON-520 - Draw Zones and Shapes/unpack.ps1 b/ZON - Zones/ZON-520 - Draw Zones and Shapes/unpack.ps1 new file mode 100644 index 0000000000..0206e08131 --- /dev/null +++ b/ZON - Zones/ZON-520 - Draw Zones and Shapes/unpack.ps1 @@ -0,0 +1,7 @@ +$dir = split-path -parent $MyInvocation.MyCommand.Definition +cd $dir +$file = Split-Path $dir -leaf +Remove-Item .\_unpacked -Force -Recurse +md "_unpacked" +cd "_unpacked" +. 7z x -r -y "..\$file.miz" *