Wrapper/Group migrated to new repo

This commit is contained in:
kaltokri
2024-02-29 19:57:56 +01:00
parent 8b0dbad02f
commit 2daa9c523a
55 changed files with 0 additions and 246781 deletions

View File

@@ -1,32 +0,0 @@
---
-- Name: GRP-100 - IsAlive
-- Author: FlightControl
-- Date Created: 23 Feb 2017
--
-- # Situation:
--
-- This test is about checking if IsAlive on GROUP level is working correctly.
-- Two ground forces GROUPS are shooting each other.
-- Check the IsAlive status in the logging of the survivor and the defeat.
--
-- # Test cases:
--
-- 1. Observe the IsAlive statuses in the dcs.log file.
--Create Spawn Groups
local GroupBlue = GROUP:FindByName( "Blue" )
local GroupRed = GROUP:FindByName( "Red" )
local Schedule, ScheduleID = SCHEDULER:New( nil,
--- Variable Declarations
-- @param Wrapper.Group#GROUP GroupBlue
-- @param Wrapper.Group#GROUP GroupRed
function( GroupBlue, GroupRed )
local IsAliveBlue = GroupBlue:IsAlive()
local IsAliveRed = GroupRed:IsAlive()
BASE:E( { IsAliveBlue = IsAliveBlue, IsAliveRed = IsAliveRed } )
end, { GroupBlue, GroupRed }, 1, 1
)

View File

@@ -1,30 +0,0 @@
--- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class.
local HeliGroup = GROUP:FindByName( "Helicopter" )
local AttackGroup = GROUP:FindByName( "AttackGroup" )
local AttackUnits = AttackGroup:GetUnits()
local Tasks = {}
for i = 1, #AttackUnits do
local AttackUnit = AttackGroup:GetUnit( i )
Tasks[#Tasks+1] = HeliGroup:TaskAttackUnit( AttackUnit )
end
Tasks[#Tasks+1] = HeliGroup:TaskFunction( "_Resume", { "''" } )
--- @param Wrapper.Group#GROUP HeliGroup
function _Resume( HeliGroup )
env.info( '_Resume' )
HeliGroup:MessageToAll( "Resuming",10,"Info")
end
HeliGroup:PushTask(
HeliGroup:TaskCombo(
Tasks
), 30
)

View File

@@ -1,24 +0,0 @@
--Create Spawn Groups
local SpawnPlane1 = SPAWN:New("Plane 1")
local SpawnPlane2 = SPAWN:New("Plane 2")
--Spawn Groups into world
local GroupPlane1 = SpawnPlane1:Spawn()
--local GroupPlane1 = GROUP:FindByName( "Plane 1" )
local GroupPlane2 = SpawnPlane2:Spawn()
--local GroupPlane2 = GROUP:FindByName( "Plane 2" )
--Create Task for plane2 (follow groupPlane1 at Vec3 offset) (Note: I think I need to be using controllers here)
--i.e. cntrlPlane1 = groupPlane1.getController(groupPlane1)
local PointVec3 = POINT_VEC3:New( 100, 0, -100 ) -- This is a Vec3 class.
local FollowDCSTask = GroupPlane2:TaskFollow( GroupPlane1, PointVec3:GetVec3() )
--Activate Task (Either PushTask/SetTask?)
-- PushTask will push a task on the execution queue of the group.
-- SetTask will delete all tasks from the current group queue, and executes this task.
GroupPlane2:SetTask( FollowDCSTask, 1 )

View File

@@ -1,12 +0,0 @@
--- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class.
HeliGroup = GROUP:FindByName( "Helicopter" )
--- Route the helicopter back to the FARP after 60 seconds.
-- We use the SCHEDULER class to do this.
SCHEDULER:New( nil,
function( HeliGroup )
local CommandRTB = HeliGroup:CommandSwitchWayPoint( 2, 8 )
HeliGroup:SetCommand( CommandRTB )
end, { HeliGroup }, 90
)

View File

@@ -1,39 +0,0 @@
---
-- Name: GRP-310 - Command StopRoute
-- Author: FlightControl
-- Date Created: 25 Mar 2017
--
-- # Situation:
-- A ground unit is moving.
-- Using the command CommandStopMove it will stop moving after 10 seconds.
--
-- # Test cases:
--
-- 1. Observe the ground group stopping to move.
--
--- @param Wrapper.Group#GROUP GroundGroup
function StopMove( GroundGroup )
BASE:E("Stop")
local Command = GroundGroup:CommandStopRoute( true )
GroundGroup:SetCommand(Command)
end
--- @param Wrapper.Group#GROUP GroundGroup
function StartMove( GroundGroup )
BASE:E("Start")
local Command = GroundGroup:CommandStopRoute( false )
GroundGroup:SetCommand(Command)
end
GroundGroup = GROUP:FindByName( "Ground" )
Scheduler = SCHEDULER:New( nil )
ScheduleIDStop = Scheduler:Schedule(nil, StopMove, { GroundGroup }, 10, 20 )
ScheduleIDStart = Scheduler:Schedule(nil, StartMove, { GroundGroup }, 20, 20 )

View File

@@ -1,45 +0,0 @@
---
-- Name: GRP-400 - RouteReturnToAirbase
-- Author: FlightControl
-- Date Created: 25 Mar 2017
--
-- # Situation:
-- Three air units are flying and are commanded to return a specific airbase.
--
-- # Test cases:
--
-- 1. Observe the Air1 group return to Batumi after 10 seconds.
-- 2. Observe the Air2 group returning to Kobuleti after 300 seconds. (It was planned to land at Kutaisi).
-- 3. Observe the Air3 group returning to the home (landing) airbase after 300 seconds. (It was planned to land at Kutaisi).
--
--- @param Wrapper.Group#GROUP AirGroup
function ReturnToBatumi( AirGroup )
BASE:E("ReturnToBatumi")
AirGroup:RouteRTB( AIRBASE:FindByName("Batumi") )
end
--- @param Wrapper.Group#GROUP AirGroup
function ReturnToKobuleti( AirGroup )
BASE:E("ReturnToKobuleti")
AirGroup:RouteRTB( AIRBASE:FindByName("Kobuleti") )
end
--- @param Wrapper.Group#GROUP AirGroup
function ReturnToHome( AirGroup )
BASE:E("ReturnToHome")
AirGroup:RouteRTB()
end
Air1Group = GROUP:FindByName( "Air1" )
Air2Group = GROUP:FindByName( "Air2" )
Air3Group = GROUP:FindByName( "Air3" )
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 )

View File

@@ -1,21 +0,0 @@
-- This routes a GroundGroup 1km further with an angle of 180 degrees.
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.
ToCoord = FromCoord:Translate( 1000, 180 )
RoutePoints = {}
-- Create a "grount route point", which is a "point" structure that can be given as a parameter to a Task
RoutePoints[#RoutePoints+1] = FromCoord:RoutePointGround( 0 )
RoutePoints[#RoutePoints+1] = ToCoord:RoutePointGround( 60, "Cone" )
-- 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 )

View File

@@ -1,16 +0,0 @@
-- This routes a GroundGroup 1km further with an angle of 180 degrees.
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.
ToCoord = FromCoord:Translate( 1000, 180 )
-- Create a combo task, that creates a route task to the RoutePoint
RouteTask = GroundGroup:TaskRouteToVec2( ToCoord:GetVec2() )
-- Set the task to be executed by the GroundGroup
GroundGroup:SetTask( RouteTask, 1 )

View File

@@ -1,46 +0,0 @@
--- This makes a vehicle fly to random zones when a waypoint has been reached.
-- Name: GRP - Group Commands/GRP-502 - Route at waypoint to random point
-- Author: FlightControl
-- Date Created: 08 Aug 2017
local ZoneList = {
ZONE:New( "ZONE1" ),
ZONE:New( "ZONE2" ),
ZONE:New( "ZONE3" ),
ZONE:New( "ZONE4" ),
ZONE:New( "ZONE5" )
}
GroundGroup = GROUP:FindByName( "Vehicle" )
--- @param Wrapper.Group#GROUP GroundGroup
function RouteToZone( Vehicle, ZoneRoute )
local Route = {}
Vehicle:E( { ZoneRoute = ZoneRoute } )
Vehicle:MessageToAll( "Moving to zone " .. ZoneRoute:GetName(), 10 )
-- 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()
-- Create a "ground route point", which is a "point" structure that can be given as a parameter to a Task
Route[#Route+1] = FromCoord:RoutePointGround( 72 )
Route[#Route+1] = ToCoord:RoutePointGround( 60, "Vee" )
local TaskRouteToZone = Vehicle:TaskFunction( "RouteToZone", RandomZone )
Vehicle:SetTaskAtWaypoint( Route, #Route, TaskRouteToZone ) -- Set for the given Route at Waypoint 2 the TaskRouteToZone.
Vehicle:Route( Route, math.random( 10, 20 ) ) -- Move after a random seconds to the Route. See the Route method for details.
end
RouteToZone( GroundGroup, ZoneList[1] )

View File

@@ -1,45 +0,0 @@
--- This makes a vehicle drive to random zones when a waypoint has been reached.
-- Name: GRP - Group Commands/GRP-503 - NTTR Route at waypoint to random point
-- Author: FlightControl
-- Date Created: 08 Aug 2017
local ZoneList = {
ZONE:New( "ZONE1" ),
ZONE:New( "ZONE2" ),
ZONE:New( "ZONE3" ),
ZONE:New( "ZONE4" ),
ZONE:New( "ZONE5" ),
}
VehicleGroup = GROUP:FindByName( "Vehicle #001" )
--- @param Wrapper.Group#GROUP RoutedGroup
function ReRoute( VehicleGroup )
VehicleGroup:E( "Routing" )
local ZoneNumber = math.random( 1, #ZoneList )
VehicleGroup:E( ZoneNumber )
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" )
local TaskReRoute = VehicleGroup:TaskFunction( "ReRoute" )
VehicleGroup:SetTaskWaypoint( ToWP, TaskReRoute )
VehicleGroup:Route( { FromWP, ToWP }, 1 )
end
ReRoute( VehicleGroup )

View File

@@ -1,126 +0,0 @@
---
-- Name: GRP-550 - Shows how to make an AI bomb ground targets, both static and scenery.
-- Author: Wingthor
-- Date Created: 22 Aug 2020
--
-- Mission illustrates how to make an air GROUP make 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 ordnance in Mission Editor
-- One function handles both attack 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.
--
-- Join the Game Master to observe the reaction of the ground units.
--
-- Blue is attacking.
BASE:TraceOnOff(true)
BASE:TraceAll(true)
--- Help functions ---------------------------------------
--- This function will make a random waypoint between to coordiantes.
--- @param Core.Point#COORDINATE
--- @param Core.Point#COORDINATE
function MakeMiddleWaypoint (TargetCoordinate, InitCoordinate)
BASE:F({TargetCoordinate,InitCoordinate})
--- If we can not solve this function throw noting back so we dont' break anything.
if TargetCoordinate == nil or InitCoordinate == nil then return nil end
--- @type TargetCoordinate Core.Point#COORDINATE
--- @type InitCoordinate Core.Point#COORDINATE
local _TargetCoordinate = TargetCoordinate
local _InitCoordinate = InitCoordinate
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
--- @param #string
--- @param --Core.Point#COORDINATE
--- @param #string AIRBASE
--- @param #string
function PinpointStrike(Group,Target,Base,TargetDescription)
BASE:F({Group,Target,Base})
-- In case all args is not passed.
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 server as an IP
local heading = math.random(90,180)
-- Get targets vevtors
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(function (Moosegroup)
local message = MESSAGE:New("Launching the Pinpointstrike",40,"Order:",true):ToBlue()
end,{})
---@type GROUP
local bomber = SpawnBomber:SpawnAtAirbase(AIRBASE:FindByName( Base ), SPAWN.Takeoff.Cold)
local task = bomber:TaskBombing(targetVec,false,"All",nil,heading,10000) -- WeaponType find this...
local homebasecoords = AIRBASE:FindByName(Base):GetCoordinate() --Core.Point#COORDINATE
--- 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 ingrespoint 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 somwthing to log.
BASE:E("--- Error in PinpointStrike target is too close to base ---" )
return nil
end
-- Set the coordinate altitude
IngressPoint:SetAltitude(8000)
-- Add coordiantes 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() --Core.Point#COORDINATE
local CommandCenterCoords = STATIC:FindByName("SAM ControlCenter",false):GetCoordinate()
-- I have added a small zone over a scenery object in order to grab the coordiantes.
local SceneryTargetCoordiate = ZONE:New("SceneryTarget"):GetCoordinate()
BASE:ScheduleOnce(5,PinpointStrike,"Bloue Owl 1-1",CommandCenterCoords,AIRBASE.Caucasus.Sukhumi_Babushara,"Bomb Command Center")
BASE:ScheduleOnce(10,PinpointStrike,"Bloue Owl 1-1",SceneryTargetCoordiate,AIRBASE.Caucasus.Sukhumi_Babushara,"Bomb Commanders House")

View File

@@ -1,126 +0,0 @@
---
-- Name: GRP-550 - Shows how to make an AI bomb ground targets, both static and scenery.
-- Author: Wingthor
-- Date Created: 22 Aug 2020
--
-- Mission illustrates how to make an air GROUP make 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 ordnance in Mission Editor
-- One function handles both attack 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.
--
-- Join the Game Master to observe the reaction of the ground units.
--
-- Blue is attacking.
BASE:TraceOnOff(true)
BASE:TraceAll(true)
--- Help functions ---------------------------------------
--- This function will make a random waypoint between to coordiantes.
--- @param Core.Point#COORDINATE
--- @param Core.Point#COORDINATE
function MakeMiddleWaypoint (TargetCoordinate, InitCoordinate)
BASE:F({TargetCoordinate,InitCoordinate})
--- If we can not solve this function throw noting back so we dont' break anything.
if TargetCoordinate == nil or InitCoordinate == nil then return nil end
--- @type TargetCoordinate Core.Point#COORDINATE
--- @type InitCoordinate Core.Point#COORDINATE
local _TargetCoordinate = TargetCoordinate
local _InitCoordinate = InitCoordinate
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
--- @param #string
--- @param --Core.Point#COORDINATE
--- @param #string AIRBASE
--- @param #string
function PinpointStrike(Group,Target,Base,TargetDescription)
BASE:F({Group,Target,Base})
-- In case all args is not passed.
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 server as an IP
local heading = math.random(90,180)
-- Get targets vevtors
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(function (Moosegroup)
local message = MESSAGE:New("Launching the Pinpointstrike",40,"Order:",true):ToBlue()
end,{})
---@type GROUP
local bomber = SpawnBomber:SpawnAtAirbase(AIRBASE:FindByName( Base ), SPAWN.Takeoff.Cold)
local task = bomber:TaskBombing(targetVec,false,"All",nil,heading,10000) -- WeaponType find this...
local homebasecoords = AIRBASE:FindByName(Base):GetCoordinate() --Core.Point#COORDINATE
--- 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 ingrespoint 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 somwthing to log.
BASE:E("--- Error in PinpointStrike target is too close to base ---" )
return nil
end
-- Set the coordinate altitude
IngressPoint:SetAltitude(8000)
-- Add coordiantes 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() --Core.Point#COORDINATE
local CommandCenterCoords = STATIC:FindByName("SAM ControlCenter",false):GetCoordinate()
-- I have added a small zone over a scenery object in order to grab the coordiantes.
local SceneryTargetCoordiate = ZONE:New("SceneryTarget"):GetCoordinate()
BASE:ScheduleOnce(5,PinpointStrike,"Bloue Owl 1-1",CommandCenterCoords,AIRBASE.Caucasus.Sukhumi_Babushara,"Bomb Command Center")
BASE:ScheduleOnce(10,PinpointStrike,"Bloue Owl 1-1",SceneryTargetCoordiate,AIRBASE.Caucasus.Sukhumi_Babushara,"Bomb Commanders House")

View File

@@ -1,47 +0,0 @@
--Texaco
--//////////////////////////////////
--////////////Tankers and awacs v1
--//////////////////////////////////
--////////// By Targs35 /////////////
--//////////////// from 62nd Air Wing, Brisbane server..
--///////////////////////////////////
------- With thanks to the guys at MOOSE and in particular Pikes, Nolove, Delta99 and Wingthor
-- Funky Frank is the man..
-----////////////////////////////////
----///////////////// Object names in ME /
--- Names are used for both Group and UnitName --
---Tanker_Texaco_Droge
---Escort_Texaco
--/////////////////////////////////////
--/////////// Spawn Tanker and Escorts ///
---its from here things get new for me, code below is in BETA
do
--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 )
-- Now to spawn the ojects
--Texaco set Task
--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()
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.
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 )
end
env.info("Tanker_Texaco Loaded v.03.5")

View File

@@ -1,17 +0,0 @@
--- This makes a vehicle drive its route in a repetitive way.
-- Name: GRP-550 - Patrol a route
-- Author: FlightControl
-- Date Created: 24 Sep 2017
-- 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()

View File

@@ -1,17 +0,0 @@
--- This makes a vehicle drive its route using the waypoints of the route and selecing random points on the route.
-- Name: GRP-551 - Patrol to random points of a route
-- Author: FlightControl
-- Date Created: 24 Sep 2017
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Patrol to random points 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 random points of the route at 120 km/h in "Vee" formation.
Ship:PatrolRouteRandom( 120, "Vee" )

View File

@@ -1,16 +0,0 @@
--- This makes a vehicle drive its route selecting random points in a zone.
-- Name: GRP-552 - Patrol in a zone
-- Author: FlightControl
-- Date Created: 24 Sep 2017
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Patrol to random points in the trigger zone ZONE, at 120 km/h in Vee format.
Vehicle:PatrolZones( { ZONE:New( "ZONEVEHICLE" ) }, 120, "Vee" )
-- Find the Vehicle and create a GROUP object.
Ship = GROUP:FindByName( "Ship" )
-- Patrol to random points in the trigger zone ZONE, at 120 km/h in Vee format.
Ship:PatrolZones( { ZONE:New( "ZONESHIP" ) }, 120, "Vee" )

View File

@@ -1,16 +0,0 @@
--- This makes a vehicle drive its route selecting random points in a zone.
-- Name: GRP-553 - Patrol in a list of zones
-- Author: FlightControl
-- Date Created: 24 Sep 2017
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Patrol to random points in the trigger zones ZONEVEHICLE1, ZONEVEHICLE2, ZONEVEHICLE3, at 120 km/h in Vee format.
Vehicle:PatrolZones( { ZONE:New( "ZONEVEHICLE1" ), ZONE:New( "ZONEVEHICLE2" ), ZONE:New( "ZONEVEHICLE3" ) }, 120, "Vee" )
-- Find the Ship and create a GROUP object.
Ship = GROUP:FindByName( "Ship" )
-- Patrol to random points in the trigger zones ZONESHIP1, ZONESHIP2, ZONESHIP3, at 120 km/h in Vee format.
Ship:PatrolZones( { ZONE:New( "ZONESHIP1" ), ZONE:New( "ZONESHIP2" ), ZONE:New( "ZONESHIP3" ) }, 120, "Vee" )

View File

@@ -1,10 +0,0 @@
--- This makes a vehicle respawn itself when the mission starts.
-- Name: GRP-600 - Respawn
-- Author: FlightControl
-- Date Created: 01 Mar 2018
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Respawn the vehicle.
Vehicle:Respawn()

View File

@@ -1,11 +0,0 @@
--- This makes a vehicle respawn itself when the mission starts.
-- The vehicle is hidden, so you need to observe from the watch tower!
-- Name: GRP-601 - Respawn hidden
-- Author: FlightControl
-- Date Created: 01 Mar 2018
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Respawn the vehicle.
Vehicle:Respawn()

View File

@@ -1,16 +0,0 @@
--- This makes a vehicle respawn itself when the mission starts.
-- Name: GRP-600 - Respawn
-- Author: FlightControl
-- Date Created: 01 Mar 2018
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1.
RespawnZone1 = ZONE:New( "ZONEVEHICLE1")
-- Prepare the spawning to be done in RespawnZone1.
Vehicle:InitZone( RespawnZone1 )
-- Respawn the vehicle in RespawnZone1.
Vehicle:Respawn()

View File

@@ -1,18 +0,0 @@
--- This makes a vehicle respawn itself within ZONEVEHICLE1.
-- The vehicle group consists of multiple units and are spawned in relation to the original template position.
--
-- Name: GRP-611 - Respawn multiple units in Zone
-- Author: FlightControl
-- Date Created: 01 Mar 2018
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1.
RespawnZone1 = ZONE:New( "ZONEVEHICLE1")
-- Prepare the spawning to be done in RespawnZone1.
Vehicle:InitZone( RespawnZone1 )
-- Respawn the vehicle in RespawnZone1.
Vehicle:Respawn()

View File

@@ -1,19 +0,0 @@
--- This makes a vehicle respawn itself within ZONEVEHICLE1.
-- The vehicle group consists of multiple units and are spawned in randomized within the new zone.
--
-- Name: GRP-612 - Respawn multiple units in Zone randomized.
-- Author: FlightControl
-- Date Created: 01 Mar 2018
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1.
RespawnZone1 = ZONE:New( "ZONEVEHICLE1")
-- Prepare the spawning to be done in RespawnZone1.
Vehicle:InitZone( RespawnZone1 )
Vehicle:InitRandomizePositionZone( true )
-- Respawn the vehicle in RespawnZone1.
Vehicle:Respawn()

View File

@@ -1,17 +0,0 @@
--- This makes a vehicle respawn within ZONEVEHICLE1.
-- The vehicle is hidden, so you need to observe at the watch tower through external view.
-- Name: GRP-615 - Respawn in Zone hidden
-- Author: FlightControl
-- Date Created: 01 Mar 2018
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1.
RespawnZone1 = ZONE:New( "ZONEVEHICLE1")
-- Prepare the spawning to be done in RespawnZone1.
Vehicle:InitZone( RespawnZone1 )
-- Respawn the vehicle in RespawnZone1.
Vehicle:Respawn()

View File

@@ -1,19 +0,0 @@
--- This makes a vehicle respawn itself within ZONEVEHICLE1.
-- The vehicle group consists of multiple units and are spawned in relation to the original template position.
-- The vehicle is hidden, so you need to observe from the watch tower (external view).
--
-- Name: GRP-616 - Respawn multiple units in Zone hidden
-- Author: FlightControl
-- Date Created: 01 Mar 2018
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1.
RespawnZone1 = ZONE:New( "ZONEVEHICLE1")
-- Prepare the spawning to be done in RespawnZone1.
Vehicle:InitZone( RespawnZone1 )
-- Respawn the vehicle in RespawnZone1.
Vehicle:Respawn()

View File

@@ -1,20 +0,0 @@
--- This makes a vehicle respawn itself within ZONEVEHICLE1 hidden.
-- The vehicle group consists of multiple units and are spawned in randomized within the new zone.
-- The vehicle is hidden, so you need to observe from the watch tower (external view).
--
-- Name: GRP-617 - Respawn multiple units in Zone randomized hidden
-- Author: FlightControl
-- Date Created: 01 Mar 2018
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1.
RespawnZone1 = ZONE:New( "ZONEVEHICLE1")
-- Prepare the spawning to be done in RespawnZone1.
Vehicle:InitZone( RespawnZone1 )
Vehicle:InitRandomizePositionZone( true )
-- Respawn the vehicle in RespawnZone1.
Vehicle:Respawn()

View File

@@ -1,29 +0,0 @@
--- This makes a vehicle respawn itself within ZONEVEHICLE1.
-- The vehicle group consists of multiple units and are spawned in randomized within the new zone.
-- When the last vehicle of the group is destroyed, the group will respawn.
--
-- Name: GRP-620 - Respawn multiple units when destroyed
-- Author: FlightControl
-- Date Created: 01 Mar 2018
-- Find the Vehicle and create a GROUP object.
Vehicle = GROUP:FindByName( "Vehicle" )
-- Setup RespawnZone1 linking to the trigger zone ZONEVEHICLE1.
RespawnZone1 = ZONE:New( "ZONEVEHICLE1")
-- Prepare the spawning to be done in RespawnZone1.
Vehicle:InitZone( RespawnZone1 )
Vehicle:InitRandomizePositionZone( true )
Vehicle:HandleEvent( EVENTS.Dead )
function Vehicle:OnEventDead( EventData )
self:E( { "Size ", Size = Vehicle:GetSize() } )
-- When the last vehicle of the group is declared dead, respawn the group.
if Vehicle:GetSize() == 1 then
-- Respawn the vehicle in RespawnZone1.
Vehicle:Respawn()
end
end

View File

@@ -1,27 +0,0 @@
---
-- Name: GRP-900 - Option Green and Red State
-- Author: FlightControl
-- Date Created: 10 Dec 2017
--
-- This tests the option to set the alarm state of a group to RED or GREEN.
-- Both options are tested with two groups.
-- 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.
--
-- Join the Game Master to observe the reaction of the ground units.
--
-- Blue is attacking.
-- Green is defending.
--
RedStateGroup = GROUP:FindByName( "Red State" )
GreenStateGroup = GROUP:FindByName( "Green State" )
RedStateGroup:OptionAlarmStateRed()
GreenStateGroup:OptionAlarmStateGreen()