Further updating of Demonstration Missions

This commit is contained in:
Sven Van de Velde
2016-12-08 14:19:29 +01:00
parent 3b31fca7c0
commit 618fdb8405
48 changed files with 0 additions and 0 deletions
@@ -0,0 +1,24 @@
--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 )
@@ -0,0 +1,12 @@
--- 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
)
@@ -0,0 +1,39 @@
BASE:TraceClass( "UNIT" )
BASE:TraceClass( "GROUP" )
BASE:TraceClass( "CLIENT" )
UnitTankAI1 = _DATABASE:FindUnit( "Smoke Test 1" )
UnitTankAI2 = _DATABASE:FindUnit( "Smoke Test 2" )
UnitTankAI3 = UNIT:FindByName( "Smoke Test 3" )
UnitTankAI4 = _DATABASE:FindUnit( "Smoke Test 4" )
UnitTankAI1:SmokeBlue()
UnitTankAI3:SmokeOrange()
UnitTankAI2:T( UnitTankAI2:GetAmmo() )
GroupTanks = GROUP:FindByName( "Smoke Test" )
GroupTanks:T( GroupTanks:OptionROEOpenFirePossible() )
GroupTanks:OptionROEOpenFire()
local function ClientAlive( Client, ClientNumber )
GroupTanks:MessageToClient( "Hello Client " .. ClientNumber .. "! We are reporting to you on our way...", 5, Client )
end
ClientHeli = CLIENT:FindByName( "Client Test 1", "Fly slowly to waypoint 3 of the Command Post!" ):Alive( ClientAlive, 1 )
ClientHeli2 = CLIENT:FindByName( "Client Test 2", "Fly slowly to waypoint 3 of the Command Post!" ):Alive( ClientAlive, 2 )