Skip to content

Commit

Permalink
Added mission Wrapper/Group/GRP-200-Follow-Group
Browse files Browse the repository at this point in the history
  • Loading branch information
kaltokri committed Feb 24, 2024
1 parent 5fe1bf9 commit 2f511f5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Wrapper/Group/GRP-200-Follow-Group/GRP-200-Follow-Group.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
-- Author: FlightControl
-- Created: 20.10.2018
-- 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.Point.html
--
-- # Description:
--
-- In this two planes will be spawned.
-- The second one will follow the first one.
--
-- # Guide:
--
-- 1. Start the mission and watch the planes moving.

-- Create spawn objects from groups:
local SpawnPlane1 = SPAWN:New("Plane 1")
local SpawnPlane2 = SPAWN:New("Plane 2")

-- Spawn the groups into the world:
local GroupPlane1 = SpawnPlane1:Spawn()
local GroupPlane2 = SpawnPlane2:Spawn()

--Create a task for Plane 2 (follow GroupPlane1 at Vec3 offset):
local PointVec3 = POINT_VEC3:New( 100, 0, -100 ) -- This is a Vec3 class.
local FollowDCSTask = GroupPlane2:TaskFollow( GroupPlane1, PointVec3:GetVec3() )

-- Activate Task with 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.
-- We use SetTask this time:
GroupPlane2:SetTask( FollowDCSTask, 1 )
Binary file not shown.

0 comments on commit 2f511f5

Please sign in to comment.