diff --git a/Core/Beacon/010-Beacons/RAD-010-Beacons.miz b/Core/Beacon/010-Beacons/RAD-010-Beacons.miz index 3cee41d..5b849ab 100644 Binary files a/Core/Beacon/010-Beacons/RAD-010-Beacons.miz and b/Core/Beacon/010-Beacons/RAD-010-Beacons.miz differ diff --git a/Core/SpawnStatic/010-Simple-Spawning/SPS-010-Simple-Spawning.lua b/Core/SpawnStatic/010-Simple-Spawning/SPS-010-Simple-Spawning.lua index 6f2234c..e983f00 100644 --- a/Core/SpawnStatic/010-Simple-Spawning/SPS-010-Simple-Spawning.lua +++ b/Core/SpawnStatic/010-Simple-Spawning/SPS-010-Simple-Spawning.lua @@ -1,41 +1,41 @@ ---- --- Author: FlightControl --- Created: 09.04.2017 --- Contributors: kaltokri --- Modified: 01.03.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html --- --- # Description: --- --- In this mission we spawn a static near Gudauta. --- Around this object we create two circles with containers to mark the target area. --- NOTE: Instead of a STATIC object you can also use other objects (like UNITS) to define the center position! --- --- # Guide: --- --- 1. Observe that the static is spawned. - --- Get object of ZONE placed in mission editor. -local zonePosition = ZONE:New( "Position" ) - --- Create SPAWNSTATIC objects. -local spawnCommandCenter = SPAWNSTATIC:NewFromStatic( "CommandCenter", country.id.GERMANY ) -local spawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY ) - --- Get the position of the zone. -local zonePointVec2 = zonePosition:GetPointVec2() - --- Spawn the CommandCenter in the center of the zone. -local commandCenter = spawnCommandCenter:SpawnFromZone( zonePosition, 0 ) - --- Create 6 barracks around the CommandCenter. -for Heading = 0, 360, 60 do - local radial = Heading * ( math.pi*2 ) / 360 - local x = zonePointVec2:GetLat() + math.cos( radial ) * 150 - local y = zonePointVec2:GetLon() + math.sin( radial ) * 150 - spawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 ) -end +--- +-- Author: FlightControl +-- Created: 09.04.2017 +-- Contributors: kaltokri +-- Modified: 01.03.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html +-- +-- # Description: +-- +-- In this mission we spawn a static near Gudauta. +-- Around this object we create two circles with containers to mark the target area. +-- NOTE: Instead of a STATIC object you can also use other objects (like UNITS) to define the center position! +-- +-- # Guide: +-- +-- 1. Observe that the static is spawned. + +-- Get object of ZONE placed in mission editor. +local zonePosition = ZONE:New( "Position" ) + +-- Create SPAWNSTATIC objects. +local spawnCommandCenter = SPAWNSTATIC:NewFromStatic( "CommandCenter", country.id.GERMANY ) +local spawnBarrack = SPAWNSTATIC:NewFromStatic( "Barrack", country.id.GERMANY ) + +-- Get the position of the zone. +local zonePointVec2 = zonePosition:GetPointVec2() + +-- Spawn the CommandCenter in the center of the zone. +local commandCenter = spawnCommandCenter:SpawnFromZone( zonePosition, 0 ) + +-- Create 6 barracks around the CommandCenter. +for Heading = 0, 360, 60 do + local radial = Heading * ( math.pi*2 ) / 360 + local x = zonePointVec2:GetLat() + math.cos( radial ) * 150 + local y = zonePointVec2:GetLon() + math.sin( radial ) * 150 + spawnBarrack:SpawnFromPointVec2( POINT_VEC2:New( x, y ), Heading + 90 ) +end diff --git a/Core/SpawnStatic/010-Simple-Spawning/SPS-010-Simple-Spawning.miz b/Core/SpawnStatic/010-Simple-Spawning/SPS-010-Simple-Spawning.miz index 433818a..16d96b3 100644 Binary files a/Core/SpawnStatic/010-Simple-Spawning/SPS-010-Simple-Spawning.miz and b/Core/SpawnStatic/010-Simple-Spawning/SPS-010-Simple-Spawning.miz differ diff --git a/Core/SpawnStatic/020-Mark-target-with-containers/SPS-020-Mark-target-with-containers.lua b/Core/SpawnStatic/020-Mark-target-with-containers/SPS-020-Mark-target-with-containers.lua index 4e73757..d7f9aa5 100644 --- a/Core/SpawnStatic/020-Mark-target-with-containers/SPS-020-Mark-target-with-containers.lua +++ b/Core/SpawnStatic/020-Mark-target-with-containers/SPS-020-Mark-target-with-containers.lua @@ -1,57 +1,57 @@ ---- --- Author: buur --- Created: 29.02.2024 --- Contributors: kaltokri --- Modified: 01.03.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html --- --- # Description: --- --- In this mission we search for a placed container with the UNIT name CircleCenterContainer. --- Around this object we create two circles with containers to mark the target area. --- NOTE: Instead of a STATIC object you can also use other objects (like UNITS) to define the center position! --- --- # Guide: --- --- 1. Start the mission and take a look at the placed containers. - ---- Creates a circle with static objects around a given coordinate. --- @param Core.Point#COORDINATE circleCenter The coordinate for the center of the circle. --- @param #number radius (Optional) The radius of the circle. Default 150. --- @param #number step (Optional) The distance in degrees between the objects. Default 15. --- @param #string prefix (Optional) The prefix for the name of the STATIC objects. Default is innerCircle. --- @param #string category (Optional) The category of the STATIC object to use. Default is Fortifications. --- @param #string staticType (Optional) The type of the STATIC object to use. Default is container_40ft. --- @param #string staticShape (Optional) The shape of the STATIC object to use. Default is container_40ft. --- @param #string staticLivery (Optional) The livery name of the STATIC object to use. Default is summer. -function targetcircle( circleCenter, radius, step, prefix, category, staticType, staticShape, staticLivery ) - local circleCenter = circleCenter - local radius = radius or 150 - local step = step or 15 - local prefix = prefix or "innerCircle" -- Must be unique! - local category = category or "Fortifications" - local staticType = statictype or "container_40ft" - local staticShape = staticshape or "container_40ft" - local staticLivery = staticlivery or "summer" - - for angle = 0, 360-step , step do - local name = string.format( "%s#%f", prefix, angle ) - local circle = circleCenter:Translate( radius, angle, false, false ) - SPAWNSTATIC - :NewFromType( staticType, category ) - :InitCoordinate( circle ) - :InitLivery( staticLivery ) - :InitHeading( angle ) - :InitShape( staticShape ) - :Spawn( nil, name ) - end -end - -local circleCenter = STATIC:FindByName( "CircleCenterContainer", true ):GetCoordinate() -targetcircle( circleCenter ) -targetcircle( circleCenter, 250, nil, "outerCircle" ) - -MESSAGE:New( "Containers are in place now", 35, "INFO" ):ToAll():ToLog() +--- +-- Author: buur +-- Created: 29.02.2024 +-- Contributors: kaltokri +-- Modified: 01.03.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html +-- +-- # Description: +-- +-- In this mission we search for a placed container with the UNIT name CircleCenterContainer. +-- Around this object we create two circles with containers to mark the target area. +-- NOTE: Instead of a STATIC object you can also use other objects (like UNITS) to define the center position! +-- +-- # Guide: +-- +-- 1. Start the mission and take a look at the placed containers. + +--- Creates a circle with static objects around a given coordinate. +-- @param Core.Point#COORDINATE circleCenter The coordinate for the center of the circle. +-- @param #number radius (Optional) The radius of the circle. Default 150. +-- @param #number step (Optional) The distance in degrees between the objects. Default 15. +-- @param #string prefix (Optional) The prefix for the name of the STATIC objects. Default is innerCircle. +-- @param #string category (Optional) The category of the STATIC object to use. Default is Fortifications. +-- @param #string staticType (Optional) The type of the STATIC object to use. Default is container_40ft. +-- @param #string staticShape (Optional) The shape of the STATIC object to use. Default is container_40ft. +-- @param #string staticLivery (Optional) The livery name of the STATIC object to use. Default is summer. +function targetcircle( circleCenter, radius, step, prefix, category, staticType, staticShape, staticLivery ) + local circleCenter = circleCenter + local radius = radius or 150 + local step = step or 15 + local prefix = prefix or "innerCircle" -- Must be unique! + local category = category or "Fortifications" + local staticType = statictype or "container_40ft" + local staticShape = staticshape or "container_40ft" + local staticLivery = staticlivery or "summer" + + for angle = 0, 360-step , step do + local name = string.format( "%s#%f", prefix, angle ) + local circle = circleCenter:Translate( radius, angle, false, false ) + SPAWNSTATIC + :NewFromType( staticType, category ) + :InitCoordinate( circle ) + :InitLivery( staticLivery ) + :InitHeading( angle ) + :InitShape( staticShape ) + :Spawn( nil, name ) + end +end + +local circleCenter = STATIC:FindByName( "CircleCenterContainer", true ):GetCoordinate() +targetcircle( circleCenter ) +targetcircle( circleCenter, 250, nil, "outerCircle" ) + +MESSAGE:New( "Containers are in place now", 35, "INFO" ):ToAll():ToLog() diff --git a/Core/SpawnStatic/020-Mark-target-with-containers/SPS-020-Mark-target-with-containers.miz b/Core/SpawnStatic/020-Mark-target-with-containers/SPS-020-Mark-target-with-containers.miz index 9d3f74d..34b9d16 100644 Binary files a/Core/SpawnStatic/020-Mark-target-with-containers/SPS-020-Mark-target-with-containers.miz and b/Core/SpawnStatic/020-Mark-target-with-containers/SPS-020-Mark-target-with-containers.miz differ diff --git a/Core/SpawnStatic/050-Spawn-FARPs/SPS-050-Spawn-FARPs.lua b/Core/SpawnStatic/050-Spawn-FARPs/SPS-050-Spawn-FARPs.lua index b6dc418..bbabbf2 100644 --- a/Core/SpawnStatic/050-Spawn-FARPs/SPS-050-Spawn-FARPs.lua +++ b/Core/SpawnStatic/050-Spawn-FARPs/SPS-050-Spawn-FARPs.lua @@ -1,77 +1,77 @@ ---- --- Author: Unknown --- Created: Unknown --- Contributors: kaltokri --- Modified: 01.03.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Airbase.html --- --- # Description: --- --- This demo shows how to dynamically spawn FARPs into a mission. --- --- We spawn two FARPS in a zone near Batumi. --- The first FARP is named "FARP Berlin" and the second "FARP London". --- We put colored smoke on the spawned objects to mark them. --- --- The data is taken from "template" FARPS. Note that if the same --- name as the template is used, the original object is despawned --- automatically when the new object is spawned. --- --- As FARPS in DCS are strange creatures, which are hybrids of groups --- and statics, the function :InitFARP is necessary. --- --- # Guide: --- --- 1. Start the mission and watch the created FARPs. - - --- Zone near Batumi on land. -local zoneSpawn1 = ZONE:FindByName( "SpawnZone1" ) -local zoneSpawn2 = ZONE:FindByName( "SpawnZone2" ) - --- Create a SPAWNSTATIC object from a template static FARP object. -local spawnStaticFarp = SPAWNSTATIC:NewFromStatic( "Static FARP Template-1", country.id.GERMANY ) - --- Spawning FARPS is special in DCS. Therefore, we need to specify that this is a FARP. --- We also set the call sign and the frequency. -spawnStaticFarp:InitFARP( CALLSIGN.FARP.Berlin, 130.000, 0 ) - --- Spawn FARP with heading 90°. It's name will be "FARP Berlin". -local farpBerlin = spawnStaticFarp:SpawnFromZone( zoneSpawn1, 90, "FARP Berlin" ) - --- Smoke static green. -farpBerlin:GetCoordinate():SmokeGreen() - - --- The second FAPR gets call sign London and used radio frequency 131 MHz. -spawnStaticFarp:InitFARP( CALLSIGN.FARP.London, 131.000, 0 ) - --- We set the country to UK. -spawnStaticFarp:InitCountry( country.id.UK ) - --- Spawn the FARP at a random location inside the zone. -local FarpLondon = spawnStaticFarp:SpawnFromCoordinate( zoneSpawn2:GetRandomCoordinate(), nil, "FARP London" ) - --- Put red smoke at FARP London. -FarpLondon:GetCoordinate():SmokeRed() - - --- Function to check if the STATIC/AIRBASE objects can be found. -local function check() - -- Try to find static. - local staticBerlin = STATIC:FindByName( "FARP Berlin" ) - - -- Launch red flare. - staticBerlin:GetCoordinate():FlareRed() - - -- Get the airbase object and mark the parking spots. - local AirbaseBerlin = AIRBASE:FindByName("FARP Berlin") - AirbaseBerlin:MarkParkingSpots() -end - -TIMER:New( check ):Start( 2, 5 ) +--- +-- Author: Unknown +-- Created: Unknown +-- Contributors: kaltokri +-- Modified: 01.03.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.SpawnStatic.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Airbase.html +-- +-- # Description: +-- +-- This demo shows how to dynamically spawn FARPs into a mission. +-- +-- We spawn two FARPS in a zone near Batumi. +-- The first FARP is named "FARP Berlin" and the second "FARP London". +-- We put colored smoke on the spawned objects to mark them. +-- +-- The data is taken from "template" FARPS. Note that if the same +-- name as the template is used, the original object is despawned +-- automatically when the new object is spawned. +-- +-- As FARPS in DCS are strange creatures, which are hybrids of groups +-- and statics, the function :InitFARP is necessary. +-- +-- # Guide: +-- +-- 1. Start the mission and watch the created FARPs. + + +-- Zone near Batumi on land. +local zoneSpawn1 = ZONE:FindByName( "SpawnZone1" ) +local zoneSpawn2 = ZONE:FindByName( "SpawnZone2" ) + +-- Create a SPAWNSTATIC object from a template static FARP object. +local spawnStaticFarp = SPAWNSTATIC:NewFromStatic( "Static FARP Template-1", country.id.GERMANY ) + +-- Spawning FARPS is special in DCS. Therefore, we need to specify that this is a FARP. +-- We also set the call sign and the frequency. +spawnStaticFarp:InitFARP( CALLSIGN.FARP.Berlin, 130.000, 0 ) + +-- Spawn FARP with heading 90°. It's name will be "FARP Berlin". +local farpBerlin = spawnStaticFarp:SpawnFromZone( zoneSpawn1, 90, "FARP Berlin" ) + +-- Smoke static green. +farpBerlin:GetCoordinate():SmokeGreen() + + +-- The second FAPR gets call sign London and used radio frequency 131 MHz. +spawnStaticFarp:InitFARP( CALLSIGN.FARP.London, 131.000, 0 ) + +-- We set the country to UK. +spawnStaticFarp:InitCountry( country.id.UK ) + +-- Spawn the FARP at a random location inside the zone. +local FarpLondon = spawnStaticFarp:SpawnFromCoordinate( zoneSpawn2:GetRandomCoordinate(), nil, "FARP London" ) + +-- Put red smoke at FARP London. +FarpLondon:GetCoordinate():SmokeRed() + + +-- Function to check if the STATIC/AIRBASE objects can be found. +local function check() + -- Try to find static. + local staticBerlin = STATIC:FindByName( "FARP Berlin" ) + + -- Launch red flare. + staticBerlin:GetCoordinate():FlareRed() + + -- Get the airbase object and mark the parking spots. + local AirbaseBerlin = AIRBASE:FindByName("FARP Berlin") + AirbaseBerlin:MarkParkingSpots() +end + +TIMER:New( check ):Start( 2, 5 ) diff --git a/Core/SpawnStatic/050-Spawn-FARPs/SPS-050-Spawn-FARPs.miz b/Core/SpawnStatic/050-Spawn-FARPs/SPS-050-Spawn-FARPs.miz index 8a1864a..309ba78 100644 Binary files a/Core/SpawnStatic/050-Spawn-FARPs/SPS-050-Spawn-FARPs.miz and b/Core/SpawnStatic/050-Spawn-FARPs/SPS-050-Spawn-FARPs.miz differ diff --git a/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.miz b/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.miz index 5961914..7f6e4ee 100644 Binary files a/Core/Zone/100-Normal-Zone/ZON-100-Normal-Zone.miz 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.miz b/Core/Zone/101-Normal-Zone-Random-Point/ZON-101-Normal-Zone-Random-Point.miz index 8df6d35..f3ecf52 100644 Binary files a/Core/Zone/101-Normal-Zone-Random-Point/ZON-101-Normal-Zone-Random-Point.miz 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.miz b/Core/Zone/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.miz index 8865de7..6b04446 100644 Binary files a/Core/Zone/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.miz and b/Core/Zone/102-Normal-Zone-Boundary/ZON-102-Normal-Zone-Boundary.miz differ diff --git a/Core/Zone/103-Test-if-GROUP-object-is-in-ZONE/ZON-103-Test-if-GROUP-object-is-in-ZONE.miz b/Core/Zone/103-Test-if-GROUP-object-is-in-ZONE/ZON-103-Test-if-GROUP-object-is-in-ZONE.miz index 847dbcc..e87e166 100644 Binary files a/Core/Zone/103-Test-if-GROUP-object-is-in-ZONE/ZON-103-Test-if-GROUP-object-is-in-ZONE.miz and b/Core/Zone/103-Test-if-GROUP-object-is-in-ZONE/ZON-103-Test-if-GROUP-object-is-in-ZONE.miz differ diff --git a/Core/Zone/104-Test-if-GROUP-SET-is-in-ZONE/ZON-104-Test-if-GROUP-SET-is-in-ZONE.miz b/Core/Zone/104-Test-if-GROUP-SET-is-in-ZONE/ZON-104-Test-if-GROUP-SET-is-in-ZONE.miz index 641b03a..ef89d0a 100644 Binary files a/Core/Zone/104-Test-if-GROUP-SET-is-in-ZONE/ZON-104-Test-if-GROUP-SET-is-in-ZONE.miz and b/Core/Zone/104-Test-if-GROUP-SET-is-in-ZONE/ZON-104-Test-if-GROUP-SET-is-in-ZONE.miz differ diff --git a/Core/Zone/110-ZONE-declared-in-ME/ZON-110-ZONE-declared-in-ME.miz b/Core/Zone/110-ZONE-declared-in-ME/ZON-110-ZONE-declared-in-ME.miz index dcc451a..ba145c4 100644 Binary files a/Core/Zone/110-ZONE-declared-in-ME/ZON-110-ZONE-declared-in-ME.miz and b/Core/Zone/110-ZONE-declared-in-ME/ZON-110-ZONE-declared-in-ME.miz differ diff --git a/Core/Zone/190-Return-SCENERY-objects-in-Zone/ZON-190-Return-SCENERY-objects-in-Zone.miz b/Core/Zone/190-Return-SCENERY-objects-in-Zone/ZON-190-Return-SCENERY-objects-in-Zone.miz index de825ca..edd9a9b 100644 Binary files a/Core/Zone/190-Return-SCENERY-objects-in-Zone/ZON-190-Return-SCENERY-objects-in-Zone.miz and b/Core/Zone/190-Return-SCENERY-objects-in-Zone/ZON-190-Return-SCENERY-objects-in-Zone.miz differ diff --git a/Core/Zone/200-Group-Zone/ZON-200-Group-Zone.miz b/Core/Zone/200-Group-Zone/ZON-200-Group-Zone.miz index e9f72c6..b0f4c89 100644 Binary files a/Core/Zone/200-Group-Zone/ZON-200-Group-Zone.miz and b/Core/Zone/200-Group-Zone/ZON-200-Group-Zone.miz differ diff --git a/Core/Zone/201-Group-Zone-Random-Point/ZON-201-Group-Zone-Random-Point.miz b/Core/Zone/201-Group-Zone-Random-Point/ZON-201-Group-Zone-Random-Point.miz index 563698d..1e960f4 100644 Binary files a/Core/Zone/201-Group-Zone-Random-Point/ZON-201-Group-Zone-Random-Point.miz and b/Core/Zone/201-Group-Zone-Random-Point/ZON-201-Group-Zone-Random-Point.miz differ diff --git a/Core/Zone/300-Unit-Zone/ZON-300-Unit-Zone.miz b/Core/Zone/300-Unit-Zone/ZON-300-Unit-Zone.miz index f159604..db6f3c1 100644 Binary files a/Core/Zone/300-Unit-Zone/ZON-300-Unit-Zone.miz and b/Core/Zone/300-Unit-Zone/ZON-300-Unit-Zone.miz differ diff --git a/Core/Zone/301-Unit-Zone-Random-Point/ZON-301-Unit-Zone-Random-Point.miz b/Core/Zone/301-Unit-Zone-Random-Point/ZON-301-Unit-Zone-Random-Point.miz index 5cb3b5b..de98e2d 100644 Binary files a/Core/Zone/301-Unit-Zone-Random-Point/ZON-301-Unit-Zone-Random-Point.miz and b/Core/Zone/301-Unit-Zone-Random-Point/ZON-301-Unit-Zone-Random-Point.miz differ diff --git a/Core/Zone/400-Radius-Zone/ZON-400-Radius-Zone.miz b/Core/Zone/400-Radius-Zone/ZON-400-Radius-Zone.miz index 0a1a39e..95feb59 100644 Binary files a/Core/Zone/400-Radius-Zone/ZON-400-Radius-Zone.miz and b/Core/Zone/400-Radius-Zone/ZON-400-Radius-Zone.miz differ diff --git a/Core/Zone/401-Radius-Zone-Random-Point/ZON-401-Radius-Zone-Random-Point.miz b/Core/Zone/401-Radius-Zone-Random-Point/ZON-401-Radius-Zone-Random-Point.miz index 06a92f2..45f63ad 100644 Binary files a/Core/Zone/401-Radius-Zone-Random-Point/ZON-401-Radius-Zone-Random-Point.miz and b/Core/Zone/401-Radius-Zone-Random-Point/ZON-401-Radius-Zone-Random-Point.miz differ diff --git a/Core/Zone/500-Polygon-Zone/ZON-500-Polygon-Zone.miz b/Core/Zone/500-Polygon-Zone/ZON-500-Polygon-Zone.miz index a92723e..4efcb18 100644 Binary files a/Core/Zone/500-Polygon-Zone/ZON-500-Polygon-Zone.miz and b/Core/Zone/500-Polygon-Zone/ZON-500-Polygon-Zone.miz differ diff --git a/Core/Zone/501-Polygon-Zone-Random-Point/ZON-501-Polygon-Zone-Random-Point.miz b/Core/Zone/501-Polygon-Zone-Random-Point/ZON-501-Polygon-Zone-Random-Point.miz index cb90544..49a7f8e 100644 Binary files a/Core/Zone/501-Polygon-Zone-Random-Point/ZON-501-Polygon-Zone-Random-Point.miz and b/Core/Zone/501-Polygon-Zone-Random-Point/ZON-501-Polygon-Zone-Random-Point.miz differ diff --git a/Core/Zone/502-Polygon-Zone-Boundary/ZON-502-Polygon-Zone-Boundary.miz b/Core/Zone/502-Polygon-Zone-Boundary/ZON-502-Polygon-Zone-Boundary.miz index 1504dbb..0a4af13 100644 Binary files a/Core/Zone/502-Polygon-Zone-Boundary/ZON-502-Polygon-Zone-Boundary.miz and b/Core/Zone/502-Polygon-Zone-Boundary/ZON-502-Polygon-Zone-Boundary.miz differ diff --git a/Core/Zone/510-ZONE_POLYGON-declared-in-ME/ZON-510-ZONE_POLYGON-declared-in-ME.miz b/Core/Zone/510-ZONE_POLYGON-declared-in-ME/ZON-510-ZONE_POLYGON-declared-in-ME.miz index efca924..5312ca4 100644 Binary files a/Core/Zone/510-ZONE_POLYGON-declared-in-ME/ZON-510-ZONE_POLYGON-declared-in-ME.miz and b/Core/Zone/510-ZONE_POLYGON-declared-in-ME/ZON-510-ZONE_POLYGON-declared-in-ME.miz differ diff --git a/Core/Zone/520-Draw-Zones-and-Shapes/ZON-520-Draw-Zones-and-Shapes.miz b/Core/Zone/520-Draw-Zones-and-Shapes/ZON-520-Draw-Zones-and-Shapes.miz index 76d1564..f49d984 100644 Binary files a/Core/Zone/520-Draw-Zones-and-Shapes/ZON-520-Draw-Zones-and-Shapes.miz and b/Core/Zone/520-Draw-Zones-and-Shapes/ZON-520-Draw-Zones-and-Shapes.miz differ diff --git a/Functional/FOX/100-Simple/FOX-100-Simple.lua b/Functional/FOX/100-Simple/FOX-100-Simple.lua index 6054543..62b8883 100644 --- a/Functional/FOX/100-Simple/FOX-100-Simple.lua +++ b/Functional/FOX/100-Simple/FOX-100-Simple.lua @@ -1,36 +1,36 @@ ---- --- Author: kaltokri --- Created: 28.02.2024 --- Contributors: - --- Modified: 28.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Fox.html --- --- # Description: --- In this mission we run a Functional FOX Missile trainer with default settings. --- Change client to another aircraft in mission editor as required. --- Change fox parameters with F10 radio menu. --- --- # Guide: --- 1. Start the mission and join the Su-25T as player. --- 2. Activate auto pilot with key A. --- 3. Switch to external view (F2). --- 4. When the aircraft is passing the SA-13 it will fire a rocket --- 5. The rocket will explode prior reaching your aircraft --- 6. You will see messages from Functional.FOX --- --- NOTE: --- Take a look at the triggers! This time we start the mission script with "4 MISSION START" and no CONDITION. --- Functional.FOX can handle only objects, that are created after it is started. --- --- If you change the trigger to "1 ONCE" with "TIME MORE 1" and join directly into Su-25T, you will not be protected! --- Instead join as GAME MASTER blue first and wait for the "...started" message. --- Switch to client (Su-25T) and you will be protected. - --- Create a new missile trainer object. -fox=FOX:New() - --- Start missile trainer. -fox:Start() -MESSAGE:New( "FOX missile trainer started", 25, "INFO" ):ToAll():ToLog() +--- +-- Author: kaltokri +-- Created: 28.02.2024 +-- Contributors: - +-- Modified: 28.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Fox.html +-- +-- # Description: +-- In this mission we run a Functional FOX Missile trainer with default settings. +-- Change client to another aircraft in mission editor as required. +-- Change fox parameters with F10 radio menu. +-- +-- # Guide: +-- 1. Start the mission and join the Su-25T as player. +-- 2. Activate auto pilot with key A. +-- 3. Switch to external view (F2). +-- 4. When the aircraft is passing the SA-13 it will fire a rocket +-- 5. The rocket will explode prior reaching your aircraft +-- 6. You will see messages from Functional.FOX +-- +-- NOTE: +-- Take a look at the triggers! This time we start the mission script with "4 MISSION START" and no CONDITION. +-- Functional.FOX can handle only objects, that are created after it is started. +-- +-- If you change the trigger to "1 ONCE" with "TIME MORE 1" and join directly into Su-25T, you will not be protected! +-- Instead join as GAME MASTER blue first and wait for the "...started" message. +-- Switch to client (Su-25T) and you will be protected. + +-- Create a new missile trainer object. +fox=FOX:New() + +-- Start missile trainer. +fox:Start() +MESSAGE:New( "FOX missile trainer started", 25, "INFO" ):ToAll():ToLog() diff --git a/Functional/FOX/100-Simple/FOX-100-Simple.miz b/Functional/FOX/100-Simple/FOX-100-Simple.miz index 8050433..e094b4a 100644 Binary files a/Functional/FOX/100-Simple/FOX-100-Simple.miz and b/Functional/FOX/100-Simple/FOX-100-Simple.miz differ diff --git a/Functional/FOX/101-LaunchZone/FOX-101-LaunchZone.lua b/Functional/FOX/101-LaunchZone/FOX-101-LaunchZone.lua index 52252cb..6f87224 100644 --- a/Functional/FOX/101-LaunchZone/FOX-101-LaunchZone.lua +++ b/Functional/FOX/101-LaunchZone/FOX-101-LaunchZone.lua @@ -1,40 +1,40 @@ ---- --- Author: kaltokri --- Created: 28.02.2024 --- Contributors: - --- Modified: 28.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Fox.html --- --- # Description: --- In this mission we run a Functional FOX Missile trainer and add a launch zone. --- Change client to another aircraft in mission editor as required. --- Change fox parameters with F10 radio menu. --- --- # Guide: --- 1. Start the mission and join the Su-25T as player. --- 2. Activate auto pilot with key A. --- 3. Switch to external view (F2). --- 4. When the aircraft is passing the SA-13 it will fire a rocket. --- 5. The rocket will explode prior reaching your aircraft, because the SAM site is placed within FOX_Launch_Zone. --- 6. Fly straight ahead and the second SA-13 will start a missile that will kill you. --- 7. The second SA-13 is not within the FOX_Launch_Zone. So it's missiles will not be handled by FOX. --- --- NOTE: --- Take a look at the triggers! This time we start the mission script with "4 MISSION START" and no CONDITION. --- Functional.FOX can handle only objects, that are created after it is started. --- --- If you change the trigger to "1 ONCE" with "TIME MORE 1" and join directly into Su-25T, you will not be protected! --- Instead join as GAME MASTER blue first and wait for the "...started" message. --- Switch to client (Su-25T) and you will be protected. - --- Create a new missile trainer object. -fox=FOX:New() - --- Add training Launch zones. Only launches from these zones are handled, if defined -fox:AddLaunchZone( ZONE:New("FOX_Launch_Zone") ) - --- Start missile trainer. -fox:Start() -MESSAGE:New( "FOX missile trainer started", 25, "INFO" ):ToAll():ToLog() +--- +-- Author: kaltokri +-- Created: 28.02.2024 +-- Contributors: - +-- Modified: 28.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Fox.html +-- +-- # Description: +-- In this mission we run a Functional FOX Missile trainer and add a launch zone. +-- Change client to another aircraft in mission editor as required. +-- Change fox parameters with F10 radio menu. +-- +-- # Guide: +-- 1. Start the mission and join the Su-25T as player. +-- 2. Activate auto pilot with key A. +-- 3. Switch to external view (F2). +-- 4. When the aircraft is passing the SA-13 it will fire a rocket. +-- 5. The rocket will explode prior reaching your aircraft, because the SAM site is placed within FOX_Launch_Zone. +-- 6. Fly straight ahead and the second SA-13 will start a missile that will kill you. +-- 7. The second SA-13 is not within the FOX_Launch_Zone. So it's missiles will not be handled by FOX. +-- +-- NOTE: +-- Take a look at the triggers! This time we start the mission script with "4 MISSION START" and no CONDITION. +-- Functional.FOX can handle only objects, that are created after it is started. +-- +-- If you change the trigger to "1 ONCE" with "TIME MORE 1" and join directly into Su-25T, you will not be protected! +-- Instead join as GAME MASTER blue first and wait for the "...started" message. +-- Switch to client (Su-25T) and you will be protected. + +-- Create a new missile trainer object. +fox=FOX:New() + +-- Add training Launch zones. Only launches from these zones are handled, if defined +fox:AddLaunchZone( ZONE:New("FOX_Launch_Zone") ) + +-- Start missile trainer. +fox:Start() +MESSAGE:New( "FOX missile trainer started", 25, "INFO" ):ToAll():ToLog() diff --git a/Functional/FOX/101-LaunchZone/FOX-101-LaunchZone.miz b/Functional/FOX/101-LaunchZone/FOX-101-LaunchZone.miz index a1b854e..b5797c6 100644 Binary files a/Functional/FOX/101-LaunchZone/FOX-101-LaunchZone.miz and b/Functional/FOX/101-LaunchZone/FOX-101-LaunchZone.miz differ diff --git a/Functional/FOX/102-ProtectedGroup/FOX-102-ProtectedGroup.lua b/Functional/FOX/102-ProtectedGroup/FOX-102-ProtectedGroup.lua index 959a5ae..c6e4a2e 100644 --- a/Functional/FOX/102-ProtectedGroup/FOX-102-ProtectedGroup.lua +++ b/Functional/FOX/102-ProtectedGroup/FOX-102-ProtectedGroup.lua @@ -1,28 +1,28 @@ ---- --- Author: kaltokri --- Created: 28.02.2024 --- Contributors: - --- Modified: 28.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Fox.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- --- # Description: --- In this mission we run a Functional FOX Missile trainer and add a protected group. --- Note: AddProtectedGroup works only for AI! --- --- # Guide: --- 1. Start the mission. --- 4. First AI aircraft is not protected and will be damaged or killed. --- 5. Second AI aircraft is protected and will not be damaged. - --- Create a new missile trainer object. -fox=FOX:New() - --- Add protected AI group. -fox:AddProtectedGroup( GROUP:FindByName("Protected") ) - --- Start missile trainer. -fox:Start() -MESSAGE:New( "FOX missile trainer started", 25, "INFO" ):ToAll():ToLog() +--- +-- Author: kaltokri +-- Created: 28.02.2024 +-- Contributors: - +-- Modified: 28.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Fox.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- +-- # Description: +-- In this mission we run a Functional FOX Missile trainer and add a protected group. +-- Note: AddProtectedGroup works only for AI! +-- +-- # Guide: +-- 1. Start the mission. +-- 4. First AI aircraft is not protected and will be damaged or killed. +-- 5. Second AI aircraft is protected and will not be damaged. + +-- Create a new missile trainer object. +fox=FOX:New() + +-- Add protected AI group. +fox:AddProtectedGroup( GROUP:FindByName("Protected") ) + +-- Start missile trainer. +fox:Start() +MESSAGE:New( "FOX missile trainer started", 25, "INFO" ):ToAll():ToLog() diff --git a/Functional/FOX/102-ProtectedGroup/FOX-102-ProtectedGroup.miz b/Functional/FOX/102-ProtectedGroup/FOX-102-ProtectedGroup.miz index 04e78e0..08dede6 100644 Binary files a/Functional/FOX/102-ProtectedGroup/FOX-102-ProtectedGroup.miz and b/Functional/FOX/102-ProtectedGroup/FOX-102-ProtectedGroup.miz differ diff --git a/Functional/FOX/103-SafeZone/ZON-103-SafeZone.lua b/Functional/FOX/103-SafeZone/ZON-103-SafeZone.lua index daa700b..8b50fbb 100644 --- a/Functional/FOX/103-SafeZone/ZON-103-SafeZone.lua +++ b/Functional/FOX/103-SafeZone/ZON-103-SafeZone.lua @@ -1,37 +1,37 @@ ---- --- Author: kaltokri --- Created: 28.02.2024 --- Contributors: - --- Modified: 28.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Fox.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html --- --- # Description: --- In this mission we run a Functional FOX Missile trainer and add a safe zone. --- Players are only protected if they are inside the zone. --- Change client to another aircraft in mission editor as required. --- Note: This works not for AI! --- --- # Guide: --- 1. Start the mission and join the Su-25T as player. --- 2. Activate auto pilot with key A. --- 3. Switch between external view (F2) and map (F10). --- 4. When the aircraft is passing the first SA-13 it will fire a rocket. --- 5. The rocket will explode prior reaching your aircraft, because your aircraft is still in the SafeZone. --- 6. Fly straight ahead and after leaving the SafeZone missiles (no matter from which SA-13) will damage you. - --- Create a new missile trainer object. -fox=FOX:New() - --- Get zone object and draw the zone in F10 map. -SafeZone = ZONE:New( "FOX_Safe_Zone" ) - :DrawZone( -1, {1,0,0}, 1, {1,0,0}, 0.3, true ) - --- Add training Safe zones. -fox:AddSafeZone( SafeZone ) - --- Start missile trainer. -fox:Start() -MESSAGE:New( "FOX missile trainer started", 25, "INFO" ):ToAll():ToLog() +--- +-- Author: kaltokri +-- Created: 28.02.2024 +-- Contributors: - +-- Modified: 28.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Fox.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html +-- +-- # Description: +-- In this mission we run a Functional FOX Missile trainer and add a safe zone. +-- Players are only protected if they are inside the zone. +-- Change client to another aircraft in mission editor as required. +-- Note: This works not for AI! +-- +-- # Guide: +-- 1. Start the mission and join the Su-25T as player. +-- 2. Activate auto pilot with key A. +-- 3. Switch between external view (F2) and map (F10). +-- 4. When the aircraft is passing the first SA-13 it will fire a rocket. +-- 5. The rocket will explode prior reaching your aircraft, because your aircraft is still in the SafeZone. +-- 6. Fly straight ahead and after leaving the SafeZone missiles (no matter from which SA-13) will damage you. + +-- Create a new missile trainer object. +fox=FOX:New() + +-- Get zone object and draw the zone in F10 map. +SafeZone = ZONE:New( "FOX_Safe_Zone" ) + :DrawZone( -1, {1,0,0}, 1, {1,0,0}, 0.3, true ) + +-- Add training Safe zones. +fox:AddSafeZone( SafeZone ) + +-- Start missile trainer. +fox:Start() +MESSAGE:New( "FOX missile trainer started", 25, "INFO" ):ToAll():ToLog() diff --git a/Functional/FOX/103-SafeZone/ZON-103-SafeZone.miz b/Functional/FOX/103-SafeZone/ZON-103-SafeZone.miz index 4aa443e..c8e8d2e 100644 Binary files a/Functional/FOX/103-SafeZone/ZON-103-SafeZone.miz and b/Functional/FOX/103-SafeZone/ZON-103-SafeZone.miz differ diff --git a/Other/000-Template/000-Template.miz b/Other/000-Template/000-Template.miz index c8e883a..1b4909e 100644 Binary files a/Other/000-Template/000-Template.miz and b/Other/000-Template/000-Template.miz differ diff --git a/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.miz b/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.miz index 5bb0a33..bdf0926 100644 Binary files a/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.miz and b/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.miz differ diff --git a/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.miz b/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.miz index f082f55..05835fc 100644 Binary files a/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.miz and b/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.miz differ diff --git a/Sound/MSRS/003-PlayTextFile/MSRS-003-PlayTextFile.miz b/Sound/MSRS/003-PlayTextFile/MSRS-003-PlayTextFile.miz index 23109af..5255fb3 100644 Binary files a/Sound/MSRS/003-PlayTextFile/MSRS-003-PlayTextFile.miz and b/Sound/MSRS/003-PlayTextFile/MSRS-003-PlayTextFile.miz differ diff --git a/Sound/MSRS/010-Windows-TTS-via-config-file/MSRS-010-Windows-TTS-via-config-file.miz b/Sound/MSRS/010-Windows-TTS-via-config-file/MSRS-010-Windows-TTS-via-config-file.miz index 65c9199..21f8482 100644 Binary files a/Sound/MSRS/010-Windows-TTS-via-config-file/MSRS-010-Windows-TTS-via-config-file.miz and b/Sound/MSRS/010-Windows-TTS-via-config-file/MSRS-010-Windows-TTS-via-config-file.miz differ diff --git a/Sound/Radio/000-Transmission-from-Static/RAD-000-Transmission-from-Static.miz b/Sound/Radio/000-Transmission-from-Static/RAD-000-Transmission-from-Static.miz index 5901681..bedb02c 100644 Binary files a/Sound/Radio/000-Transmission-from-Static/RAD-000-Transmission-from-Static.miz and b/Sound/Radio/000-Transmission-from-Static/RAD-000-Transmission-from-Static.miz differ diff --git a/Sound/Radio/001-Transmission-from-UNIT-or-GROUP/RAD-001-Transmission-from-UNIT-or-GROUP.miz b/Sound/Radio/001-Transmission-from-UNIT-or-GROUP/RAD-001-Transmission-from-UNIT-or-GROUP.miz index 94e4552..81d5d20 100644 Binary files a/Sound/Radio/001-Transmission-from-UNIT-or-GROUP/RAD-001-Transmission-from-UNIT-or-GROUP.miz and b/Sound/Radio/001-Transmission-from-UNIT-or-GROUP/RAD-001-Transmission-from-UNIT-or-GROUP.miz differ diff --git a/Sound/Radio/002-Transmission-Tips-and-Tricks/RAD-002-Transmission-Tips-and-Tricks.miz b/Sound/Radio/002-Transmission-Tips-and-Tricks/RAD-002-Transmission-Tips-and-Tricks.miz index f214825..2d9eaa5 100644 Binary files a/Sound/Radio/002-Transmission-Tips-and-Tricks/RAD-002-Transmission-Tips-and-Tricks.miz and b/Sound/Radio/002-Transmission-Tips-and-Tricks/RAD-002-Transmission-Tips-and-Tricks.miz differ diff --git a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Caucasus.miz b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Caucasus.miz index 2d567be..a94d20c 100644 Binary files a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Caucasus.miz and b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Caucasus.miz differ diff --git a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Falklands.miz b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Falklands.miz index 7f4ee2c..a2717b1 100644 Binary files a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Falklands.miz and b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Falklands.miz differ diff --git a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-MarianaIslands.miz b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-MarianaIslands.miz index 301d060..5e4fb6e 100644 Binary files a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-MarianaIslands.miz and b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-MarianaIslands.miz differ diff --git a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Nevada.miz b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Nevada.miz index e8bfb47..d4287a1 100644 Binary files a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Nevada.miz and b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Nevada.miz differ diff --git a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Normandy.miz b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Normandy.miz index d11d7bf..bf62e59 100644 Binary files a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Normandy.miz and b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Normandy.miz differ diff --git a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-PersianGulf.miz b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-PersianGulf.miz index 355b5d4..7df871c 100644 Binary files a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-PersianGulf.miz and b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-PersianGulf.miz differ diff --git a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Sinai.miz b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Sinai.miz index 5156c71..19db0a0 100644 Binary files a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Sinai.miz and b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Sinai.miz differ diff --git a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Syria.miz b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Syria.miz index 79480f6..031fa50 100644 Binary files a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Syria.miz and b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-Syria.miz differ diff --git a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-TheChannel.miz b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-TheChannel.miz index bbd0942..2f4266b 100644 Binary files a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-TheChannel.miz and b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data-TheChannel.miz differ diff --git a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data.lua b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data.lua index 1873b72..59cc18b 100644 --- a/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data.lua +++ b/Wrapper/Airbase/900-Airbase-data/AFB-900-Airbase-data.lua @@ -1,74 +1,74 @@ ---- --- Author: Applevangelist --- Created: 28.02.2017 --- Contributors: kaltokri --- Modified: 28.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Airbase.html --- --- # Description: --- --- This script can be used to create data for the Wrapper.Airbase class. --- Create an empty mission with the terrain you want the data for. --- Add Moose and this script. --- Or use one of the already created missions in this folder. --- --- NOTE: io & lfs must be desanitized for this mission to work! --- --- # Guide: --- --- 1. Start the mission. --- 2. When you see the message "Wrapper.Airbase data written..." you can quit the mission. --- 3. Open your "Saved Games\DCS\Missions" folder. --- 4. The file airbase-.txt should be saved there and contain all needed data. --- 5. This data can be used to replace the specific parts of Wrapper.Airbase.lua - --- Create a SET with all airbase of this map. -local bases = SET_AIRBASE:New():FilterOnce() - -local Airbases1 = {} -local Airbases2 = {} - -local terrainName = UTILS.GetDCSMap() - -bases:ForEachAirbase( - function(afb) - local ab = afb -- Wrapper.Airbase#AIRBASE - local name = ab:GetName() - local nice = string.gsub( name, "([%s%c%p]+", "_" ) - local text1 = string.format( ' ["%s"] = "%s",', nice, name ) - local text2 = string.format( '-- * AIRBASE.%s.%s', terrainName, nice ) - MESSAGE:New(nice, 10):ToLog() - Airbases1[nice] = text1 - Airbases2[nice] = text2 - end -) - -local tkeys1 = {} -local tkeys2 = {} - -for k in pairs(Airbases1) do table.insert(tkeys1, k) end -for k in pairs(Airbases2) do table.insert(tkeys2, k) end - -table.sort(tkeys1) -table.sort(tkeys2) - -local list1 = "\n" -local list2 = "\n" - -for _, k in ipairs(tkeys1) do - list1 = list1 .. Airbases1[k] .. "\n" -end - -for _, k in ipairs(tkeys2) do - list2 = list2 .. Airbases2[k] .. "\n" -end - -filename = lfs.writedir() .."Missions\\airbase-" .. terrainName .. ".txt" -filehandle = io.open( filename, "w") -filehandle:write(list1) -filehandle:write(list2) -filehandle:close() - -MESSAGE:New( "Wrapper.Airbase data written to " .. filename ):ToAll() +--- +-- Author: Applevangelist +-- Created: 28.02.2017 +-- Contributors: kaltokri +-- Modified: 28.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Airbase.html +-- +-- # Description: +-- +-- This script can be used to create data for the Wrapper.Airbase class. +-- Create an empty mission with the terrain you want the data for. +-- Add Moose and this script. +-- Or use one of the already created missions in this folder. +-- +-- NOTE: io & lfs must be desanitized for this mission to work! +-- +-- # Guide: +-- +-- 1. Start the mission. +-- 2. When you see the message "Wrapper.Airbase data written..." you can quit the mission. +-- 3. Open your "Saved Games\DCS\Missions" folder. +-- 4. The file airbase-.txt should be saved there and contain all needed data. +-- 5. This data can be used to replace the specific parts of Wrapper.Airbase.lua + +-- Create a SET with all airbase of this map. +local bases = SET_AIRBASE:New():FilterOnce() + +local Airbases1 = {} +local Airbases2 = {} + +local terrainName = UTILS.GetDCSMap() + +bases:ForEachAirbase( + function(afb) + local ab = afb -- Wrapper.Airbase#AIRBASE + local name = ab:GetName() + local nice = string.gsub( name, "([%s%c%p]+", "_" ) + local text1 = string.format( ' ["%s"] = "%s",', nice, name ) + local text2 = string.format( '-- * AIRBASE.%s.%s', terrainName, nice ) + MESSAGE:New(nice, 10):ToLog() + Airbases1[nice] = text1 + Airbases2[nice] = text2 + end +) + +local tkeys1 = {} +local tkeys2 = {} + +for k in pairs(Airbases1) do table.insert(tkeys1, k) end +for k in pairs(Airbases2) do table.insert(tkeys2, k) end + +table.sort(tkeys1) +table.sort(tkeys2) + +local list1 = "\n" +local list2 = "\n" + +for _, k in ipairs(tkeys1) do + list1 = list1 .. Airbases1[k] .. "\n" +end + +for _, k in ipairs(tkeys2) do + list2 = list2 .. Airbases2[k] .. "\n" +end + +filename = lfs.writedir() .."Missions\\airbase-" .. terrainName .. ".txt" +filehandle = io.open( filename, "w") +filehandle:write(list1) +filehandle:write(list2) +filehandle:close() + +MESSAGE:New( "Wrapper.Airbase data written to " .. filename ):ToAll() diff --git a/Wrapper/Group/100-IsAlive/GRP-100-IsAlive.miz b/Wrapper/Group/100-IsAlive/GRP-100-IsAlive.miz index dd5f1ec..ba66e17 100644 Binary files a/Wrapper/Group/100-IsAlive/GRP-100-IsAlive.miz and b/Wrapper/Group/100-IsAlive/GRP-100-IsAlive.miz differ diff --git a/Wrapper/Group/101-TaskAttackUnit/GRP-101-TaskAttackUnit.miz b/Wrapper/Group/101-TaskAttackUnit/GRP-101-TaskAttackUnit.miz index 948a5de..62de875 100644 Binary files a/Wrapper/Group/101-TaskAttackUnit/GRP-101-TaskAttackUnit.miz and b/Wrapper/Group/101-TaskAttackUnit/GRP-101-TaskAttackUnit.miz differ diff --git a/Wrapper/Group/200-Follow-Group/GRP-200-Follow-Group.miz b/Wrapper/Group/200-Follow-Group/GRP-200-Follow-Group.miz index 6b9a1ed..1f8bce7 100644 Binary files a/Wrapper/Group/200-Follow-Group/GRP-200-Follow-Group.miz and b/Wrapper/Group/200-Follow-Group/GRP-200-Follow-Group.miz differ diff --git a/Wrapper/Group/300-Switch-WayPoints/GRP-300-Switch-WayPoints.miz b/Wrapper/Group/300-Switch-WayPoints/GRP-300-Switch-WayPoints.miz index 1de2f7f..2a30027 100644 Binary files a/Wrapper/Group/300-Switch-WayPoints/GRP-300-Switch-WayPoints.miz and b/Wrapper/Group/300-Switch-WayPoints/GRP-300-Switch-WayPoints.miz differ diff --git a/Wrapper/Group/310-Command-StopRoute/GRP-310-Command-StopRoute.miz b/Wrapper/Group/310-Command-StopRoute/GRP-310-Command-StopRoute.miz index b457f9f..6d20fd2 100644 Binary files a/Wrapper/Group/310-Command-StopRoute/GRP-310-Command-StopRoute.miz and b/Wrapper/Group/310-Command-StopRoute/GRP-310-Command-StopRoute.miz differ diff --git a/Wrapper/Group/400-RouteReturnToAirbase/GRP-400-RouteReturnToAirbase.lua b/Wrapper/Group/400-RouteReturnToAirbase/GRP-400-RouteReturnToAirbase.lua index eb12043..d1cc7f5 100644 --- a/Wrapper/Group/400-RouteReturnToAirbase/GRP-400-RouteReturnToAirbase.lua +++ b/Wrapper/Group/400-RouteReturnToAirbase/GRP-400-RouteReturnToAirbase.lua @@ -1,57 +1,57 @@ ---- --- Author: FlightControl --- Created: 25.03.2017 --- Contributors: kaltokri --- Modified: 24.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Scheduler.html --- --- # Description: --- --- Three air units are flying and are commanded to return a specific airbase. --- --- # Guide: --- 1. Observe group Air1 will return to Batumi after 10 seconds. --- 2. Observe group Air2 will return to Kobuleti after 300 seconds. --- - It was planned to land at Kutaisi in mission editor. --- 3. Observe group Air3 will return to the home (landing) airbase after 300 seconds. --- - It was planned to land at Kutaisi in mission editor. - ---- Function to send RouteRTB command to the group --- @param Wrapper.Group#GROUP AirGroup -function ReturnToBatumi( AirGroup ) - AirGroup:MessageToAll("ReturnToBatumi", 30) - AirGroup:RouteRTB( AIRBASE:FindByName("Batumi") ) -end - ---- Function to send RouteRTB command to the group --- @param Wrapper.Group#GROUP AirGroup -function ReturnToKobuleti( AirGroup ) - AirGroup:MessageToAll("ReturnToKobuleti", 30) - AirGroup:RouteRTB( AIRBASE:FindByName("Kobuleti") ) -end - ---- Function to send RouteRTB command to the group --- @param Wrapper.Group#GROUP AirGroup -function ReturnToHome( AirGroup ) - AirGroup:MessageToAll("ReturnToHome", 30) - AirGroup:RouteRTB() -end - --- Get needed group objects: -Air1Group = GROUP:FindByName( "Air1" ) -Air2Group = GROUP:FindByName( "Air2" ) -Air3Group = GROUP:FindByName( "Air3" ) - --- Setup different schedulers: -Scheduler = SCHEDULER:New( nil ) -ScheduleIDAir1 = Scheduler:Schedule(nil, ReturnToBatumi, { Air1Group }, 10 ) -ScheduleIDAir2 = Scheduler:Schedule(nil, ReturnToKobuleti, { Air2Group }, 300 ) -ScheduleIDAir3 = Scheduler:Schedule(nil, ReturnToHome, { Air3Group }, 300 ) - --- Inform player about the schudule: -Air1Group:MessageToAll("Air1 will RTB to Batumi in 10 seconds", 30 ) -Air2Group:MessageToAll("Air2 will RTB to Kobuleti in 300 seconds (~12:05:00)", 60 ) -Air3Group:MessageToAll("Air3 will RTB to Kutaisi in 300 seconds (~12:05:00)", 60 ) +--- +-- Author: FlightControl +-- Created: 25.03.2017 +-- Contributors: kaltokri +-- Modified: 24.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Scheduler.html +-- +-- # Description: +-- +-- Three air units are flying and are commanded to return a specific airbase. +-- +-- # Guide: +-- 1. Observe group Air1 will return to Batumi after 10 seconds. +-- 2. Observe group Air2 will return to Kobuleti after 300 seconds. +-- - It was planned to land at Kutaisi in mission editor. +-- 3. Observe group Air3 will return to the home (landing) airbase after 300 seconds. +-- - It was planned to land at Kutaisi in mission editor. + +--- Function to send RouteRTB command to the group +-- @param Wrapper.Group#GROUP AirGroup +function ReturnToBatumi( AirGroup ) + AirGroup:MessageToAll("ReturnToBatumi", 30) + AirGroup:RouteRTB( AIRBASE:FindByName("Batumi") ) +end + +--- Function to send RouteRTB command to the group +-- @param Wrapper.Group#GROUP AirGroup +function ReturnToKobuleti( AirGroup ) + AirGroup:MessageToAll("ReturnToKobuleti", 30) + AirGroup:RouteRTB( AIRBASE:FindByName("Kobuleti") ) +end + +--- Function to send RouteRTB command to the group +-- @param Wrapper.Group#GROUP AirGroup +function ReturnToHome( AirGroup ) + AirGroup:MessageToAll("ReturnToHome", 30) + AirGroup:RouteRTB() +end + +-- Get needed group objects: +Air1Group = GROUP:FindByName( "Air1" ) +Air2Group = GROUP:FindByName( "Air2" ) +Air3Group = GROUP:FindByName( "Air3" ) + +-- Setup different schedulers: +Scheduler = SCHEDULER:New( nil ) +ScheduleIDAir1 = Scheduler:Schedule(nil, ReturnToBatumi, { Air1Group }, 10 ) +ScheduleIDAir2 = Scheduler:Schedule(nil, ReturnToKobuleti, { Air2Group }, 300 ) +ScheduleIDAir3 = Scheduler:Schedule(nil, ReturnToHome, { Air3Group }, 300 ) + +-- Inform player about the schudule: +Air1Group:MessageToAll("Air1 will RTB to Batumi in 10 seconds", 30 ) +Air2Group:MessageToAll("Air2 will RTB to Kobuleti in 300 seconds (~12:05:00)", 60 ) +Air3Group:MessageToAll("Air3 will RTB to Kutaisi in 300 seconds (~12:05:00)", 60 ) diff --git a/Wrapper/Group/400-RouteReturnToAirbase/GRP-400-RouteReturnToAirbase.miz b/Wrapper/Group/400-RouteReturnToAirbase/GRP-400-RouteReturnToAirbase.miz index aa7ea4d..ddaafa6 100644 Binary files a/Wrapper/Group/400-RouteReturnToAirbase/GRP-400-RouteReturnToAirbase.miz and b/Wrapper/Group/400-RouteReturnToAirbase/GRP-400-RouteReturnToAirbase.miz differ diff --git a/Wrapper/Group/500-Ground-TaskRoute/GRP-500-Ground-TaskRoute.lua b/Wrapper/Group/500-Ground-TaskRoute/GRP-500-Ground-TaskRoute.lua index 220bf4e..f1543bf 100644 --- a/Wrapper/Group/500-Ground-TaskRoute/GRP-500-Ground-TaskRoute.lua +++ b/Wrapper/Group/500-Ground-TaskRoute/GRP-500-Ground-TaskRoute.lua @@ -1,39 +1,39 @@ ---- --- Author: FlightControl --- Created: 20.10.2018 --- Contributors: kaltokri --- Modified: 25.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html --- --- # Description: --- --- An APC is placed in the mission editor without any waypoints. --- We will give him a waypoint by the script and task him to move. --- --- # Guide: --- 1. Observe the APC to drive 1km to the east. - --- Get needed object of APC. -local GroundGroup = GROUP:FindByName( "Vehicle" ) - --- Get the current coordinate of APC. -FromCoord = GroundGroup:GetCoordinate() - --- From the current coordinate, calculate 1km away with an angle of 90 degrees (south). -ToCoord = FromCoord:Translate( 1000, 90 ) - --- Create an empty list of route points. -RoutePoints = {} - --- Create a list of "ground route points", which is a "point" structure that can be given as a parameter to a Task. -RoutePoints[#RoutePoints+1] = FromCoord:WaypointGround( 0 ) -- Parameters: Speed -RoutePoints[#RoutePoints+1] = ToCoord:WaypointGround( 60, "Cone" ) -- Parameters: Speed, Formation - --- Create a combo task, that creates a route task to the RoutePoint -RouteTask = GroundGroup:TaskRoute( RoutePoints ) - --- Set the task to be executed by the GroundGroup -GroundGroup:SetTask( RouteTask, 1 ) +--- +-- Author: FlightControl +-- Created: 20.10.2018 +-- Contributors: kaltokri +-- Modified: 25.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html +-- +-- # Description: +-- +-- An APC is placed in the mission editor without any waypoints. +-- We will give him a waypoint by the script and task him to move. +-- +-- # Guide: +-- 1. Observe the APC to drive 1km to the east. + +-- Get needed object of APC. +local GroundGroup = GROUP:FindByName( "Vehicle" ) + +-- Get the current coordinate of APC. +FromCoord = GroundGroup:GetCoordinate() + +-- From the current coordinate, calculate 1km away with an angle of 90 degrees (south). +ToCoord = FromCoord:Translate( 1000, 90 ) + +-- Create an empty list of route points. +RoutePoints = {} + +-- Create a list of "ground route points", which is a "point" structure that can be given as a parameter to a Task. +RoutePoints[#RoutePoints+1] = FromCoord:WaypointGround( 0 ) -- Parameters: Speed +RoutePoints[#RoutePoints+1] = ToCoord:WaypointGround( 60, "Cone" ) -- Parameters: Speed, Formation + +-- Create a combo task, that creates a route task to the RoutePoint +RouteTask = GroundGroup:TaskRoute( RoutePoints ) + +-- Set the task to be executed by the GroundGroup +GroundGroup:SetTask( RouteTask, 1 ) diff --git a/Wrapper/Group/500-Ground-TaskRoute/GRP-500-Ground-TaskRoute.miz b/Wrapper/Group/500-Ground-TaskRoute/GRP-500-Ground-TaskRoute.miz index 344d326..9b727cf 100644 Binary files a/Wrapper/Group/500-Ground-TaskRoute/GRP-500-Ground-TaskRoute.miz and b/Wrapper/Group/500-Ground-TaskRoute/GRP-500-Ground-TaskRoute.miz differ diff --git a/Wrapper/Group/501-Ground-TaskRouteToVec2/GRP-501-Ground-TaskRouteToVec2.lua b/Wrapper/Group/501-Ground-TaskRouteToVec2/GRP-501-Ground-TaskRouteToVec2.lua index 5bc46bb..c2b6be1 100644 --- a/Wrapper/Group/501-Ground-TaskRouteToVec2/GRP-501-Ground-TaskRouteToVec2.lua +++ b/Wrapper/Group/501-Ground-TaskRouteToVec2/GRP-501-Ground-TaskRouteToVec2.lua @@ -1,29 +1,29 @@ ---- --- Author: FlightControl --- Created: 20.10.2018 --- Contributors: kaltokri --- Modified: 25.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html --- --- # Description: --- --- An APC is placed in the mission editor without any waypoints. --- We will give him waypoints by the script and task him to move. --- --- # Guide: --- 1. Observe the APC to drive 1km to the east. - --- Get needed object of APC. -local GroundGroup = GROUP:FindByName( "Vehicle" ) - --- Get the current coordinate of GroundGroup. -FromCoord = GroundGroup:GetCoordinate() - --- From the current coordinate, calculate 1km away with an angle of 180 degrees (south). -ToCoord = FromCoord:Translate( 1000, 90 ) - --- Create a combo task, that creates a route task to the RoutePoint. -GroundGroup:TaskRouteToVec2( ToCoord:GetVec2(), 60 ) -- Parameters: Vec2 & Speed +--- +-- Author: FlightControl +-- Created: 20.10.2018 +-- Contributors: kaltokri +-- Modified: 25.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html +-- +-- # Description: +-- +-- An APC is placed in the mission editor without any waypoints. +-- We will give him waypoints by the script and task him to move. +-- +-- # Guide: +-- 1. Observe the APC to drive 1km to the east. + +-- Get needed object of APC. +local GroundGroup = GROUP:FindByName( "Vehicle" ) + +-- Get the current coordinate of GroundGroup. +FromCoord = GroundGroup:GetCoordinate() + +-- From the current coordinate, calculate 1km away with an angle of 180 degrees (south). +ToCoord = FromCoord:Translate( 1000, 90 ) + +-- Create a combo task, that creates a route task to the RoutePoint. +GroundGroup:TaskRouteToVec2( ToCoord:GetVec2(), 60 ) -- Parameters: Vec2 & Speed diff --git a/Wrapper/Group/501-Ground-TaskRouteToVec2/GRP-501-Ground-TaskRouteToVec2.miz b/Wrapper/Group/501-Ground-TaskRouteToVec2/GRP-501-Ground-TaskRouteToVec2.miz index faae0d2..6ff16ba 100644 Binary files a/Wrapper/Group/501-Ground-TaskRouteToVec2/GRP-501-Ground-TaskRouteToVec2.miz and b/Wrapper/Group/501-Ground-TaskRouteToVec2/GRP-501-Ground-TaskRouteToVec2.miz differ diff --git a/Wrapper/Group/502-Route-at-waypoint-to-random-point/GRP-502-Route-at-waypoint-to-random-point.lua b/Wrapper/Group/502-Route-at-waypoint-to-random-point/GRP-502-Route-at-waypoint-to-random-point.lua index b389e14..1052c9e 100644 --- a/Wrapper/Group/502-Route-at-waypoint-to-random-point/GRP-502-Route-at-waypoint-to-random-point.lua +++ b/Wrapper/Group/502-Route-at-waypoint-to-random-point/GRP-502-Route-at-waypoint-to-random-point.lua @@ -1,58 +1,58 @@ ---- --- Author: FlightControl --- Created: 08.08.2011 --- Contributors: kaltokri --- Modified: 25.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html --- --- # Description: --- --- An APC is placed in the mission editor without any waypoints. --- We will give him waypoints by the script and task him to move. --- On the target waypoint a task is added to call the function RouteToZone again. --- Because of this the vehicle will drive endless from one random zone to another. --- Note: math.random is not good with small numbers so e.g. Zone 1 is selected less frequently than zone 3. --- Note: The script does not prevent the same zone from being selected several times in succession. --- --- # Guide: --- 1. Observe the APC to drive between the zones. - --- Create a list of zone objects. -local ZoneList = { - ZONE:New( "ZONE1" ), - ZONE:New( "ZONE2" ), - ZONE:New( "ZONE3" ), - ZONE:New( "ZONE4" ), - ZONE:New( "ZONE5" ) -} - --- Get needed object of APC. -GroundGroup = GROUP:FindByName( "Vehicle" ) - ---- @param Wrapper.Group#GROUP GroundGroup -function RouteToZone( Vehicle, ZoneRoute ) - local Route = {} - - -- Get the current coordinate of the Vehicle - local FromCoord = Vehicle:GetCoordinate() - - -- Select a random Zone and get the Coordinate of the new Zone. - local RandomZone = ZoneList[ math.random( 1, #ZoneList ) ] -- Core.Zone#ZONE - local ToCoord = RandomZone:GetCoordinate() - Vehicle:MessageToAll( "Moving to zone " .. RandomZone:GetName(), 20 ) - - -- Create a task object, which will call this function. - local TaskRouteToZone = Vehicle:TaskFunction( "RouteToZone", RandomZone ) - - -- Create a list of ground waypoints. Add the task object to the target waypoint. - -- If the vehicle will reach the waypoint the function will be triggered again. - Route[#Route+1] = FromCoord:WaypointGround( 72 ) - Route[#Route+1] = ToCoord:WaypointGround( 72, "Vee", {TaskRouteToZone} ) - - Vehicle:Route( Route, 3 ) -- Follow the Route after 3 seconds. -end - -RouteToZone( GroundGroup, ZoneList[1] ) +--- +-- Author: FlightControl +-- Created: 08.08.2011 +-- Contributors: kaltokri +-- Modified: 25.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html +-- +-- # Description: +-- +-- An APC is placed in the mission editor without any waypoints. +-- We will give him waypoints by the script and task him to move. +-- On the target waypoint a task is added to call the function RouteToZone again. +-- Because of this the vehicle will drive endless from one random zone to another. +-- Note: math.random is not good with small numbers so e.g. Zone 1 is selected less frequently than zone 3. +-- Note: The script does not prevent the same zone from being selected several times in succession. +-- +-- # Guide: +-- 1. Observe the APC to drive between the zones. + +-- Create a list of zone objects. +local ZoneList = { + ZONE:New( "ZONE1" ), + ZONE:New( "ZONE2" ), + ZONE:New( "ZONE3" ), + ZONE:New( "ZONE4" ), + ZONE:New( "ZONE5" ) +} + +-- Get needed object of APC. +GroundGroup = GROUP:FindByName( "Vehicle" ) + +--- @param Wrapper.Group#GROUP GroundGroup +function RouteToZone( Vehicle, ZoneRoute ) + local Route = {} + + -- Get the current coordinate of the Vehicle + local FromCoord = Vehicle:GetCoordinate() + + -- Select a random Zone and get the Coordinate of the new Zone. + local RandomZone = ZoneList[ math.random( 1, #ZoneList ) ] -- Core.Zone#ZONE + local ToCoord = RandomZone:GetCoordinate() + Vehicle:MessageToAll( "Moving to zone " .. RandomZone:GetName(), 20 ) + + -- Create a task object, which will call this function. + local TaskRouteToZone = Vehicle:TaskFunction( "RouteToZone", RandomZone ) + + -- Create a list of ground waypoints. Add the task object to the target waypoint. + -- If the vehicle will reach the waypoint the function will be triggered again. + Route[#Route+1] = FromCoord:WaypointGround( 72 ) + Route[#Route+1] = ToCoord:WaypointGround( 72, "Vee", {TaskRouteToZone} ) + + Vehicle:Route( Route, 3 ) -- Follow the Route after 3 seconds. +end + +RouteToZone( GroundGroup, ZoneList[1] ) diff --git a/Wrapper/Group/502-Route-at-waypoint-to-random-point/GRP-502-Route-at-waypoint-to-random-point.miz b/Wrapper/Group/502-Route-at-waypoint-to-random-point/GRP-502-Route-at-waypoint-to-random-point.miz index e4e21a2..0a5d242 100644 Binary files a/Wrapper/Group/502-Route-at-waypoint-to-random-point/GRP-502-Route-at-waypoint-to-random-point.miz and b/Wrapper/Group/502-Route-at-waypoint-to-random-point/GRP-502-Route-at-waypoint-to-random-point.miz differ diff --git a/Wrapper/Group/503-NTTR-Route-at-waypoint-to-random-point/GRP-503-NTTR-Route-at-waypoint-to-random-point.lua b/Wrapper/Group/503-NTTR-Route-at-waypoint-to-random-point/GRP-503-NTTR-Route-at-waypoint-to-random-point.lua index 55ee162..303fea0 100644 --- a/Wrapper/Group/503-NTTR-Route-at-waypoint-to-random-point/GRP-503-NTTR-Route-at-waypoint-to-random-point.lua +++ b/Wrapper/Group/503-NTTR-Route-at-waypoint-to-random-point/GRP-503-NTTR-Route-at-waypoint-to-random-point.lua @@ -1,54 +1,54 @@ ---- --- Author: FlightControl --- Created: 08.08.2017 --- Contributors: kaltokri --- Modified: 24.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- 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: --- In this mission a vehicle drive (endless) to random zones when a waypoint has been reached. - --- Create a list of all zones in the mission. -local ZoneList = { - ZONE:New( "ZONE1" ), - ZONE:New( "ZONE2" ), - ZONE:New( "ZONE3" ), - ZONE:New( "ZONE4" ), - ZONE:New( "ZONE5" ), -} - --- Get object of the APC. -VehicleGroup = GROUP:FindByName( "APC" ) - ---- Function to ReRoute the APC to another zone. --- @param Wrapper.Group#GROUP RoutedGroup -function ReRoute( VehicleGroup ) - local ZoneNumber = math.random( 1, #ZoneList ) - - -- Write informations to the log. - VehicleGroup:E( "Routing" ) - VehicleGroup:E( ZoneNumber ) - -- Print informations on the screen - VehicleGroup:MessageToAll( "Routing to Zone" .. tostring( ZoneNumber ),30 ) - - -- Create Waypoints. - local FromCoord = VehicleGroup:GetCoordinate() -- Core.Point#COORDINATE - local FromWP = FromCoord:WaypointGround() - - local ZoneTo = ZoneList[ ZoneNumber ] -- Core.Zone#ZONE - local ToCoord = ZoneTo:GetCoordinate() - local ToWP = ToCoord:WaypointGround( 72, "Vee" ) -- Speed 72 km/h, formation Vee. - - -- Create a Task, which will be executed if the waypoint is reached. - -- It will call this function again and because of that the APC will drive endless from one random point to antoher. - local TaskReRoute = VehicleGroup:TaskFunction( "ReRoute" ) - VehicleGroup:SetTaskWaypoint( ToWP, TaskReRoute ) - - VehicleGroup:Route( { FromWP, ToWP }, 1 ) -end - -ReRoute( VehicleGroup ) +--- +-- Author: FlightControl +-- Created: 08.08.2017 +-- Contributors: kaltokri +-- Modified: 24.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- 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: +-- In this mission a vehicle drive (endless) to random zones when a waypoint has been reached. + +-- Create a list of all zones in the mission. +local ZoneList = { + ZONE:New( "ZONE1" ), + ZONE:New( "ZONE2" ), + ZONE:New( "ZONE3" ), + ZONE:New( "ZONE4" ), + ZONE:New( "ZONE5" ), +} + +-- Get object of the APC. +VehicleGroup = GROUP:FindByName( "APC" ) + +--- Function to ReRoute the APC to another zone. +-- @param Wrapper.Group#GROUP RoutedGroup +function ReRoute( VehicleGroup ) + local ZoneNumber = math.random( 1, #ZoneList ) + + -- Write informations to the log. + VehicleGroup:E( "Routing" ) + VehicleGroup:E( ZoneNumber ) + -- Print informations on the screen + VehicleGroup:MessageToAll( "Routing to Zone" .. tostring( ZoneNumber ),30 ) + + -- Create Waypoints. + local FromCoord = VehicleGroup:GetCoordinate() -- Core.Point#COORDINATE + local FromWP = FromCoord:WaypointGround() + + local ZoneTo = ZoneList[ ZoneNumber ] -- Core.Zone#ZONE + local ToCoord = ZoneTo:GetCoordinate() + local ToWP = ToCoord:WaypointGround( 72, "Vee" ) -- Speed 72 km/h, formation Vee. + + -- Create a Task, which will be executed if the waypoint is reached. + -- It will call this function again and because of that the APC will drive endless from one random point to antoher. + local TaskReRoute = VehicleGroup:TaskFunction( "ReRoute" ) + VehicleGroup:SetTaskWaypoint( ToWP, TaskReRoute ) + + VehicleGroup:Route( { FromWP, ToWP }, 1 ) +end + +ReRoute( VehicleGroup ) diff --git a/Wrapper/Group/503-NTTR-Route-at-waypoint-to-random-point/GRP-503-NTTR-Route-at-waypoint-to-random-point.miz b/Wrapper/Group/503-NTTR-Route-at-waypoint-to-random-point/GRP-503-NTTR-Route-at-waypoint-to-random-point.miz index dcb151f..41d2cb7 100644 Binary files a/Wrapper/Group/503-NTTR-Route-at-waypoint-to-random-point/GRP-503-NTTR-Route-at-waypoint-to-random-point.miz and b/Wrapper/Group/503-NTTR-Route-at-waypoint-to-random-point/GRP-503-NTTR-Route-at-waypoint-to-random-point.miz differ diff --git a/Wrapper/Group/504-Pinpoint-Strike-Waypooints-and-Tasking/GRP-504-Pinpoint-Strike-Waypooints-and-Tasking.lua b/Wrapper/Group/504-Pinpoint-Strike-Waypooints-and-Tasking/GRP-504-Pinpoint-Strike-Waypooints-and-Tasking.lua index d8abcc2..7c62591 100644 --- a/Wrapper/Group/504-Pinpoint-Strike-Waypooints-and-Tasking/GRP-504-Pinpoint-Strike-Waypooints-and-Tasking.lua +++ b/Wrapper/Group/504-Pinpoint-Strike-Waypooints-and-Tasking/GRP-504-Pinpoint-Strike-Waypooints-and-Tasking.lua @@ -1,148 +1,148 @@ ---- --- Author: Wingthor --- Created: 22.08.2020 --- Contributors: kaltokri --- Modified: 23.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Scheduler.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Spawn.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html --- --- # Description: --- Mission illustrates how to make an air GROUP do a bomb run by script. --- One template group is placed on map by DCS's Mission Editor. --- Template is set to TASK "Ground Attack" and given proper ordonance in Mission Editor. --- One function handles both attacks by give targets coordinates as arguments. --- This also shows how to do a delayed function call using BASE:ScheduleOnce function. --- Mission also feature a helper function which will return a random waypoint between Airbase and Target. --- --- # Guide: --- 1. Start the mission and wait 5 seconds --- 2. Press F2/F10 to observe the attack run of the blue aircrafts --- 3. Use time acceleration to shorten waiting times - --- Enable tracing when the mission doesn't work as expected. ---BASE:TraceOnOff(true) ---BASE:TraceAll(true) - ---- This function will make a random waypoint between two coordinates. --- @param Core.Point#COORDINATE TargetCoordinate Coordinate of the target --- @param Core.Point#COORDINATE InitCoordinate Initial Coordinate -function MakeMiddleWaypoint (TargetCoordinate, InitCoordinate) - BASE:F({TargetCoordinate,InitCoordinate}) - - -- If we can not resolve the parameters throw noting back so we don't break anything. - if TargetCoordinate == nil or InitCoordinate == nil then return nil end - - local _TargetCoordinate = TargetCoordinate -- Core.Point#COORDINATE - local _InitCoordinate = InitCoordinate -- Core.Point#COORDINATE - local Distance = TargetCoordinate:Get3DDistance( InitCoordinate ) - - if Distance < 30000 then - return nil -- To close for us - elseif Distance > 70000 then - Distance = 70000 - else - Distance = math.random(30000,70000) - end -- This is max distance from target we want our Waypoint - - local Direction = _TargetCoordinate:GetAngleDegrees(_TargetCoordinate:GetDirectionVec3(_InitCoordinate)) - - if Direction > 0 and Direction <=90 then -- North East - return _TargetCoordinate:Translate( Distance, math.random(1,90) ) - elseif Direction > 90 and Direction <= 180 then -- South East - return _TargetCoordinate:Translate( Distance, math.random(91,180) ) - elseif Direction > 180 and Direction <= 270 then -- South West then - return _TargetCoordinate:Translate( Distance,math.random(181,270) ) - elseif Direction > 270 and Direction <= 360 then -- South West then then - return _TargetCoordinate:Translate( Distance,math.random(271,360) ) - else - BASE:E("--- Something wrong in function MakeMiddleWaypoint ---") - return nil - end -end - - ---- Function to order a strike --- @param #string Group Name of the group --- @param Core.Point#COORDINATE Target Coordinates of the target --- @param #string Base Name of the home base --- @param #string TargetDescription Description of the target -function PinpointStrike( Group, Target, Base, TargetDescription ) - BASE:F({ Group, Target, Base }) - - -- nil check for arguments. - if Group == nil or Target == nil or Base == nil then return nil end - - -- Make a default description - if TargetDescription == nil then - TargetDescription = "Bomb Target" - end - - -- Make a Random heading from the target which will serve as an IP (90-180°) - local heading = math.random( 90, 180 ) - - -- Get targets vectors - local targetVec = Target:GetVec2() - - -- Make a Spawn counter - if SpawnCounter == nil then - SpawnCounter = 0 - else - SpawnCounter = SpawnCounter + 1 - end - - -- Spawn the bomber and return a GROUP object - local SpawnBomber = SPAWN:NewWithAlias( Group, "Bomber_" .. tostring(SpawnCounter) ) - :OnSpawnGroup( - --- @param - function ( group ) - group:MessageToBlue( "Launching the Pinpoint strike", 40 ) - end, {} - ) - - local homebasecoords = AIRBASE:FindByName(Base):GetCoordinate() --Core.Point#COORDINATE - local bomber = SpawnBomber:SpawnAtAirbase( AIRBASE:FindByName( Base ), SPAWN.Takeoff.Cold ) - local task = bomber:TaskBombing( targetVec, false, "All", nil, heading, 10000) - - --- Make a waypoint table - local waypoints = {} - - --- Get coordinate for Home Base - local homecoords = AIRBASE:FindByName(Base):GetCoordinate():SetAltitude(8000):Translate(10 * 10000,300) - - -- Make an ingress point for the bomber - local IngressPoint = MakeMiddleWaypoint( Target, homebasecoords ) --Core.Point#COORDINATE - if IngressPoint == nil then -- Its important to handle the edge cases so we don't break anything. Better throw something to log. - BASE:E("--- Error in PinpointStrike target is too close to base ---" ) - return nil - end - - -- Set the coordinate altitude - IngressPoint:SetAltitude(8000) - - -- Add coordinates to table and make Waypoints - waypoints[1] = homebasecoords:WaypointAirTakeOffParking() - waypoints[2] = IngressPoint:WaypointAirTurningPoint( nil, 950, {task}, TargetDescription ) - waypoints[3] = homecoords:WaypointAirTurningPoint() - waypoints[4] = homebasecoords:WaypointAirLanding() - - -- Push the waypoint table the bomber - bomber:Route( waypoints ) - -end - --- local targetCoords = ZONE:New("Blue Bridge"):GetCoordinate() -local CommandCenterCoords = STATIC:FindByName( "SAM ControlCenter", false ):GetCoordinate() -- Core.Point#COORDINATE - --- I have added a small zone over a scenery object in order to grab the coordinates. -local SceneryTargetCoordiate = ZONE:New("SceneryTarget"):GetCoordinate() - --- Call the function PinpointStrike 5 seconds after mission start with 4 parameters: Group, Target, Base, TargetDescription -BASE:ScheduleOnce( 5, PinpointStrike, "Blue Owl 1-1", CommandCenterCoords, AIRBASE.Caucasus.Sukhumi_Babushara, "Bomb Command Center" ) - --- Call the function PinpointStrike 10 seconds after mission start with 4 parameters: Group, Target, Base, TargetDescription -BASE:ScheduleOnce( 10, PinpointStrike, "Blue Owl 1-1", SceneryTargetCoordiate, AIRBASE.Caucasus.Sukhumi_Babushara, "Bomb Commanders House" ) +--- +-- Author: Wingthor +-- Created: 22.08.2020 +-- Contributors: kaltokri +-- Modified: 23.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Scheduler.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Spawn.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Static.html +-- +-- # Description: +-- Mission illustrates how to make an air GROUP do a bomb run by script. +-- One template group is placed on map by DCS's Mission Editor. +-- Template is set to TASK "Ground Attack" and given proper ordonance in Mission Editor. +-- One function handles both attacks by give targets coordinates as arguments. +-- This also shows how to do a delayed function call using BASE:ScheduleOnce function. +-- Mission also feature a helper function which will return a random waypoint between Airbase and Target. +-- +-- # Guide: +-- 1. Start the mission and wait 5 seconds +-- 2. Press F2/F10 to observe the attack run of the blue aircrafts +-- 3. Use time acceleration to shorten waiting times + +-- Enable tracing when the mission doesn't work as expected. +--BASE:TraceOnOff(true) +--BASE:TraceAll(true) + +--- This function will make a random waypoint between two coordinates. +-- @param Core.Point#COORDINATE TargetCoordinate Coordinate of the target +-- @param Core.Point#COORDINATE InitCoordinate Initial Coordinate +function MakeMiddleWaypoint (TargetCoordinate, InitCoordinate) + BASE:F({TargetCoordinate,InitCoordinate}) + + -- If we can not resolve the parameters throw noting back so we don't break anything. + if TargetCoordinate == nil or InitCoordinate == nil then return nil end + + local _TargetCoordinate = TargetCoordinate -- Core.Point#COORDINATE + local _InitCoordinate = InitCoordinate -- Core.Point#COORDINATE + local Distance = TargetCoordinate:Get3DDistance( InitCoordinate ) + + if Distance < 30000 then + return nil -- To close for us + elseif Distance > 70000 then + Distance = 70000 + else + Distance = math.random(30000,70000) + end -- This is max distance from target we want our Waypoint + + local Direction = _TargetCoordinate:GetAngleDegrees(_TargetCoordinate:GetDirectionVec3(_InitCoordinate)) + + if Direction > 0 and Direction <=90 then -- North East + return _TargetCoordinate:Translate( Distance, math.random(1,90) ) + elseif Direction > 90 and Direction <= 180 then -- South East + return _TargetCoordinate:Translate( Distance, math.random(91,180) ) + elseif Direction > 180 and Direction <= 270 then -- South West then + return _TargetCoordinate:Translate( Distance,math.random(181,270) ) + elseif Direction > 270 and Direction <= 360 then -- South West then then + return _TargetCoordinate:Translate( Distance,math.random(271,360) ) + else + BASE:E("--- Something wrong in function MakeMiddleWaypoint ---") + return nil + end +end + + +--- Function to order a strike +-- @param #string Group Name of the group +-- @param Core.Point#COORDINATE Target Coordinates of the target +-- @param #string Base Name of the home base +-- @param #string TargetDescription Description of the target +function PinpointStrike( Group, Target, Base, TargetDescription ) + BASE:F({ Group, Target, Base }) + + -- nil check for arguments. + if Group == nil or Target == nil or Base == nil then return nil end + + -- Make a default description + if TargetDescription == nil then + TargetDescription = "Bomb Target" + end + + -- Make a Random heading from the target which will serve as an IP (90-180°) + local heading = math.random( 90, 180 ) + + -- Get targets vectors + local targetVec = Target:GetVec2() + + -- Make a Spawn counter + if SpawnCounter == nil then + SpawnCounter = 0 + else + SpawnCounter = SpawnCounter + 1 + end + + -- Spawn the bomber and return a GROUP object + local SpawnBomber = SPAWN:NewWithAlias( Group, "Bomber_" .. tostring(SpawnCounter) ) + :OnSpawnGroup( + --- @param + function ( group ) + group:MessageToBlue( "Launching the Pinpoint strike", 40 ) + end, {} + ) + + local homebasecoords = AIRBASE:FindByName(Base):GetCoordinate() --Core.Point#COORDINATE + local bomber = SpawnBomber:SpawnAtAirbase( AIRBASE:FindByName( Base ), SPAWN.Takeoff.Cold ) + local task = bomber:TaskBombing( targetVec, false, "All", nil, heading, 10000) + + --- Make a waypoint table + local waypoints = {} + + --- Get coordinate for Home Base + local homecoords = AIRBASE:FindByName(Base):GetCoordinate():SetAltitude(8000):Translate(10 * 10000,300) + + -- Make an ingress point for the bomber + local IngressPoint = MakeMiddleWaypoint( Target, homebasecoords ) --Core.Point#COORDINATE + if IngressPoint == nil then -- Its important to handle the edge cases so we don't break anything. Better throw something to log. + BASE:E("--- Error in PinpointStrike target is too close to base ---" ) + return nil + end + + -- Set the coordinate altitude + IngressPoint:SetAltitude(8000) + + -- Add coordinates to table and make Waypoints + waypoints[1] = homebasecoords:WaypointAirTakeOffParking() + waypoints[2] = IngressPoint:WaypointAirTurningPoint( nil, 950, {task}, TargetDescription ) + waypoints[3] = homecoords:WaypointAirTurningPoint() + waypoints[4] = homebasecoords:WaypointAirLanding() + + -- Push the waypoint table the bomber + bomber:Route( waypoints ) + +end + +-- local targetCoords = ZONE:New("Blue Bridge"):GetCoordinate() +local CommandCenterCoords = STATIC:FindByName( "SAM ControlCenter", false ):GetCoordinate() -- Core.Point#COORDINATE + +-- I have added a small zone over a scenery object in order to grab the coordinates. +local SceneryTargetCoordiate = ZONE:New("SceneryTarget"):GetCoordinate() + +-- Call the function PinpointStrike 5 seconds after mission start with 4 parameters: Group, Target, Base, TargetDescription +BASE:ScheduleOnce( 5, PinpointStrike, "Blue Owl 1-1", CommandCenterCoords, AIRBASE.Caucasus.Sukhumi_Babushara, "Bomb Command Center" ) + +-- Call the function PinpointStrike 10 seconds after mission start with 4 parameters: Group, Target, Base, TargetDescription +BASE:ScheduleOnce( 10, PinpointStrike, "Blue Owl 1-1", SceneryTargetCoordiate, AIRBASE.Caucasus.Sukhumi_Babushara, "Bomb Commanders House" ) diff --git a/Wrapper/Group/504-Pinpoint-Strike-Waypooints-and-Tasking/GRP-504-Pinpoint-Strike-Waypooints-and-Tasking.miz b/Wrapper/Group/504-Pinpoint-Strike-Waypooints-and-Tasking/GRP-504-Pinpoint-Strike-Waypooints-and-Tasking.miz index 1c9a10c..7395443 100644 Binary files a/Wrapper/Group/504-Pinpoint-Strike-Waypooints-and-Tasking/GRP-504-Pinpoint-Strike-Waypooints-and-Tasking.miz and b/Wrapper/Group/504-Pinpoint-Strike-Waypooints-and-Tasking/GRP-504-Pinpoint-Strike-Waypooints-and-Tasking.miz differ diff --git a/Wrapper/Group/510-Task-Follow/GRP-510-Task-Follow.lua b/Wrapper/Group/510-Task-Follow/GRP-510-Task-Follow.lua index 7bbf19a..dc08fb0 100644 --- a/Wrapper/Group/510-Task-Follow/GRP-510-Task-Follow.lua +++ b/Wrapper/Group/510-Task-Follow/GRP-510-Task-Follow.lua @@ -1,52 +1,52 @@ ---- --- Author: Targs35 (from 62nd Air Wing) & FlightControl --- Created: 11.01.2021 --- Contributors: kaltokri --- Modified: 26.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Spawn.html --- --- # Description: --- A tanker will start from Sochi-Adler. --- Two F-15C will also start from Sochi-Adler and join the tanker as escort. --- --- # Guide: --- 1. Start the mission and wait some seconds --- 2. Press F2/F10 to observe the aircrafts --- 3. Use time acceleration to shorten waiting times - --- Create Spawn Groups -local Tanker_Texaco = SPAWN:New( "Tanker_Texaco_Droge" ) - :InitLimit( 1, 10 ) - :InitCleanUp( 240 ) - :SpawnScheduled( 60, .0 ) - -local Escort_Texaco_1 = SPAWN:New( "Escort_Texaco_F15C-1" ) - :InitLimit( 1, 20 ) - :InitCleanUp( 240 ) - :SpawnScheduled( 120, .1 ) - -local Escort_Texaco_2 = SPAWN:New( "Escort_Texaco_F15C" ) - :InitLimit( 1, 20 ) - :InitCleanUp( 240 ) - :SpawnScheduled( 120, .2 ) - --- Spawn Groups into world -local GroupTanker_Texaco = Tanker_Texaco:Spawn() -local GroupEscort_Texaco_1 = Escort_Texaco_1:Spawn() -local GroupEscort_Texaco_2 = Escort_Texaco_2:Spawn() - --- Define the distance from Tanker to Escort -local PointVec1 = POINT_VEC3:New( -100, 20, 80 ) -- This is a Vec3 class. -local PointVec2 = POINT_VEC3:New( -100, 20, 150 ) -- This is a Vec3 class. - --- Define Escort tasks -local FollowDCSTask1 = GroupEscort_Texaco_1:TaskFollow( GroupTanker_Texaco, PointVec1:GetVec3() ) -local FollowDCSTask2 = GroupEscort_Texaco_2:TaskFollow( GroupTanker_Texaco, PointVec2:GetVec3() ) -GroupEscort_Texaco_1:SetTask( FollowDCSTask1, 1 ) -GroupEscort_Texaco_2:SetTask( FollowDCSTask2, 2 ) - -MESSAGE:New( "Tanker_Texaco Loaded", 25 ):ToAll() +--- +-- Author: Targs35 (from 62nd Air Wing) & FlightControl +-- Created: 11.01.2021 +-- Contributors: kaltokri +-- Modified: 26.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Point.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Spawn.html +-- +-- # Description: +-- A tanker will start from Sochi-Adler. +-- Two F-15C will also start from Sochi-Adler and join the tanker as escort. +-- +-- # Guide: +-- 1. Start the mission and wait some seconds +-- 2. Press F2/F10 to observe the aircrafts +-- 3. Use time acceleration to shorten waiting times + +-- Create Spawn Groups +local Tanker_Texaco = SPAWN:New( "Tanker_Texaco_Droge" ) + :InitLimit( 1, 10 ) + :InitCleanUp( 240 ) + :SpawnScheduled( 60, .0 ) + +local Escort_Texaco_1 = SPAWN:New( "Escort_Texaco_F15C-1" ) + :InitLimit( 1, 20 ) + :InitCleanUp( 240 ) + :SpawnScheduled( 120, .1 ) + +local Escort_Texaco_2 = SPAWN:New( "Escort_Texaco_F15C" ) + :InitLimit( 1, 20 ) + :InitCleanUp( 240 ) + :SpawnScheduled( 120, .2 ) + +-- Spawn Groups into world +local GroupTanker_Texaco = Tanker_Texaco:Spawn() +local GroupEscort_Texaco_1 = Escort_Texaco_1:Spawn() +local GroupEscort_Texaco_2 = Escort_Texaco_2:Spawn() + +-- Define the distance from Tanker to Escort +local PointVec1 = POINT_VEC3:New( -100, 20, 80 ) -- This is a Vec3 class. +local PointVec2 = POINT_VEC3:New( -100, 20, 150 ) -- This is a Vec3 class. + +-- Define Escort tasks +local FollowDCSTask1 = GroupEscort_Texaco_1:TaskFollow( GroupTanker_Texaco, PointVec1:GetVec3() ) +local FollowDCSTask2 = GroupEscort_Texaco_2:TaskFollow( GroupTanker_Texaco, PointVec2:GetVec3() ) +GroupEscort_Texaco_1:SetTask( FollowDCSTask1, 1 ) +GroupEscort_Texaco_2:SetTask( FollowDCSTask2, 2 ) + +MESSAGE:New( "Tanker_Texaco Loaded", 25 ):ToAll() diff --git a/Wrapper/Group/510-Task-Follow/GRP-510-Task-Follow.miz b/Wrapper/Group/510-Task-Follow/GRP-510-Task-Follow.miz index a08098f..7988cc5 100644 Binary files a/Wrapper/Group/510-Task-Follow/GRP-510-Task-Follow.miz and b/Wrapper/Group/510-Task-Follow/GRP-510-Task-Follow.miz differ diff --git a/Wrapper/Group/550-Patrol-a-route/GRP-550-Patrol-a-route.lua b/Wrapper/Group/550-Patrol-a-route/GRP-550-Patrol-a-route.lua index e895bfa..1cf3aff 100644 --- a/Wrapper/Group/550-Patrol-a-route/GRP-550-Patrol-a-route.lua +++ b/Wrapper/Group/550-Patrol-a-route/GRP-550-Patrol-a-route.lua @@ -1,30 +1,30 @@ ---- --- Author: FlightControl --- Created: 24.09.2017 --- Contributors: kaltokri --- Modified: 26.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- --- # Description: --- In this mission two vehicles drive their route in a repetitive way. --- --- # Guide: --- 1. Start the mission and wait some seconds. --- 2. Press F10 to observe the ship and the tank traveling around. --- 3. The boat will drive to the red markings on the F10 map. --- 4. The APC will drive to the placed cones. --- 5. Use time acceleration to shorten waiting times - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Patrol the route of the Vehicle. -Vehicle:PatrolRoute() - --- Find the Ship and create a GROUP object. -Ship = GROUP:FindByName( "Ship" ) - --- Patrol the route of the Ship. -Ship:PatrolRoute() +--- +-- Author: FlightControl +-- Created: 24.09.2017 +-- Contributors: kaltokri +-- Modified: 26.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- +-- # Description: +-- In this mission two vehicles drive their route in a repetitive way. +-- +-- # Guide: +-- 1. Start the mission and wait some seconds. +-- 2. Press F10 to observe the ship and the tank traveling around. +-- 3. The boat will drive to the red markings on the F10 map. +-- 4. The APC will drive to the placed cones. +-- 5. Use time acceleration to shorten waiting times + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Patrol the route of the Vehicle. +Vehicle:PatrolRoute() + +-- Find the Ship and create a GROUP object. +Ship = GROUP:FindByName( "Ship" ) + +-- Patrol the route of the Ship. +Ship:PatrolRoute() diff --git a/Wrapper/Group/550-Patrol-a-route/GRP-550-Patrol-a-route.miz b/Wrapper/Group/550-Patrol-a-route/GRP-550-Patrol-a-route.miz index cc48be7..ee06d53 100644 Binary files a/Wrapper/Group/550-Patrol-a-route/GRP-550-Patrol-a-route.miz and b/Wrapper/Group/550-Patrol-a-route/GRP-550-Patrol-a-route.miz differ diff --git a/Wrapper/Group/551-Patrol-to-random-points-of-a-route/GRP-551-Patrol-to-random-points-of-a-route.lua b/Wrapper/Group/551-Patrol-to-random-points-of-a-route/GRP-551-Patrol-to-random-points-of-a-route.lua index 9370a77..f33f0c6 100644 --- a/Wrapper/Group/551-Patrol-to-random-points-of-a-route/GRP-551-Patrol-to-random-points-of-a-route.lua +++ b/Wrapper/Group/551-Patrol-to-random-points-of-a-route/GRP-551-Patrol-to-random-points-of-a-route.lua @@ -1,29 +1,29 @@ ---- --- Author: FlightControl --- Created: 24.09.2017 --- Contributors: kaltokri --- Modified: 26.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- --- # Description: --- This makes vehicles drive its route in a random way. --- --- # Guide: --- 1. Start the mission and wait some seconds. --- 2. Press F10 to observe the ship and the tank traveling around. --- 3. The boat will drive to a random red marking on the F10 map. --- 4. The APC will drive to a random one of the placed cones. - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Patrol to a random chosen waypoint of the route at 120 km/h in "Vee" formation. -Vehicle:PatrolRouteRandom( 120, "Vee" ) - --- Find the Ship and create a GROUP object. -Ship = GROUP:FindByName( "Ship" ) - --- Patrol to a random chosen waypoint of the route at 120 km/h in "Vee" formation. -Ship:PatrolRouteRandom( 120, "Vee" ) +--- +-- Author: FlightControl +-- Created: 24.09.2017 +-- Contributors: kaltokri +-- Modified: 26.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- +-- # Description: +-- This makes vehicles drive its route in a random way. +-- +-- # Guide: +-- 1. Start the mission and wait some seconds. +-- 2. Press F10 to observe the ship and the tank traveling around. +-- 3. The boat will drive to a random red marking on the F10 map. +-- 4. The APC will drive to a random one of the placed cones. + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Patrol to a random chosen waypoint of the route at 120 km/h in "Vee" formation. +Vehicle:PatrolRouteRandom( 120, "Vee" ) + +-- Find the Ship and create a GROUP object. +Ship = GROUP:FindByName( "Ship" ) + +-- Patrol to a random chosen waypoint of the route at 120 km/h in "Vee" formation. +Ship:PatrolRouteRandom( 120, "Vee" ) diff --git a/Wrapper/Group/551-Patrol-to-random-points-of-a-route/GRP-551-Patrol-to-random-points-of-a-route.miz b/Wrapper/Group/551-Patrol-to-random-points-of-a-route/GRP-551-Patrol-to-random-points-of-a-route.miz index e8c6361..3a4a450 100644 Binary files a/Wrapper/Group/551-Patrol-to-random-points-of-a-route/GRP-551-Patrol-to-random-points-of-a-route.miz and b/Wrapper/Group/551-Patrol-to-random-points-of-a-route/GRP-551-Patrol-to-random-points-of-a-route.miz differ diff --git a/Wrapper/Group/552-Patrol-in-a-zone/GRP-552-Patrol-in-a-zone.lua b/Wrapper/Group/552-Patrol-in-a-zone/GRP-552-Patrol-in-a-zone.lua index 984f065..a7e9838 100644 --- a/Wrapper/Group/552-Patrol-in-a-zone/GRP-552-Patrol-in-a-zone.lua +++ b/Wrapper/Group/552-Patrol-in-a-zone/GRP-552-Patrol-in-a-zone.lua @@ -1,28 +1,28 @@ ---- --- Author: FlightControl --- Created: 24.09.2017 --- Contributors: kaltokri --- Modified: 26.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- --- # Description: --- In this mission two vehicles drive its route selecting random points in a zone. --- --- # Guide: --- 1. Start the mission and wait some seconds. --- 2. Press F10 to observe the ship and the tank traveling around in the zones. --- 3. Use time acceleration to shorten waiting times - --- Find the Vehicles and create GROUP objects. -Vehicle = GROUP:FindByName( "Vehicle" ) -Ship = GROUP:FindByName( "Ship" ) - --- Find zones and create ZONE objects and mark both zones on the F10 map. -local zoneVehicle = ZONE:New( "ZONEVEHICLE" ):DrawZone() -local zoneShip = ZONE:New( "ZONESHIP" ):DrawZone() - --- Patrol to random points in the trigger zone at 120 km/h in Vee format. -Vehicle:PatrolZones( { zoneVehicle }, 120, "Vee" ) -Ship:PatrolZones( { zoneShip }, 120, "Vee" ) +--- +-- Author: FlightControl +-- Created: 24.09.2017 +-- Contributors: kaltokri +-- Modified: 26.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- +-- # Description: +-- In this mission two vehicles drive its route selecting random points in a zone. +-- +-- # Guide: +-- 1. Start the mission and wait some seconds. +-- 2. Press F10 to observe the ship and the tank traveling around in the zones. +-- 3. Use time acceleration to shorten waiting times + +-- Find the Vehicles and create GROUP objects. +Vehicle = GROUP:FindByName( "Vehicle" ) +Ship = GROUP:FindByName( "Ship" ) + +-- Find zones and create ZONE objects and mark both zones on the F10 map. +local zoneVehicle = ZONE:New( "ZONEVEHICLE" ):DrawZone() +local zoneShip = ZONE:New( "ZONESHIP" ):DrawZone() + +-- Patrol to random points in the trigger zone at 120 km/h in Vee format. +Vehicle:PatrolZones( { zoneVehicle }, 120, "Vee" ) +Ship:PatrolZones( { zoneShip }, 120, "Vee" ) diff --git a/Wrapper/Group/552-Patrol-in-a-zone/GRP-552-Patrol-in-a-zone.miz b/Wrapper/Group/552-Patrol-in-a-zone/GRP-552-Patrol-in-a-zone.miz index 3e4dcfa..fae3167 100644 Binary files a/Wrapper/Group/552-Patrol-in-a-zone/GRP-552-Patrol-in-a-zone.miz and b/Wrapper/Group/552-Patrol-in-a-zone/GRP-552-Patrol-in-a-zone.miz differ diff --git a/Wrapper/Group/553-Patrol-in-a-list-of-zones/GRP-553-Patrol-in-a-list-of-zones.lua b/Wrapper/Group/553-Patrol-in-a-list-of-zones/GRP-553-Patrol-in-a-list-of-zones.lua index 0fb3aa2..2d2f4e0 100644 --- a/Wrapper/Group/553-Patrol-in-a-list-of-zones/GRP-553-Patrol-in-a-list-of-zones.lua +++ b/Wrapper/Group/553-Patrol-in-a-list-of-zones/GRP-553-Patrol-in-a-list-of-zones.lua @@ -1,37 +1,37 @@ ---- --- Author: FlightControl --- Created: 24.09.2017 --- Contributors: kaltokri --- Modified: 27.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html --- --- # Description: --- In this mission two vehicles drive their routes selecting random points in random zones. --- --- # Guide: --- 1. Start the mission and wait some seconds. --- 2. Press F10 to observe the ship and the tank traveling around in the zones. --- 3. Use time acceleration to shorten waiting times - --- Find the Vehicles and create GROUP objects. -Vehicle = GROUP:FindByName( "Vehicle" ) -Ship = GROUP:FindByName( "Ship" ) - --- Patrol to random points in the zones ZONEVEHICLE1, ZONEVEHICLE2, ZONEVEHICLE3, at 120 km/h in Vee format. -Vehicle:PatrolZones( - { - ZONE:New( "ZONEVEHICLE1" ):DrawZone(), - ZONE:New( "ZONEVEHICLE2" ):DrawZone(), - ZONE:New( "ZONEVEHICLE3" ):DrawZone() - }, 120, "Vee" ) - --- Patrol to random points in the zones ZONESHIP1, ZONESHIP2, ZONESHIP3, at 120 km/h in Vee format. -Ship:PatrolZones( - { - ZONE:New( "ZONESHIP1" ):DrawZone(), - ZONE:New( "ZONESHIP2" ):DrawZone(), - ZONE:New( "ZONESHIP3" ):DrawZone() - }, 120, "Vee" ) +--- +-- Author: FlightControl +-- Created: 24.09.2017 +-- Contributors: kaltokri +-- Modified: 27.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Zone.html +-- +-- # Description: +-- In this mission two vehicles drive their routes selecting random points in random zones. +-- +-- # Guide: +-- 1. Start the mission and wait some seconds. +-- 2. Press F10 to observe the ship and the tank traveling around in the zones. +-- 3. Use time acceleration to shorten waiting times + +-- Find the Vehicles and create GROUP objects. +Vehicle = GROUP:FindByName( "Vehicle" ) +Ship = GROUP:FindByName( "Ship" ) + +-- Patrol to random points in the zones ZONEVEHICLE1, ZONEVEHICLE2, ZONEVEHICLE3, at 120 km/h in Vee format. +Vehicle:PatrolZones( + { + ZONE:New( "ZONEVEHICLE1" ):DrawZone(), + ZONE:New( "ZONEVEHICLE2" ):DrawZone(), + ZONE:New( "ZONEVEHICLE3" ):DrawZone() + }, 120, "Vee" ) + +-- Patrol to random points in the zones ZONESHIP1, ZONESHIP2, ZONESHIP3, at 120 km/h in Vee format. +Ship:PatrolZones( + { + ZONE:New( "ZONESHIP1" ):DrawZone(), + ZONE:New( "ZONESHIP2" ):DrawZone(), + ZONE:New( "ZONESHIP3" ):DrawZone() + }, 120, "Vee" ) diff --git a/Wrapper/Group/553-Patrol-in-a-list-of-zones/GRP-553-Patrol-in-a-list-of-zones.miz b/Wrapper/Group/553-Patrol-in-a-list-of-zones/GRP-553-Patrol-in-a-list-of-zones.miz index 52a3ee0..22fbed2 100644 Binary files a/Wrapper/Group/553-Patrol-in-a-list-of-zones/GRP-553-Patrol-in-a-list-of-zones.miz and b/Wrapper/Group/553-Patrol-in-a-list-of-zones/GRP-553-Patrol-in-a-list-of-zones.miz differ diff --git a/Wrapper/Group/600-Respawn/GRP-600-Respawn.lua b/Wrapper/Group/600-Respawn/GRP-600-Respawn.lua index 6cdeedd..6d4ebe5 100644 --- a/Wrapper/Group/600-Respawn/GRP-600-Respawn.lua +++ b/Wrapper/Group/600-Respawn/GRP-600-Respawn.lua @@ -1,31 +1,31 @@ ---- --- Author: FlightControl --- Created: 01.03.2018 --- Contributors: kaltokri --- Modified: 27.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html --- --- # Description: --- In this mission a vehicle will be damaged by Explode and then respawned with full health. --- --- # Guide: --- 1. Start the mission and wait 10 seconds. --- 2. The Vehicle will be damaged. --- 3. Wait additional 10 seconds and the Vehicle will be respawned with full health. - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Damage the vehicle with a delay of 10 seconds. -Vehicle:Explode( 1, 10 ) -MESSAGE:New( "Vehicle will be damaged in 10 seconds and respawn in 20 seconds!", 10 ):ToAll():ToLog() - --- Respawn the vehicle 20 seconds after mission start. -TIMER:New( - function() - Vehicle:Respawn() - end -):Start( 20 ) +--- +-- Author: FlightControl +-- Created: 01.03.2018 +-- Contributors: kaltokri +-- Modified: 27.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html +-- +-- # Description: +-- In this mission a vehicle will be damaged by Explode and then respawned with full health. +-- +-- # Guide: +-- 1. Start the mission and wait 10 seconds. +-- 2. The Vehicle will be damaged. +-- 3. Wait additional 10 seconds and the Vehicle will be respawned with full health. + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Damage the vehicle with a delay of 10 seconds. +Vehicle:Explode( 1, 10 ) +MESSAGE:New( "Vehicle will be damaged in 10 seconds and respawn in 20 seconds!", 10 ):ToAll():ToLog() + +-- Respawn the vehicle 20 seconds after mission start. +TIMER:New( + function() + Vehicle:Respawn() + end +):Start( 20 ) diff --git a/Wrapper/Group/600-Respawn/GRP-600-Respawn.miz b/Wrapper/Group/600-Respawn/GRP-600-Respawn.miz index b4a2038..cca9ffa 100644 Binary files a/Wrapper/Group/600-Respawn/GRP-600-Respawn.miz and b/Wrapper/Group/600-Respawn/GRP-600-Respawn.miz differ diff --git a/Wrapper/Group/601-Respawn-hidden/GRP-601-Respawn-hidden.lua b/Wrapper/Group/601-Respawn-hidden/GRP-601-Respawn-hidden.lua index 3aff366..c2f6159 100644 --- a/Wrapper/Group/601-Respawn-hidden/GRP-601-Respawn-hidden.lua +++ b/Wrapper/Group/601-Respawn-hidden/GRP-601-Respawn-hidden.lua @@ -1,32 +1,32 @@ ---- --- Author: FlightControl --- Created: 01.03.2018 --- Contributors: kaltokri --- Modified: 27.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html --- --- # Description: --- In this mission a vehicle will be damaged by Explode and then respawned with full health. --- --- # Guide: --- 1. Start the mission and wait 10 seconds. --- 2. The Vehicle will be damaged. --- 3. Wait additional 10 seconds and the Vehicle will be respawned with full health. --- Note: In this mission the vehicle is set hidden, so it is not shown on the F10 map. - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Damage the vehicle with a delay of 10 seconds. -Vehicle:Explode( 1, 10 ) -MESSAGE:New( "Vehicle will be damaged in 10 seconds and respawn in 20 seconds!", 10 ):ToAll():ToLog() - --- Respawn the vehicle 20 seconds after mission start. -TIMER:New( - function() - Vehicle:Respawn() - end -):Start( 20 ) +--- +-- Author: FlightControl +-- Created: 01.03.2018 +-- Contributors: kaltokri +-- Modified: 27.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html +-- +-- # Description: +-- In this mission a vehicle will be damaged by Explode and then respawned with full health. +-- +-- # Guide: +-- 1. Start the mission and wait 10 seconds. +-- 2. The Vehicle will be damaged. +-- 3. Wait additional 10 seconds and the Vehicle will be respawned with full health. +-- Note: In this mission the vehicle is set hidden, so it is not shown on the F10 map. + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Damage the vehicle with a delay of 10 seconds. +Vehicle:Explode( 1, 10 ) +MESSAGE:New( "Vehicle will be damaged in 10 seconds and respawn in 20 seconds!", 10 ):ToAll():ToLog() + +-- Respawn the vehicle 20 seconds after mission start. +TIMER:New( + function() + Vehicle:Respawn() + end +):Start( 20 ) diff --git a/Wrapper/Group/601-Respawn-hidden/GRP-601-Respawn-hidden.miz b/Wrapper/Group/601-Respawn-hidden/GRP-601-Respawn-hidden.miz index 1be6ffd..6a43132 100644 Binary files a/Wrapper/Group/601-Respawn-hidden/GRP-601-Respawn-hidden.miz and b/Wrapper/Group/601-Respawn-hidden/GRP-601-Respawn-hidden.miz differ diff --git a/Wrapper/Group/610-Respawn-in-Zone/GRP-610-Respawn-in-Zone.lua b/Wrapper/Group/610-Respawn-in-Zone/GRP-610-Respawn-in-Zone.lua index bc3d9bd..d68e316 100644 --- a/Wrapper/Group/610-Respawn-in-Zone/GRP-610-Respawn-in-Zone.lua +++ b/Wrapper/Group/610-Respawn-in-Zone/GRP-610-Respawn-in-Zone.lua @@ -1,36 +1,36 @@ ---- --- Author: FlightControl --- Created: 01.03.2018 --- Contributors: kaltokri --- Modified: 27.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html --- --- # Description: --- In this mission a vehicle will be respawned in a zone. --- --- # Guide: --- 1. Start the mission. --- 2. Take a look at F10 map. The Vehicle is outside of the zone. --- 3. Wait 10 seconds. --- 2. The Vehicle will be respawned. This time it is in the target zone. - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):DrawZone() - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) - -MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() - --- Respawn the vehicle 10 seconds after mission start. -TIMER:New( - function() - Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position - end -):Start( 10 ) +--- +-- Author: FlightControl +-- Created: 01.03.2018 +-- Contributors: kaltokri +-- Modified: 27.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html +-- +-- # Description: +-- In this mission a vehicle will be respawned in a zone. +-- +-- # Guide: +-- 1. Start the mission. +-- 2. Take a look at F10 map. The Vehicle is outside of the zone. +-- 3. Wait 10 seconds. +-- 2. The Vehicle will be respawned. This time it is in the target zone. + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):DrawZone() + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) + +MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() + +-- Respawn the vehicle 10 seconds after mission start. +TIMER:New( + function() + Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position + end +):Start( 10 ) diff --git a/Wrapper/Group/610-Respawn-in-Zone/GRP-610-Respawn-in-Zone.miz b/Wrapper/Group/610-Respawn-in-Zone/GRP-610-Respawn-in-Zone.miz index ec2086c..95d1d71 100644 Binary files a/Wrapper/Group/610-Respawn-in-Zone/GRP-610-Respawn-in-Zone.miz and b/Wrapper/Group/610-Respawn-in-Zone/GRP-610-Respawn-in-Zone.miz differ diff --git a/Wrapper/Group/611-Respawn-multiple-units-in-Zone/GRP-611-Respawn-multiple-units-in-Zone.lua b/Wrapper/Group/611-Respawn-multiple-units-in-Zone/GRP-611-Respawn-multiple-units-in-Zone.lua index 54aa500..8350149 100644 --- a/Wrapper/Group/611-Respawn-multiple-units-in-Zone/GRP-611-Respawn-multiple-units-in-Zone.lua +++ b/Wrapper/Group/611-Respawn-multiple-units-in-Zone/GRP-611-Respawn-multiple-units-in-Zone.lua @@ -1,38 +1,38 @@ ---- --- Author: FlightControl --- Created: 01.03.2018 --- Contributors: kaltokri --- Modified: 27.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html --- --- # Description: --- In this mission a vehicle group will be respawned in a zone. --- The vehicle group consists of multiple units and are spawned in relation to the original template position. --- The first unit will be placed at the center of the zone. --- --- # Guide: --- 1. Start the mission. --- 2. Take a look at F10 map. The vehicle group is outside of the zone. --- 3. Wait 10 seconds. --- 2. The vehicle group will be respawned. This time it is in the target zone. - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):DrawZone() - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) - -MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() - --- Respawn the vehicle 10 seconds after mission start. -TIMER:New( - function() - Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position - end -):Start( 10 ) +--- +-- Author: FlightControl +-- Created: 01.03.2018 +-- Contributors: kaltokri +-- Modified: 27.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html +-- +-- # Description: +-- In this mission a vehicle group will be respawned in a zone. +-- The vehicle group consists of multiple units and are spawned in relation to the original template position. +-- The first unit will be placed at the center of the zone. +-- +-- # Guide: +-- 1. Start the mission. +-- 2. Take a look at F10 map. The vehicle group is outside of the zone. +-- 3. Wait 10 seconds. +-- 2. The vehicle group will be respawned. This time it is in the target zone. + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):DrawZone() + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) + +MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() + +-- Respawn the vehicle 10 seconds after mission start. +TIMER:New( + function() + Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position + end +):Start( 10 ) diff --git a/Wrapper/Group/611-Respawn-multiple-units-in-Zone/GRP-611-Respawn-multiple-units-in-Zone.miz b/Wrapper/Group/611-Respawn-multiple-units-in-Zone/GRP-611-Respawn-multiple-units-in-Zone.miz index b5a8776..7e6dabc 100644 Binary files a/Wrapper/Group/611-Respawn-multiple-units-in-Zone/GRP-611-Respawn-multiple-units-in-Zone.miz and b/Wrapper/Group/611-Respawn-multiple-units-in-Zone/GRP-611-Respawn-multiple-units-in-Zone.miz differ diff --git a/Wrapper/Group/612-Respawn-multiple-units-in-Zone-randomized/GRP-612-Respawn-multiple-units-in-Zone-randomized.lua b/Wrapper/Group/612-Respawn-multiple-units-in-Zone-randomized/GRP-612-Respawn-multiple-units-in-Zone-randomized.lua index a5fa604..2c66507 100644 --- a/Wrapper/Group/612-Respawn-multiple-units-in-Zone-randomized/GRP-612-Respawn-multiple-units-in-Zone-randomized.lua +++ b/Wrapper/Group/612-Respawn-multiple-units-in-Zone-randomized/GRP-612-Respawn-multiple-units-in-Zone-randomized.lua @@ -1,40 +1,40 @@ ---- --- Author: FlightControl --- Created: 01.03.2018 --- Contributors: kaltokri --- Modified: 27.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html --- --- # Description: --- In this mission a vehicle group will be respawned in a zone. --- The vehicle group consists of multiple units and are spawned randomized within the new zone. --- The first unit will be placed at the center of the zone. --- NOTE: InitRandomizePositionZone will not ensure, that every unit is placed within the zone! --- --- # Guide: --- 1. Start the mission. --- 2. Take a look at F10 map. The vehicle group is outside of the zone. --- 3. Wait 10 seconds. --- 2. The vehicle group will be respawned. This time it is in the target zone. - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):DrawZone() - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) -Vehicle:InitRandomizePositionZone( true ) - -MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() - --- Respawn the vehicle 10 seconds after mission start. -TIMER:New( - function() - Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position - end -):Start( 10 ) +--- +-- Author: FlightControl +-- Created: 01.03.2018 +-- Contributors: kaltokri +-- Modified: 27.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html +-- +-- # Description: +-- In this mission a vehicle group will be respawned in a zone. +-- The vehicle group consists of multiple units and are spawned randomized within the new zone. +-- The first unit will be placed at the center of the zone. +-- NOTE: InitRandomizePositionZone will not ensure, that every unit is placed within the zone! +-- +-- # Guide: +-- 1. Start the mission. +-- 2. Take a look at F10 map. The vehicle group is outside of the zone. +-- 3. Wait 10 seconds. +-- 2. The vehicle group will be respawned. This time it is in the target zone. + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):DrawZone() + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) +Vehicle:InitRandomizePositionZone( true ) + +MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() + +-- Respawn the vehicle 10 seconds after mission start. +TIMER:New( + function() + Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position + end +):Start( 10 ) diff --git a/Wrapper/Group/612-Respawn-multiple-units-in-Zone-randomized/GRP-612-Respawn-multiple-units-in-Zone-randomized.miz b/Wrapper/Group/612-Respawn-multiple-units-in-Zone-randomized/GRP-612-Respawn-multiple-units-in-Zone-randomized.miz index e0f2a38..8bb3167 100644 Binary files a/Wrapper/Group/612-Respawn-multiple-units-in-Zone-randomized/GRP-612-Respawn-multiple-units-in-Zone-randomized.miz and b/Wrapper/Group/612-Respawn-multiple-units-in-Zone-randomized/GRP-612-Respawn-multiple-units-in-Zone-randomized.miz differ diff --git a/Wrapper/Group/615-Respawn-in-Zone-hidden/GRP-615-Respawn-in-Zone-hidden.lua b/Wrapper/Group/615-Respawn-in-Zone-hidden/GRP-615-Respawn-in-Zone-hidden.lua index 0fbf036..e9f2b19 100644 --- a/Wrapper/Group/615-Respawn-in-Zone-hidden/GRP-615-Respawn-in-Zone-hidden.lua +++ b/Wrapper/Group/615-Respawn-in-Zone-hidden/GRP-615-Respawn-in-Zone-hidden.lua @@ -1,36 +1,36 @@ ---- --- Author: FlightControl --- Created: 01.03.2018 --- Contributors: kaltokri --- Modified: 27.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html --- --- # Description: --- In this mission a vehicle will be respawned in a zone. The vehicle is hidden on F10 map. --- --- # Guide: --- 1. Start the mission. --- 2. Take a look at F10 map. The Vehicle is outside of the zone. --- 3. Wait 10 seconds. --- 2. The Vehicle will be respawned. This time it is in the target zone. - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):DrawZone() - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) - -MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() - --- Respawn the vehicle 10 seconds after mission start. -TIMER:New( - function() - Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position - end -):Start( 10 ) +--- +-- Author: FlightControl +-- Created: 01.03.2018 +-- Contributors: kaltokri +-- Modified: 27.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html +-- +-- # Description: +-- In this mission a vehicle will be respawned in a zone. The vehicle is hidden on F10 map. +-- +-- # Guide: +-- 1. Start the mission. +-- 2. Take a look at F10 map. The Vehicle is outside of the zone. +-- 3. Wait 10 seconds. +-- 2. The Vehicle will be respawned. This time it is in the target zone. + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):DrawZone() + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) + +MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() + +-- Respawn the vehicle 10 seconds after mission start. +TIMER:New( + function() + Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position + end +):Start( 10 ) diff --git a/Wrapper/Group/615-Respawn-in-Zone-hidden/GRP-615-Respawn-in-Zone-hidden.miz b/Wrapper/Group/615-Respawn-in-Zone-hidden/GRP-615-Respawn-in-Zone-hidden.miz index 1d9fa9d..b18f272 100644 Binary files a/Wrapper/Group/615-Respawn-in-Zone-hidden/GRP-615-Respawn-in-Zone-hidden.miz and b/Wrapper/Group/615-Respawn-in-Zone-hidden/GRP-615-Respawn-in-Zone-hidden.miz differ diff --git a/Wrapper/Group/616-Respawn-multiple-units-in-Zone-hidden/GRP-616-Respawn-multiple-units-in-Zone-hidden.lua b/Wrapper/Group/616-Respawn-multiple-units-in-Zone-hidden/GRP-616-Respawn-multiple-units-in-Zone-hidden.lua index 47b75cd..ed2aef0 100644 --- a/Wrapper/Group/616-Respawn-multiple-units-in-Zone-hidden/GRP-616-Respawn-multiple-units-in-Zone-hidden.lua +++ b/Wrapper/Group/616-Respawn-multiple-units-in-Zone-hidden/GRP-616-Respawn-multiple-units-in-Zone-hidden.lua @@ -1,38 +1,38 @@ ---- --- Author: FlightControl --- Created: 01.03.2018 --- Contributors: kaltokri --- Modified: 27.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html --- --- # Description: --- In this mission a vehicle group will be respawned in a zone. The vehicles are hidden on F10 map. --- The vehicle group consists of multiple units and are spawned in relation to the original template position. --- The first unit will be placed at the center of the zone. --- --- # Guide: --- 1. Start the mission. --- 2. Take a look at F10 map. The vehicle group is outside of the zone. --- 3. Wait 10 seconds. --- 2. The vehicle group will be respawned. This time it is in the target zone. - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):DrawZone() - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) - -MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() - --- Respawn the vehicle 10 seconds after mission start. -TIMER:New( - function() - Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position - end -):Start( 10 ) +--- +-- Author: FlightControl +-- Created: 01.03.2018 +-- Contributors: kaltokri +-- Modified: 27.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html +-- +-- # Description: +-- In this mission a vehicle group will be respawned in a zone. The vehicles are hidden on F10 map. +-- The vehicle group consists of multiple units and are spawned in relation to the original template position. +-- The first unit will be placed at the center of the zone. +-- +-- # Guide: +-- 1. Start the mission. +-- 2. Take a look at F10 map. The vehicle group is outside of the zone. +-- 3. Wait 10 seconds. +-- 2. The vehicle group will be respawned. This time it is in the target zone. + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):DrawZone() + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) + +MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() + +-- Respawn the vehicle 10 seconds after mission start. +TIMER:New( + function() + Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position + end +):Start( 10 ) diff --git a/Wrapper/Group/616-Respawn-multiple-units-in-Zone-hidden/GRP-616-Respawn-multiple-units-in-Zone-hidden.miz b/Wrapper/Group/616-Respawn-multiple-units-in-Zone-hidden/GRP-616-Respawn-multiple-units-in-Zone-hidden.miz index 8e00337..16fefc9 100644 Binary files a/Wrapper/Group/616-Respawn-multiple-units-in-Zone-hidden/GRP-616-Respawn-multiple-units-in-Zone-hidden.miz and b/Wrapper/Group/616-Respawn-multiple-units-in-Zone-hidden/GRP-616-Respawn-multiple-units-in-Zone-hidden.miz differ diff --git a/Wrapper/Group/617-Respawn-multiple-units-in-Zone-randomized-hidden/GRP-617-Respawn-multiple-units-in-Zone-randomized-hidden.lua b/Wrapper/Group/617-Respawn-multiple-units-in-Zone-randomized-hidden/GRP-617-Respawn-multiple-units-in-Zone-randomized-hidden.lua index 531a8bc..58048b7 100644 --- a/Wrapper/Group/617-Respawn-multiple-units-in-Zone-randomized-hidden/GRP-617-Respawn-multiple-units-in-Zone-randomized-hidden.lua +++ b/Wrapper/Group/617-Respawn-multiple-units-in-Zone-randomized-hidden/GRP-617-Respawn-multiple-units-in-Zone-randomized-hidden.lua @@ -1,40 +1,40 @@ ---- --- Author: FlightControl --- Created: 01.03.2018 --- Contributors: kaltokri --- Modified: 27.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html --- --- # Description: --- In this mission a vehicle group will be respawned in a zone. The units are hiiden on F10 map. --- The vehicle group consists of multiple units and are spawned randomized within the new zone. --- The first unit will be placed at the center of the zone. --- NOTE: InitRandomizePositionZone will not ensure, that every unit is placed within the zone! --- --- # Guide: --- 1. Start the mission. --- 2. The vehicle group is outside of the zone. --- 3. Wait 10 seconds. --- 2. The vehicle group will be respawned. This time it is in the target zone. - --- Find the Vehicle and create a GROUP object. -Vehicle = GROUP:FindByName( "Vehicle" ) - --- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. -RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):SmokeZone( SMOKECOLOR.White ) - --- Prepare the spawning to be done in RespawnZone1. -Vehicle:InitZone( RespawnZone1 ) -Vehicle:InitRandomizePositionZone( true ) - -MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() - --- Respawn the vehicle 10 seconds after mission start. -TIMER:New( - function() - Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position - end -):Start( 10 ) +--- +-- Author: FlightControl +-- Created: 01.03.2018 +-- Contributors: kaltokri +-- Modified: 27.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Timer.html +-- +-- # Description: +-- In this mission a vehicle group will be respawned in a zone. The units are hiiden on F10 map. +-- The vehicle group consists of multiple units and are spawned randomized within the new zone. +-- The first unit will be placed at the center of the zone. +-- NOTE: InitRandomizePositionZone will not ensure, that every unit is placed within the zone! +-- +-- # Guide: +-- 1. Start the mission. +-- 2. The vehicle group is outside of the zone. +-- 3. Wait 10 seconds. +-- 2. The vehicle group will be respawned. This time it is in the target zone. + +-- Find the Vehicle and create a GROUP object. +Vehicle = GROUP:FindByName( "Vehicle" ) + +-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1. +RespawnZone1 = ZONE:New( "ZONEVEHICLE1" ):SmokeZone( SMOKECOLOR.White ) + +-- Prepare the spawning to be done in RespawnZone1. +Vehicle:InitZone( RespawnZone1 ) +Vehicle:InitRandomizePositionZone( true ) + +MESSAGE:New( "Vehicle will be respawned in 10 seconds in the zone!", 10 ):ToAll():ToLog() + +-- Respawn the vehicle 10 seconds after mission start. +TIMER:New( + function() + Vehicle:Respawn( nil, true ) -- Parameters: #table Template, #boolean Reset position + end +):Start( 10 ) diff --git a/Wrapper/Group/617-Respawn-multiple-units-in-Zone-randomized-hidden/GRP-617-Respawn-multiple-units-in-Zone-randomized-hidden.miz b/Wrapper/Group/617-Respawn-multiple-units-in-Zone-randomized-hidden/GRP-617-Respawn-multiple-units-in-Zone-randomized-hidden.miz index 8139c7a..9acfc5a 100644 Binary files a/Wrapper/Group/617-Respawn-multiple-units-in-Zone-randomized-hidden/GRP-617-Respawn-multiple-units-in-Zone-randomized-hidden.miz and b/Wrapper/Group/617-Respawn-multiple-units-in-Zone-randomized-hidden/GRP-617-Respawn-multiple-units-in-Zone-randomized-hidden.miz differ diff --git a/Wrapper/Group/900-Option-Green-and-Red-State/GRP-900-Option-Green-and-Red-State.lua b/Wrapper/Group/900-Option-Green-and-Red-State/GRP-900-Option-Green-and-Red-State.lua index b7c2914..04fe435 100644 --- a/Wrapper/Group/900-Option-Green-and-Red-State/GRP-900-Option-Green-and-Red-State.lua +++ b/Wrapper/Group/900-Option-Green-and-Red-State/GRP-900-Option-Green-and-Red-State.lua @@ -1,28 +1,28 @@ ---- --- Author: FlightControl --- Created: 10.12.2017 --- Contributors: kaltokri --- Modified: 27.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- --- # Description: --- This mission will show the option to set the alarm state of a group to RED or GREEN. --- Both options are tested with one group for each. --- Please check the dcs.log in case of errors, and the time the group reacts to the approaching target. --- The Red State Group should react much faster than the Green State Group. --- State Blue is attacking. State Green is defending. --- The south SAM is "Red State". --- --- # Guide: --- 1. Start the mission. --- 2. Watch the situation on F10 map. - --- Find the SAMs and create GROUP objects. -RedStateGroup = GROUP:FindByName( "Red State" ) -GreenStateGroup = GROUP:FindByName( "Green State" ) - --- Set the states. -RedStateGroup:OptionAlarmStateRed() -GreenStateGroup:OptionAlarmStateGreen() +--- +-- Author: FlightControl +-- Created: 10.12.2017 +-- Contributors: kaltokri +-- Modified: 27.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- +-- # Description: +-- This mission will show the option to set the alarm state of a group to RED or GREEN. +-- Both options are tested with one group for each. +-- Please check the dcs.log in case of errors, and the time the group reacts to the approaching target. +-- The Red State Group should react much faster than the Green State Group. +-- State Blue is attacking. State Green is defending. +-- The south SAM is "Red State". +-- +-- # Guide: +-- 1. Start the mission. +-- 2. Watch the situation on F10 map. + +-- Find the SAMs and create GROUP objects. +RedStateGroup = GROUP:FindByName( "Red State" ) +GreenStateGroup = GROUP:FindByName( "Green State" ) + +-- Set the states. +RedStateGroup:OptionAlarmStateRed() +GreenStateGroup:OptionAlarmStateGreen() diff --git a/Wrapper/Group/900-Option-Green-and-Red-State/GRP-900-Option-Green-and-Red-State.miz b/Wrapper/Group/900-Option-Green-and-Red-State/GRP-900-Option-Green-and-Red-State.miz index 8bb0f47..95aa32b 100644 Binary files a/Wrapper/Group/900-Option-Green-and-Red-State/GRP-900-Option-Green-and-Red-State.miz and b/Wrapper/Group/900-Option-Green-and-Red-State/GRP-900-Option-Green-and-Red-State.miz differ diff --git a/Wrapper/Weapon/010-Track-Bomb/WPN-010-Track-Bomb.lua b/Wrapper/Weapon/010-Track-Bomb/WPN-010-Track-Bomb.lua index 71f3c39..5626972 100644 --- a/Wrapper/Weapon/010-Track-Bomb/WPN-010-Track-Bomb.lua +++ b/Wrapper/Weapon/010-Track-Bomb/WPN-010-Track-Bomb.lua @@ -1,54 +1,54 @@ ---- --- Author: funkyfranky --- Created: 05.02.2023 --- Contributors: kaltokri --- Modified: 01.03.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- --- # Description: --- --- An F-15E is tasked to drop a Mk-82 bomb at the old airfield near Kobuleti. --- We monitor the SHOT event and track the bomb until it impacts. --- --- # Guide: --- --- 1. Run the mission and watch the attack. --- 2. The impact point is marked with red smoke and a mark on the F10 map - --- Some message on screen. -local text = "Starting Weapon Test mission" -MESSAGE:New( text, 120 ):ToLog():ToAll() - --- Create an event handler that monitors the SHOT event. -local handler = EVENTHANDLER:New() -handler:HandleEvent( EVENTS.Shot ) - ---- Function called on shot event. -function handler:OnEventShot( EventData ) - local eventdata = EventData --Core.Event#EVENTDATA - - -- Nil check if we have a weapon in the eventdata table. - if eventdata and eventdata.weapon then - - -- Debug info. - MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", eventdata.IniUnitName ), 60 ):ToAll():ToLog() - - -- Create a new WEAPON object from the DCS weapon object in the event data. - local weapon = WEAPON:New( eventdata.weapon ) - - -- Mark impact point on F10 map. - weapon:SetMarkImpact( true ) - - -- Smoke impact point. - weapon:SetSmokeImpact( true ) - - -- Start tracking the weapon. - weapon:StartTrack() - end -end - --- Active group. -GROUP:FindByName( "F-15E" ):Activate() +--- +-- Author: funkyfranky +-- Created: 05.02.2023 +-- Contributors: kaltokri +-- Modified: 01.03.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- +-- # Description: +-- +-- An F-15E is tasked to drop a Mk-82 bomb at the old airfield near Kobuleti. +-- We monitor the SHOT event and track the bomb until it impacts. +-- +-- # Guide: +-- +-- 1. Run the mission and watch the attack. +-- 2. The impact point is marked with red smoke and a mark on the F10 map + +-- Some message on screen. +local text = "Starting Weapon Test mission" +MESSAGE:New( text, 120 ):ToLog():ToAll() + +-- Create an event handler that monitors the SHOT event. +local handler = EVENTHANDLER:New() +handler:HandleEvent( EVENTS.Shot ) + +--- Function called on shot event. +function handler:OnEventShot( EventData ) + local eventdata = EventData --Core.Event#EVENTDATA + + -- Nil check if we have a weapon in the eventdata table. + if eventdata and eventdata.weapon then + + -- Debug info. + MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", eventdata.IniUnitName ), 60 ):ToAll():ToLog() + + -- Create a new WEAPON object from the DCS weapon object in the event data. + local weapon = WEAPON:New( eventdata.weapon ) + + -- Mark impact point on F10 map. + weapon:SetMarkImpact( true ) + + -- Smoke impact point. + weapon:SetSmokeImpact( true ) + + -- Start tracking the weapon. + weapon:StartTrack() + end +end + +-- Active group. +GROUP:FindByName( "F-15E" ):Activate() diff --git a/Wrapper/Weapon/010-Track-Bomb/WPN-010-Track-Bomb.miz b/Wrapper/Weapon/010-Track-Bomb/WPN-010-Track-Bomb.miz index 51a3f20..cfc2da7 100644 Binary files a/Wrapper/Weapon/010-Track-Bomb/WPN-010-Track-Bomb.miz and b/Wrapper/Weapon/010-Track-Bomb/WPN-010-Track-Bomb.miz differ diff --git a/Wrapper/Weapon/020-Track-AA-Missile/WPN-020-Track-AA-Missile.lua b/Wrapper/Weapon/020-Track-AA-Missile/WPN-020-Track-AA-Missile.lua index 786a07b..b1f4c84 100644 --- a/Wrapper/Weapon/020-Track-AA-Missile/WPN-020-Track-AA-Missile.lua +++ b/Wrapper/Weapon/020-Track-AA-Missile/WPN-020-Track-AA-Missile.lua @@ -1,84 +1,84 @@ ---- --- Author: funkyfranky --- Created: 05.02.2023 --- Contributors: kaltokri --- Modified: 01.03.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- --- # Description: --- --- An F-15C is tasked to shoot down a MiG-29 drone with an AIM-120B AMRAAM. --- We monitor the SHOT event and track the missile until it impacts. --- --- During the tracking, we monitor the current target of the missile and print out some parameters like --- its speed and distance to the target to the DCS log file. --- --- You will find that the missile does not have a target when lauched. --- It will aquire the target after some time during flight, aka go "pitbull". --- --- The impact point is marked with red smoke and a mark on the F10 map is shown. ---- - --- Some message on screen. -local text = "Starting Weapon Test mission" -MESSAGE:New( text, 120 ):ToLog():ToAll() - --- Create an event handler that monitors the SHOT event. -local handler = EVENTHANDLER:New() -handler:HandleEvent( EVENTS.Shot ) - ---- Function called when a tracked weapon impacts. -local function WeaponTrack( Weapon ) - local weapon = Weapon --Wrapper.Weapon#WEAPON - - -- Get the target of the weapon. - local target = weapon:GetTarget() --Wrapper.Unit#UNIT - - -- Get Speed of weapon. - local speed = weapon:GetSpeed() - - -- Get target info. - local targetName = weapon:GetTargetName() - local targetDist = weapon:GetTargetDistance() or -100 - - -- Write inofs to the dcs.log. Will create a lot of log lines! - local text = string.format("T=%.3f: Tracking weapon Type=%s, speed=%.1f m/s, target=%s, dist=%.1f m", timer.getTime(), weapon:GetTypeName(), speed, targetName, targetDist ) - env.info( text ) -end - ---- Function called on shot event. -function handler:OnEventShot( EventData ) - local eventdata = EventData --Core.Event#EVENTDATA - - -- Nil check if we have a weapon in the eventdata table. - if eventdata and eventdata.weapon then - - -- Debug info. - MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", eventdata.IniUnitName ), 60 ):ToAll():ToLog() - - -- Create a new WEAPON object from the DCS weapon object in the event data. - local weapon = WEAPON:New( eventdata.weapon ) - - -- Mark impact point on F10 map. - weapon:SetMarkImpact( true ) - - -- Smoke impact point. - weapon:SetSmokeImpact( true ) - - -- Set function that is called during tracking of the weapon. - -- This function is called on every position update of the weapon, i.e very often! - weapon:SetFuncTrack( WeaponTrack ) - - -- Start tracking the weapon. - weapon:StartTrack() - end -end - --- Active group. -GROUP:FindByName("F-15C AA"):Activate() - --- Active target. -GROUP:FindByName("MiG-29 Drone"):Activate() +--- +-- Author: funkyfranky +-- Created: 05.02.2023 +-- Contributors: kaltokri +-- Modified: 01.03.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- +-- # Description: +-- +-- An F-15C is tasked to shoot down a MiG-29 drone with an AIM-120B AMRAAM. +-- We monitor the SHOT event and track the missile until it impacts. +-- +-- During the tracking, we monitor the current target of the missile and print out some parameters like +-- its speed and distance to the target to the DCS log file. +-- +-- You will find that the missile does not have a target when lauched. +-- It will aquire the target after some time during flight, aka go "pitbull". +-- +-- The impact point is marked with red smoke and a mark on the F10 map is shown. +--- + +-- Some message on screen. +local text = "Starting Weapon Test mission" +MESSAGE:New( text, 120 ):ToLog():ToAll() + +-- Create an event handler that monitors the SHOT event. +local handler = EVENTHANDLER:New() +handler:HandleEvent( EVENTS.Shot ) + +--- Function called when a tracked weapon impacts. +local function WeaponTrack( Weapon ) + local weapon = Weapon --Wrapper.Weapon#WEAPON + + -- Get the target of the weapon. + local target = weapon:GetTarget() --Wrapper.Unit#UNIT + + -- Get Speed of weapon. + local speed = weapon:GetSpeed() + + -- Get target info. + local targetName = weapon:GetTargetName() + local targetDist = weapon:GetTargetDistance() or -100 + + -- Write inofs to the dcs.log. Will create a lot of log lines! + local text = string.format("T=%.3f: Tracking weapon Type=%s, speed=%.1f m/s, target=%s, dist=%.1f m", timer.getTime(), weapon:GetTypeName(), speed, targetName, targetDist ) + env.info( text ) +end + +--- Function called on shot event. +function handler:OnEventShot( EventData ) + local eventdata = EventData --Core.Event#EVENTDATA + + -- Nil check if we have a weapon in the eventdata table. + if eventdata and eventdata.weapon then + + -- Debug info. + MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", eventdata.IniUnitName ), 60 ):ToAll():ToLog() + + -- Create a new WEAPON object from the DCS weapon object in the event data. + local weapon = WEAPON:New( eventdata.weapon ) + + -- Mark impact point on F10 map. + weapon:SetMarkImpact( true ) + + -- Smoke impact point. + weapon:SetSmokeImpact( true ) + + -- Set function that is called during tracking of the weapon. + -- This function is called on every position update of the weapon, i.e very often! + weapon:SetFuncTrack( WeaponTrack ) + + -- Start tracking the weapon. + weapon:StartTrack() + end +end + +-- Active group. +GROUP:FindByName("F-15C AA"):Activate() + +-- Active target. +GROUP:FindByName("MiG-29 Drone"):Activate() diff --git a/Wrapper/Weapon/020-Track-AA-Missile/WPN-020-Track-AA-Missile.miz b/Wrapper/Weapon/020-Track-AA-Missile/WPN-020-Track-AA-Missile.miz index 3664042..39f1368 100644 Binary files a/Wrapper/Weapon/020-Track-AA-Missile/WPN-020-Track-AA-Missile.miz and b/Wrapper/Weapon/020-Track-AA-Missile/WPN-020-Track-AA-Missile.miz differ diff --git a/Wrapper/Weapon/030-Track-SA-Missile/WPN-030-Track-SA-Missile.lua b/Wrapper/Weapon/030-Track-SA-Missile/WPN-030-Track-SA-Missile.lua index 67da5c5..137cd7e 100644 --- a/Wrapper/Weapon/030-Track-SA-Missile/WPN-030-Track-SA-Missile.lua +++ b/Wrapper/Weapon/030-Track-SA-Missile/WPN-030-Track-SA-Missile.lua @@ -1,93 +1,93 @@ ---- --- Author: funkyfranky --- Created: 05.02.2023 --- Contributors: kaltokri --- Modified: 01.03.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- --- # Description: --- --- An F-16CM Pilot lost control over his aircraft. --- Unfortunately, his current course is guiding him directly towards an SA-10 site. --- --- We monitor the SHOT event and track the missiles from the SAM site and use our latest secret weapon --- (don't ask, it's really secret) to destroy the missiles before they reach the aircraft. - --- Some message on screen. -local text="Starting Weapon Test mission." -MESSAGE:New(text, 120):ToLog():ToAll() - - --- Create an event handler that monitors the SHOT event. --- NOTE that the event handler should be global here. If local, it gets garbage collected! Not sure why... -handler=EVENTHANDLER:New() -handler:HandleEvent(EVENTS.Shot) - ---- Function called when a tracked weapon impacts. -local function WeaponTrack( Weapon ) - local weapon = Weapon --Wrapper.Weapon#WEAPON - - -- Get the target of the weapon. - local target = weapon:GetTarget() --Wrapper.Unit#UNIT - - -- Get Speed of weapon. - local speed = weapon:GetSpeed() - - -- Get type name of weapon. - local typeName = weapon:GetTargetName() - - -- Get target info. - local targetName = weapon:GetTargetName() - local targetDist = weapon:GetTargetDistance() or -100 - - - -- Some info - local text = string.format( "T=%.3f: Tracking weapon %s Type=%s, speed=%.1f m/s, target=%s, dist=%.1f m", timer.getTime(), weapon.name, typeName, speed, targetName, targetDist ) - env.info( text ) - - if targetDist > 0 and targetDist < 100 then - - -- Message to screen. - MESSAGE:New( string.format( "Destroying missile %s from %s", typeName, weapon.launcherName ), 60 ):ToAll():ToLog() - - -- Destroy weapon. - weapon:Destroy() - end -end - ---- Function called on shot event. -function handler:OnEventShot( EventData ) - local eventdata = EventData --Core.Event#EVENTDATA - - -- Debug info. - MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", tostring( eventdata.IniUnitName ) ), 60 ):ToAll():ToLog() - - -- Nil check if we have a weapon in the eventdata table. - if eventdata and eventdata.weapon then - - -- Debug info. - MESSAGE:New( string.format( "Captured SHOT Event from unit=%s GOT WEAPON", tostring( eventdata.IniUnitName ) ), 60 ):ToAll():ToLog() - - -- Create a new WEAPON object from the DCS weapon object in the event data. - local weapon = WEAPON:New( eventdata.weapon ) - - -- Set function that is called during tracking of the weapon. - -- This function is called on every position update of the weapon, i.e very often! - weapon:SetFuncTrack( WeaponTrack ) - - -- Small timer step. - weapon:SetTimeStepTrack(0.005) - - -- Start tracking the weapon. - weapon:StartTrack() - end -end - --- Active group. -GROUP:FindByName("SA-10"):Activate() - --- Active group. -GROUP:FindByName("F-16 Flyby"):Activate() +--- +-- Author: funkyfranky +-- Created: 05.02.2023 +-- Contributors: kaltokri +-- Modified: 01.03.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- +-- # Description: +-- +-- An F-16CM Pilot lost control over his aircraft. +-- Unfortunately, his current course is guiding him directly towards an SA-10 site. +-- +-- We monitor the SHOT event and track the missiles from the SAM site and use our latest secret weapon +-- (don't ask, it's really secret) to destroy the missiles before they reach the aircraft. + +-- Some message on screen. +local text="Starting Weapon Test mission." +MESSAGE:New(text, 120):ToLog():ToAll() + + +-- Create an event handler that monitors the SHOT event. +-- NOTE that the event handler should be global here. If local, it gets garbage collected! Not sure why... +handler=EVENTHANDLER:New() +handler:HandleEvent(EVENTS.Shot) + +--- Function called when a tracked weapon impacts. +local function WeaponTrack( Weapon ) + local weapon = Weapon --Wrapper.Weapon#WEAPON + + -- Get the target of the weapon. + local target = weapon:GetTarget() --Wrapper.Unit#UNIT + + -- Get Speed of weapon. + local speed = weapon:GetSpeed() + + -- Get type name of weapon. + local typeName = weapon:GetTargetName() + + -- Get target info. + local targetName = weapon:GetTargetName() + local targetDist = weapon:GetTargetDistance() or -100 + + + -- Some info + local text = string.format( "T=%.3f: Tracking weapon %s Type=%s, speed=%.1f m/s, target=%s, dist=%.1f m", timer.getTime(), weapon.name, typeName, speed, targetName, targetDist ) + env.info( text ) + + if targetDist > 0 and targetDist < 100 then + + -- Message to screen. + MESSAGE:New( string.format( "Destroying missile %s from %s", typeName, weapon.launcherName ), 60 ):ToAll():ToLog() + + -- Destroy weapon. + weapon:Destroy() + end +end + +--- Function called on shot event. +function handler:OnEventShot( EventData ) + local eventdata = EventData --Core.Event#EVENTDATA + + -- Debug info. + MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", tostring( eventdata.IniUnitName ) ), 60 ):ToAll():ToLog() + + -- Nil check if we have a weapon in the eventdata table. + if eventdata and eventdata.weapon then + + -- Debug info. + MESSAGE:New( string.format( "Captured SHOT Event from unit=%s GOT WEAPON", tostring( eventdata.IniUnitName ) ), 60 ):ToAll():ToLog() + + -- Create a new WEAPON object from the DCS weapon object in the event data. + local weapon = WEAPON:New( eventdata.weapon ) + + -- Set function that is called during tracking of the weapon. + -- This function is called on every position update of the weapon, i.e very often! + weapon:SetFuncTrack( WeaponTrack ) + + -- Small timer step. + weapon:SetTimeStepTrack(0.005) + + -- Start tracking the weapon. + weapon:StartTrack() + end +end + +-- Active group. +GROUP:FindByName("SA-10"):Activate() + +-- Active group. +GROUP:FindByName("F-16 Flyby"):Activate() diff --git a/Wrapper/Weapon/030-Track-SA-Missile/WPN-030-Track-SA-Missile.miz b/Wrapper/Weapon/030-Track-SA-Missile/WPN-030-Track-SA-Missile.miz index ad6596f..f8813ff 100644 Binary files a/Wrapper/Weapon/030-Track-SA-Missile/WPN-030-Track-SA-Missile.miz and b/Wrapper/Weapon/030-Track-SA-Missile/WPN-030-Track-SA-Missile.miz differ diff --git a/Wrapper/Weapon/040-Track-Shell/WPN-040-Track-Shell.lua b/Wrapper/Weapon/040-Track-Shell/WPN-040-Track-Shell.lua index 39c26ca..64894ab 100644 --- a/Wrapper/Weapon/040-Track-Shell/WPN-040-Track-Shell.lua +++ b/Wrapper/Weapon/040-Track-Shell/WPN-040-Track-Shell.lua @@ -1,86 +1,86 @@ ---- --- Author: funkyfranky --- Created: 05.02.2023 --- Contributors: kaltokri --- Modified: 01.03.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html --- --- # Description: --- --- An SPH M109 Paladin is doing target practice and tasks to fire one life shell at the old runway at Kobuleti. --- --- We monitor the SHOT event and track the shell until it impacts. --- --- The impact point is marked with red smoke and a mark on the F10 map is shown. --- --- We also use a callback function "WeaponImpact", which is called when the shell has impacted --- and check if the shell fell into a zone "X". --- --- NOTE: It takes some time until the paladin will fire. Be patient or use time acceleration. - --- Some message on screen. -local text = "Starting Weapon Test mission" -MESSAGE:New( text, 120 ):ToLog():ToAll() - --- Create an event handler that monitors the SHOT event. -local handler = EVENTHANDLER:New() -handler:HandleEvent( EVENTS.Shot ) - ---- Function called when a tracked weapon impacts. -local function WeaponImpact( Weapon, Zone ) - local weapon = Weapon --Wrapper.Weapon#WEAPON - local zone = Zone --Core.Zone#ZONE_RADIUS - - -- Get impact coordinate of weapon. - local impactcoord = weapon:GetImpactCoordinate() - - if impactcoord then - - -- Check if impact was inside the target zone. - local inzone = zone:IsCoordinateInZone( impactcoord ) - - if inzone then - -- Display message to all and in log file. - MESSAGE:New( string.format( "Weapon %s impacted inside Zone %s! Well, done team of %s", weapon:GetTypeName(), zone:GetName(), weapon.launcherName ), 60 ):ToLog():ToAll() - else - -- Display message to all and in log file. - MESSAGE:New( string.format( "Weapon %s impacted OUTSIDE Zone %s! Team of %s has to do some extra practice sessions", weapon:GetTypeName(), zone:GetName(), weapon.launcherName ), 60 ):ToLog():ToAll() - end - - end -end - ---- Function called on shot event. -function handler:OnEventShot( EventData ) - local eventdata = EventData --Core.Event#EVENTDATA - - -- Nil check if we have a weapon in the eventdata table. - if eventdata and eventdata.weapon then - - -- Debug info. - MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", eventdata.IniUnitName ), 60 ):ToAll():ToLog() - - -- Create a new WEAPON object from the DCS weapon object in the event data. - local weapon = WEAPON:New( eventdata.weapon ) - - -- Mark impact point on F10 map. - weapon:SetMarkImpact( true ) - - -- Smoke impact point. - weapon:SetSmokeImpact( true ) - - -- Set function that is called on weapon impact. We also pass the zone as parameter to show how additional parameters are handled. - weapon:SetFuncImpact( WeaponImpact, ZONE:FindByName( "X" ) ) - - -- Start tracking the weapon. - weapon:StartTrack() - - end - -end - --- Active group. -GROUP:FindByName( "Paladin" ):Activate() +--- +-- Author: funkyfranky +-- Created: 05.02.2023 +-- Contributors: kaltokri +-- Modified: 01.03.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html +-- +-- # Description: +-- +-- An SPH M109 Paladin is doing target practice and tasks to fire one life shell at the old runway at Kobuleti. +-- +-- We monitor the SHOT event and track the shell until it impacts. +-- +-- The impact point is marked with red smoke and a mark on the F10 map is shown. +-- +-- We also use a callback function "WeaponImpact", which is called when the shell has impacted +-- and check if the shell fell into a zone "X". +-- +-- NOTE: It takes some time until the paladin will fire. Be patient or use time acceleration. + +-- Some message on screen. +local text = "Starting Weapon Test mission" +MESSAGE:New( text, 120 ):ToLog():ToAll() + +-- Create an event handler that monitors the SHOT event. +local handler = EVENTHANDLER:New() +handler:HandleEvent( EVENTS.Shot ) + +--- Function called when a tracked weapon impacts. +local function WeaponImpact( Weapon, Zone ) + local weapon = Weapon --Wrapper.Weapon#WEAPON + local zone = Zone --Core.Zone#ZONE_RADIUS + + -- Get impact coordinate of weapon. + local impactcoord = weapon:GetImpactCoordinate() + + if impactcoord then + + -- Check if impact was inside the target zone. + local inzone = zone:IsCoordinateInZone( impactcoord ) + + if inzone then + -- Display message to all and in log file. + MESSAGE:New( string.format( "Weapon %s impacted inside Zone %s! Well, done team of %s", weapon:GetTypeName(), zone:GetName(), weapon.launcherName ), 60 ):ToLog():ToAll() + else + -- Display message to all and in log file. + MESSAGE:New( string.format( "Weapon %s impacted OUTSIDE Zone %s! Team of %s has to do some extra practice sessions", weapon:GetTypeName(), zone:GetName(), weapon.launcherName ), 60 ):ToLog():ToAll() + end + + end +end + +--- Function called on shot event. +function handler:OnEventShot( EventData ) + local eventdata = EventData --Core.Event#EVENTDATA + + -- Nil check if we have a weapon in the eventdata table. + if eventdata and eventdata.weapon then + + -- Debug info. + MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", eventdata.IniUnitName ), 60 ):ToAll():ToLog() + + -- Create a new WEAPON object from the DCS weapon object in the event data. + local weapon = WEAPON:New( eventdata.weapon ) + + -- Mark impact point on F10 map. + weapon:SetMarkImpact( true ) + + -- Smoke impact point. + weapon:SetSmokeImpact( true ) + + -- Set function that is called on weapon impact. We also pass the zone as parameter to show how additional parameters are handled. + weapon:SetFuncImpact( WeaponImpact, ZONE:FindByName( "X" ) ) + + -- Start tracking the weapon. + weapon:StartTrack() + + end + +end + +-- Active group. +GROUP:FindByName( "Paladin" ):Activate() diff --git a/Wrapper/Weapon/040-Track-Shell/WPN-040-Track-Shell.miz b/Wrapper/Weapon/040-Track-Shell/WPN-040-Track-Shell.miz index 67a92f3..249d167 100644 Binary files a/Wrapper/Weapon/040-Track-Shell/WPN-040-Track-Shell.miz and b/Wrapper/Weapon/040-Track-Shell/WPN-040-Track-Shell.miz differ