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:
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.
@@ -1,93 +1,93 @@
|
||||
---
|
||||
-- Author: funkyfranky
|
||||
-- Created: 05.02.2023
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 01.03.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- An F-16CM Pilot lost control over his aircraft.
|
||||
-- Unfortunately, his current course is guiding him directly towards an SA-10 site.
|
||||
--
|
||||
-- We monitor the SHOT event and track the missiles from the SAM site and use our latest secret weapon
|
||||
-- (don't ask, it's really secret) to destroy the missiles before they reach the aircraft.
|
||||
|
||||
-- Some message on screen.
|
||||
local text="Starting Weapon Test mission."
|
||||
MESSAGE:New(text, 120):ToLog():ToAll()
|
||||
|
||||
|
||||
-- Create an event handler that monitors the SHOT event.
|
||||
-- NOTE that the event handler should be global here. If local, it gets garbage collected! Not sure why...
|
||||
handler=EVENTHANDLER:New()
|
||||
handler:HandleEvent(EVENTS.Shot)
|
||||
|
||||
--- Function called when a tracked weapon impacts.
|
||||
local function WeaponTrack( Weapon )
|
||||
local weapon = Weapon --Wrapper.Weapon#WEAPON
|
||||
|
||||
-- Get the target of the weapon.
|
||||
local target = weapon:GetTarget() --Wrapper.Unit#UNIT
|
||||
|
||||
-- Get Speed of weapon.
|
||||
local speed = weapon:GetSpeed()
|
||||
|
||||
-- Get type name of weapon.
|
||||
local typeName = weapon:GetTargetName()
|
||||
|
||||
-- Get target info.
|
||||
local targetName = weapon:GetTargetName()
|
||||
local targetDist = weapon:GetTargetDistance() or -100
|
||||
|
||||
|
||||
-- Some info
|
||||
local text = string.format( "T=%.3f: Tracking weapon %s Type=%s, speed=%.1f m/s, target=%s, dist=%.1f m", timer.getTime(), weapon.name, typeName, speed, targetName, targetDist )
|
||||
env.info( text )
|
||||
|
||||
if targetDist > 0 and targetDist < 100 then
|
||||
|
||||
-- Message to screen.
|
||||
MESSAGE:New( string.format( "Destroying missile %s from %s", typeName, weapon.launcherName ), 60 ):ToAll():ToLog()
|
||||
|
||||
-- Destroy weapon.
|
||||
weapon:Destroy()
|
||||
end
|
||||
end
|
||||
|
||||
--- Function called on shot event.
|
||||
function handler:OnEventShot( EventData )
|
||||
local eventdata = EventData --Core.Event#EVENTDATA
|
||||
|
||||
-- Debug info.
|
||||
MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", tostring( eventdata.IniUnitName ) ), 60 ):ToAll():ToLog()
|
||||
|
||||
-- Nil check if we have a weapon in the eventdata table.
|
||||
if eventdata and eventdata.weapon then
|
||||
|
||||
-- Debug info.
|
||||
MESSAGE:New( string.format( "Captured SHOT Event from unit=%s GOT WEAPON", tostring( eventdata.IniUnitName ) ), 60 ):ToAll():ToLog()
|
||||
|
||||
-- Create a new WEAPON object from the DCS weapon object in the event data.
|
||||
local weapon = WEAPON:New( eventdata.weapon )
|
||||
|
||||
-- Set function that is called during tracking of the weapon.
|
||||
-- This function is called on every position update of the weapon, i.e very often!
|
||||
weapon:SetFuncTrack( WeaponTrack )
|
||||
|
||||
-- Small timer step.
|
||||
weapon:SetTimeStepTrack(0.005)
|
||||
|
||||
-- Start tracking the weapon.
|
||||
weapon:StartTrack()
|
||||
end
|
||||
end
|
||||
|
||||
-- Active group.
|
||||
GROUP:FindByName("SA-10"):Activate()
|
||||
|
||||
-- Active group.
|
||||
GROUP:FindByName("F-16 Flyby"):Activate()
|
||||
---
|
||||
-- Author: funkyfranky
|
||||
-- Created: 05.02.2023
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 01.03.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- An F-16CM Pilot lost control over his aircraft.
|
||||
-- Unfortunately, his current course is guiding him directly towards an SA-10 site.
|
||||
--
|
||||
-- We monitor the SHOT event and track the missiles from the SAM site and use our latest secret weapon
|
||||
-- (don't ask, it's really secret) to destroy the missiles before they reach the aircraft.
|
||||
|
||||
-- Some message on screen.
|
||||
local text="Starting Weapon Test mission."
|
||||
MESSAGE:New(text, 120):ToLog():ToAll()
|
||||
|
||||
|
||||
-- Create an event handler that monitors the SHOT event.
|
||||
-- NOTE that the event handler should be global here. If local, it gets garbage collected! Not sure why...
|
||||
handler=EVENTHANDLER:New()
|
||||
handler:HandleEvent(EVENTS.Shot)
|
||||
|
||||
--- Function called when a tracked weapon impacts.
|
||||
local function WeaponTrack( Weapon )
|
||||
local weapon = Weapon --Wrapper.Weapon#WEAPON
|
||||
|
||||
-- Get the target of the weapon.
|
||||
local target = weapon:GetTarget() --Wrapper.Unit#UNIT
|
||||
|
||||
-- Get Speed of weapon.
|
||||
local speed = weapon:GetSpeed()
|
||||
|
||||
-- Get type name of weapon.
|
||||
local typeName = weapon:GetTargetName()
|
||||
|
||||
-- Get target info.
|
||||
local targetName = weapon:GetTargetName()
|
||||
local targetDist = weapon:GetTargetDistance() or -100
|
||||
|
||||
|
||||
-- Some info
|
||||
local text = string.format( "T=%.3f: Tracking weapon %s Type=%s, speed=%.1f m/s, target=%s, dist=%.1f m", timer.getTime(), weapon.name, typeName, speed, targetName, targetDist )
|
||||
env.info( text )
|
||||
|
||||
if targetDist > 0 and targetDist < 100 then
|
||||
|
||||
-- Message to screen.
|
||||
MESSAGE:New( string.format( "Destroying missile %s from %s", typeName, weapon.launcherName ), 60 ):ToAll():ToLog()
|
||||
|
||||
-- Destroy weapon.
|
||||
weapon:Destroy()
|
||||
end
|
||||
end
|
||||
|
||||
--- Function called on shot event.
|
||||
function handler:OnEventShot( EventData )
|
||||
local eventdata = EventData --Core.Event#EVENTDATA
|
||||
|
||||
-- Debug info.
|
||||
MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", tostring( eventdata.IniUnitName ) ), 60 ):ToAll():ToLog()
|
||||
|
||||
-- Nil check if we have a weapon in the eventdata table.
|
||||
if eventdata and eventdata.weapon then
|
||||
|
||||
-- Debug info.
|
||||
MESSAGE:New( string.format( "Captured SHOT Event from unit=%s GOT WEAPON", tostring( eventdata.IniUnitName ) ), 60 ):ToAll():ToLog()
|
||||
|
||||
-- Create a new WEAPON object from the DCS weapon object in the event data.
|
||||
local weapon = WEAPON:New( eventdata.weapon )
|
||||
|
||||
-- Set function that is called during tracking of the weapon.
|
||||
-- This function is called on every position update of the weapon, i.e very often!
|
||||
weapon:SetFuncTrack( WeaponTrack )
|
||||
|
||||
-- Small timer step.
|
||||
weapon:SetTimeStepTrack(0.005)
|
||||
|
||||
-- Start tracking the weapon.
|
||||
weapon:StartTrack()
|
||||
end
|
||||
end
|
||||
|
||||
-- Active group.
|
||||
GROUP:FindByName("SA-10"):Activate()
|
||||
|
||||
-- Active group.
|
||||
GROUP:FindByName("F-16 Flyby"):Activate()
|
||||
|
||||
Binary file not shown.
@@ -1,86 +1,86 @@
|
||||
---
|
||||
-- Author: funkyfranky
|
||||
-- Created: 05.02.2023
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 01.03.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- An SPH M109 Paladin is doing target practice and tasks to fire one life shell at the old runway at Kobuleti.
|
||||
--
|
||||
-- We monitor the SHOT event and track the shell until it impacts.
|
||||
--
|
||||
-- The impact point is marked with red smoke and a mark on the F10 map is shown.
|
||||
--
|
||||
-- We also use a callback function "WeaponImpact", which is called when the shell has impacted
|
||||
-- and check if the shell fell into a zone "X".
|
||||
--
|
||||
-- NOTE: It takes some time until the paladin will fire. Be patient or use time acceleration.
|
||||
|
||||
-- Some message on screen.
|
||||
local text = "Starting Weapon Test mission"
|
||||
MESSAGE:New( text, 120 ):ToLog():ToAll()
|
||||
|
||||
-- Create an event handler that monitors the SHOT event.
|
||||
local handler = EVENTHANDLER:New()
|
||||
handler:HandleEvent( EVENTS.Shot )
|
||||
|
||||
--- Function called when a tracked weapon impacts.
|
||||
local function WeaponImpact( Weapon, Zone )
|
||||
local weapon = Weapon --Wrapper.Weapon#WEAPON
|
||||
local zone = Zone --Core.Zone#ZONE_RADIUS
|
||||
|
||||
-- Get impact coordinate of weapon.
|
||||
local impactcoord = weapon:GetImpactCoordinate()
|
||||
|
||||
if impactcoord then
|
||||
|
||||
-- Check if impact was inside the target zone.
|
||||
local inzone = zone:IsCoordinateInZone( impactcoord )
|
||||
|
||||
if inzone then
|
||||
-- Display message to all and in log file.
|
||||
MESSAGE:New( string.format( "Weapon %s impacted inside Zone %s! Well, done team of %s", weapon:GetTypeName(), zone:GetName(), weapon.launcherName ), 60 ):ToLog():ToAll()
|
||||
else
|
||||
-- Display message to all and in log file.
|
||||
MESSAGE:New( string.format( "Weapon %s impacted OUTSIDE Zone %s! Team of %s has to do some extra practice sessions", weapon:GetTypeName(), zone:GetName(), weapon.launcherName ), 60 ):ToLog():ToAll()
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
--- Function called on shot event.
|
||||
function handler:OnEventShot( EventData )
|
||||
local eventdata = EventData --Core.Event#EVENTDATA
|
||||
|
||||
-- Nil check if we have a weapon in the eventdata table.
|
||||
if eventdata and eventdata.weapon then
|
||||
|
||||
-- Debug info.
|
||||
MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", eventdata.IniUnitName ), 60 ):ToAll():ToLog()
|
||||
|
||||
-- Create a new WEAPON object from the DCS weapon object in the event data.
|
||||
local weapon = WEAPON:New( eventdata.weapon )
|
||||
|
||||
-- Mark impact point on F10 map.
|
||||
weapon:SetMarkImpact( true )
|
||||
|
||||
-- Smoke impact point.
|
||||
weapon:SetSmokeImpact( true )
|
||||
|
||||
-- Set function that is called on weapon impact. We also pass the zone as parameter to show how additional parameters are handled.
|
||||
weapon:SetFuncImpact( WeaponImpact, ZONE:FindByName( "X" ) )
|
||||
|
||||
-- Start tracking the weapon.
|
||||
weapon:StartTrack()
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Active group.
|
||||
GROUP:FindByName( "Paladin" ):Activate()
|
||||
---
|
||||
-- Author: funkyfranky
|
||||
-- Created: 05.02.2023
|
||||
-- Contributors: kaltokri
|
||||
-- Modified: 01.03.2024
|
||||
--
|
||||
-- # Documentation:
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html
|
||||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html
|
||||
--
|
||||
-- # Description:
|
||||
--
|
||||
-- An SPH M109 Paladin is doing target practice and tasks to fire one life shell at the old runway at Kobuleti.
|
||||
--
|
||||
-- We monitor the SHOT event and track the shell until it impacts.
|
||||
--
|
||||
-- The impact point is marked with red smoke and a mark on the F10 map is shown.
|
||||
--
|
||||
-- We also use a callback function "WeaponImpact", which is called when the shell has impacted
|
||||
-- and check if the shell fell into a zone "X".
|
||||
--
|
||||
-- NOTE: It takes some time until the paladin will fire. Be patient or use time acceleration.
|
||||
|
||||
-- Some message on screen.
|
||||
local text = "Starting Weapon Test mission"
|
||||
MESSAGE:New( text, 120 ):ToLog():ToAll()
|
||||
|
||||
-- Create an event handler that monitors the SHOT event.
|
||||
local handler = EVENTHANDLER:New()
|
||||
handler:HandleEvent( EVENTS.Shot )
|
||||
|
||||
--- Function called when a tracked weapon impacts.
|
||||
local function WeaponImpact( Weapon, Zone )
|
||||
local weapon = Weapon --Wrapper.Weapon#WEAPON
|
||||
local zone = Zone --Core.Zone#ZONE_RADIUS
|
||||
|
||||
-- Get impact coordinate of weapon.
|
||||
local impactcoord = weapon:GetImpactCoordinate()
|
||||
|
||||
if impactcoord then
|
||||
|
||||
-- Check if impact was inside the target zone.
|
||||
local inzone = zone:IsCoordinateInZone( impactcoord )
|
||||
|
||||
if inzone then
|
||||
-- Display message to all and in log file.
|
||||
MESSAGE:New( string.format( "Weapon %s impacted inside Zone %s! Well, done team of %s", weapon:GetTypeName(), zone:GetName(), weapon.launcherName ), 60 ):ToLog():ToAll()
|
||||
else
|
||||
-- Display message to all and in log file.
|
||||
MESSAGE:New( string.format( "Weapon %s impacted OUTSIDE Zone %s! Team of %s has to do some extra practice sessions", weapon:GetTypeName(), zone:GetName(), weapon.launcherName ), 60 ):ToLog():ToAll()
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
--- Function called on shot event.
|
||||
function handler:OnEventShot( EventData )
|
||||
local eventdata = EventData --Core.Event#EVENTDATA
|
||||
|
||||
-- Nil check if we have a weapon in the eventdata table.
|
||||
if eventdata and eventdata.weapon then
|
||||
|
||||
-- Debug info.
|
||||
MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", eventdata.IniUnitName ), 60 ):ToAll():ToLog()
|
||||
|
||||
-- Create a new WEAPON object from the DCS weapon object in the event data.
|
||||
local weapon = WEAPON:New( eventdata.weapon )
|
||||
|
||||
-- Mark impact point on F10 map.
|
||||
weapon:SetMarkImpact( true )
|
||||
|
||||
-- Smoke impact point.
|
||||
weapon:SetSmokeImpact( true )
|
||||
|
||||
-- Set function that is called on weapon impact. We also pass the zone as parameter to show how additional parameters are handled.
|
||||
weapon:SetFuncImpact( WeaponImpact, ZONE:FindByName( "X" ) )
|
||||
|
||||
-- Start tracking the weapon.
|
||||
weapon:StartTrack()
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Active group.
|
||||
GROUP:FindByName( "Paladin" ):Activate()
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user