mirror of
https://github.com/FlightControl-Master/MOOSE_Demos.git
synced 2025-08-15 10:37:47 +00:00
Updated Moose.lua
This commit is contained in:
parent
369782b5fe
commit
f96dcee9e0
Binary file not shown.
@ -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
|
||||
|
||||
Binary file not shown.
@ -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()
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,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()
|
||||
|
||||
Binary file not shown.
@ -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()
|
||||
|
||||
Binary file not shown.
@ -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()
|
||||
|
||||
Binary file not shown.
@ -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()
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,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-<terrain>.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-<terrain>.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()
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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
|
||||
|
||||
Binary file not shown.
@ -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] )
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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" )
|
||||
|
||||
Binary file not shown.
@ -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()
|
||||
|
||||
Binary file not shown.
@ -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()
|
||||
|
||||
Binary file not shown.
@ -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" )
|
||||
|
||||
Binary file not shown.
@ -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" )
|
||||
|
||||
Binary file not shown.
@ -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" )
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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 )
|
||||
|
||||
Binary file not shown.
@ -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()
|
||||
|
||||
Binary file not shown.
@ -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()
|
||||
|
||||
Binary file not shown.
@ -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()
|
||||
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user